It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
To start a new project/webapp on Node.js, I need:
Folder Structure;
Libraries (Express, RequireJS, Mocha, Bower, ...);
Software Phases - Build, Compile, Testing, ...;
...
Which is the best Stack for Large-Scale projects on Javascript/Node.js?
Thanks in advance for your help!
First thing's first, keep it simple. Every new tool you add is another dependency, and another potential stress point for the project. With that in mind, some good tools, methodologies, and best-practices for server-side javascript development are:
Folder Structure
This doesn't really matter. Just do what makes sense to you, and what you think will make sense to others if you plan to have collaborators. Search github for Node.JS projects and see how they're structured. I found one good example: https://github.com/thomasdavis/backbonetutorials/tree/gh-pages/examples/nodejs-mongodb-mongoose-restify
Libraries
The libraries you use is going to greatly depend on what type of project you're working on. Does the REST API hit a database? Is it MongoDB, redis, MySQL, Neo4J, ... ? You're going to need an interface for that.
Express is a great framework. (I believe it can start a project for you even.)
Technologies
Have you considered Coffee/Clojure-script? This extra step at compile time can save you a lot of headaches later on. Your code will also be more readable to others. Jslint is another great tool to verify javascript code. Also, I have to suggest using git for version control. If you aren't: learn it, master it, use it. http://www.git-legit.org/
Methods
Your software development strategy will be dependent on what tools you end up using as well as your own personal choices with regard to how you like to write software. I would suggest using Jenkins to continuously integrate your code, and some sort of test framework to ensure what you write is right.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have been trying to create a mongodb server which will receive post requests and insert or read from a mongodb server and reply back. I have started with node.js. However while I was reading stuff, I have been realizing, people actually hate node.js. Many people are crossing to GO. So I am all confused now.
I have chosen node.js because of the natural json compatibility of javascript. However after all the things I have read, node.js sounds like a waste of time.
Could someone help me clarify my confusion ?
Thank you.
Edit : People refer to the problem of callback hell, and lowering performance of node.js once the business logic starts to be more complex than simple loops.
People refer to the problem of callback hell
This has never been an issue for me. You can use whatever structure you want in your code. Any promise library may be helpful if you find that you really need 1,000 nested callbacks, but this is rare in most circumstances.
lowering performance of node.js once the business logic starts to be more complex than simple loops
Rarely is this a problem. Most applications are IO-bound. If yours isn't, you have a couple options. One is not to use Node.js. Another is to compile a native extension for the specific part that's dragging you down (since you'll be writing native code to solve this problem anyway) and call it from the rest of your Node.js application. That way you get most of the performance of your native code but still get the flexibility of working in JavaScript.
Since you linked to that Reddit post, I'll address some of the comments there.
Javascript is very fast. Yes this is true, V8 is very fast... however, only if you are benchmarking a simple benchmark. As soon as you start adding in complex application logic all that performance goes out the door because the virtual machine has a very difficult time correctly inferring the type and thus not being able to optimize. But if your application consists of a tight loop, it will be fast.. so its got that going for it :D
It's all relative. No doubt that weakly typed and interpreted anything is slower. It's a trade-off that you have to decide makes sense for what you're doing. Personally, it's far cheaper for me to fire up another box to handle the load than it is to rewrite all of the helpful modules and frameworks I use in Go. Maybe that's not the case for you, so you get to decide.
In my 3 years of full time node.js development, I have honestly only had ONE occasion where I used the same 4 lines of code both in the server and in the client.
This is generally true. I don't understand why shared client/server code is some sort of selling point for Node.js, as it isn't for most applications. I had one case where several classes I wrote for an RPC layer ran on both the server and the client. One thing I will say though is that there are a ton of NPM packages that run in both so if you get used to using a nice package on one, it will often times work on the other.
Ohh and did I mention Node.js isn't really all JavaScript? A good portion of the pakcages on NPM are also written in Coffeescript. Hope you don't mind learning another language to deal with a package you depend on. So much for using the same language for both server and client!
You don't have to learn Coffeescript to use an NPM package written in Coffeescript. Coffeescript compiles to JavaScript, and are used in your code the same way any other package is. Also, those same Coffeescript packages do run just fine in the browser since it all builds to JavaScript.
With Go you get type safety. This CANNOT be overstated.. except to maybe ruby-ists(jk jk! don't shoot me).
It's up to you to decide if this matters for your use case.
The one benefit you have with Node.js over Go is the massive number of packages available on NPM. But most of them are useless abandoned junk. So, even that is questionable.
Don't use abandoned junk, just like you wouldn't with any packages on any platform. It's very easy to see what's abandoned junk. NPM calls out what's been updated and when, whether or not its dependencies are up to date, and how many people are using that package. There are definitely a massive number of useful packages available for Node.js, just like they are for most popular platforms.
Testing: Lets just say that in Node.js/Javascript you would have to write tests that check the type of a variable. tsk tsk tsk... This is the only way to properly test JS and make sure nothing crazy is going on.
That's not really accurate, and I'm really curious what's going on in this person's application where this is necessary.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have 3 JSF projects (let's say A, B, C) each having same database, server. I want to merge projects A, B into one and make it available over internet, similarly merge project A, C into one and make it available over intranet.
Intranet website will need an authentication layer, I will probably add JDBCRealm authentication.
What is the best procedure to do this, I want the code to be reusable. Do I need to use EJB?
Not sure I understand the question. But if you just want advice on how to manage projects and dependencies between them I would take a look at maven.
http://maven.apache.org/guides/mini/guide-multiple-modules.html
I have a setup I really like, it's basic but I will describe it anyway:
myproject-webapp: This module / project has JSF facelets, controllers, and other things specific for the web portal. It is the topmost project in terms of dependencies.
myproject: This module has the domain classes and the specific business logic.
Whenever I start a new project it is composite of those two parts. Now anytime I write some domain or business logic code that other projects can benefit from I put that code in it's own module called "core".
Respectively any time I write some jsf or web aware code that could (and should) be unspecific I make that generic as well and put it in "web-util".
So anytime I create a new project first thing I do is declare dependencies to "core" and "web-util". This makes each project really slim code-wise and straight to the point. Boilerplate code such as as generic dao, custom converters, custom interceptors/producers/events and whatnot is immediately available.
Separate out all your concerns, that is authentication and other environment specific information (a,b, &c)
Create deployment scripts that build target specific or deploy target environment specific.
Note there is a difference in the above ( user whichever is safest).
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have been really playing with node.js alot here lately. I really like it and would like to get serious about building a site that I have in mind with it. There are just a few things that I had questions on. I am currently using express, cluster, mongoose(mongodb), and dust because it seems like the community is doing pretty well with this setup.
The first question that I have run into is making changes in the app. If I change one of the files in my app (with the exception of templates), I have to restart the app in order for the changes to show up. Is there something out there that will do this automatically or is there something I am missing?
The second question I have is, are there any really good resources out there that anyone can recommend. Seems like alot of the stuff that I have found through google just explains one topic and there are not alot of books on it yet(see some good ones releasing this year though). I was wondering if there was a really good resource for node applications (really interested in how people are structuring there applications and what they are using).
The third question or really feedback I would like to get is what good node modules should I be looking into using for my application. I really like cluster and running apache benchmarks with it versus without it I saw a double in the number of requests it could handle when using all 4 cores versus just the single core. I want to try and keep my code so that I dont have to write the logic twice for the backend / frontend which is why i have decided to use dust as my templating choice.
The last thing that I would like to know is based on an article that I read by linkedin (http://engineering.linkedin.com/frontend/leaving-jsps-dust-moving-linkedin-dustjs-client-side-templates). After reading this article I was just impressed by the ingenuity that they came up with to do this. I see many benefits from this by saving bandwidth on the server from not having to server process the files each time and letting the users browser do the load. It also will allow for less bandwidth throughput by not sending the whole template to the browser every time and caching it. But I am just stumped as to how they accomplished this. Can someone please shine some light on this subject or if you know of a good article that explains how to do this it would be great. I dont know for sure I would use this implementation but I would love to know how to do in case it is applicable.
Thanks for any feedback.
First question:
Actualy there are multiple tools that do the job starting from nodemon to supervisor
Second question:
Learning materials
videos: nodetuts
books: from node beginner and more books
podcast: nodeup
alot of great bloggers: laurenzo | Peteris Krumins about usefull nodejs modules | dailyjs and many more
grouped modules: toolbox.no.de (for unknown reason not working now)
Not to forget nodejs docs. Also browsing github and reading source for great nodejs modules or apps can be quite good for learning.
Third question:
i think my Second question answer includes this one also.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I want to start and learn coding to create a web application. I have experience in Java, C, Lisp, and Perl. I heard node.js is good to learn.
Can anyone suggest a good place to start?
You just need to learn javascript. Pedro Teixeira makes node screencasts which you can watch it at http://nodetuts.com/. Just sit back, relax and watch these screencasts to learn about nodejs.
Furthermore I would advice you to master:
npm: npm is a package manager for node
expressjs.com: High performance, high class web development for Node.js.
socket.io: Socket.IO aims to make realtime apps possible in every browser and mobile device, blurring the differences between the different transport mechanisms.
The basic of these programs are also explained with those screencasts.
You could start with a tutorial like the one at nettuts or the Node Beginner Book for example.
There's also an introduction video on the homepage of node.js itself. Check that out as well.
The "Let's make a webapp" tutorial of dailyjs is also a nice starting Point. And don't forget the Node Guide. There is also a free ebook called Mastering Node which may be interesting.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Can anybody guide me to know what is the basics required to learn COGNOS, whether a person who has an MBA or MIS is trainable even without any basic training on reporting tools?
To effectively learn COGNOS' reporting tools, you should know some SQL (at the bare minimum, its syntax) and DBMS basics. You will also use some "programming" logic such as if/else statements and case statements.
More importantly, you need an intimate familiarity with the data you are reporting against, as you will need to verify your reports once you start building them.
I strongly suggest downloading the COGNOS trial with sample data and going through the install guide. Get it running in your local environment and do some testing there. COGNOS is best consumed hands-on.
Your education level has nothing to do with how you are able to comprehend and utilize a web application. I am nowhere near an MBA or MIS, and the majority of issues I have with COGNOS are related to how it aggregates data.
Javascript (jQuery, preferably) is pretty much a necessary to get more usable interfaces, so knowing that helps a lot too.
Knowing Java can be useful if you are required to work with the SDK. As far as SQL make sure your familiar with joins and different functions of the dialect of database you are using. It is also important to have a basic understanding of HTTP because your often configuring the environment.
Cognos is a powerful tool, so once you have all configured the report authoring is fairly simple. However, based on my experience I would recommend to have the following skills:
1. SQL. Although you can develop lot of functionality in the Framework Manager or even in Report Studio, mapping queries from DB is crucial.
2. HTML. Cognos outputs are rendered in HTML so it would help basic skills here. Besides, the layout uses lot of tables so make sure you understand those concepts well.
3. CSS. Behind the scenes, Cognos uses lots of CSS to styles, themes and defaults. You can even create custom themes. If you're going for a big project, make sure to backup the CSS files and modify everything from there. It is a hardache to modify styles within Report Studio as any minor change would be cumbersome.
If you master these skills, learning Cognos is not such a painful process. Check my tutos in youtube if you like: http://youtube.com/maulazyhola, I wish I had time to write more, but they got some cool stuff that would help you.
In case anything comes up you can post it here, I would be glad to help. Cheers.