Which Technology Stack (modules, Frameworks) Is Better For The First Node.js Project In Order To Study Node And Make A Good Product?
Solution 1:
I will try answering your question from the view of someone who has tried getting into Node.js through concurrent development of an identical project with different combinations of 'state of the art' modules.
The complexity of your project dictates the approach, as usual. If you want to learn the whole range of the intricacies of Node, you can build from scratch and just use relevant libraries (such as connect and database layer abstraction such as cradle or mongoose, more in Answer 2.) when you have the need for them.
If you want to have a codebase from which you can find workable solutions, you should go for the Express framework (built upon connect), since it seems to be the most widespread among node developers. Many tutorial sites supply easy-to-follow examples that include this framework. The Bogart module will do the same, but it is not as publically known.
Apart from Express, you might want to look into a Templating System for your HTML output. I would suggest Jade for that. I will explain why in Answer 4. An alternative would be Moustache or EJS.
Then you should check out cradle or mongoose, since these modules will be needed for convenient DB access. Now that core functionality and DB are covered, you might want to look into LESS or SASS modules for CSS magic.
Authentication can be handled by everyauth, it supplies twitter, facebook and many more oauth functions.
I think i have covered the modules in 2. already, so now onto the DB question. I did enjoy working with MongoDB, and you can easily go with that and find alot of documentation and best-practices on the Internet. I myself have found CouchDB much more interesting, since it provides a fantastic API-based access and it's catchphrase is "Relax." - but it is not really that important. As long as you understand the NoSQL-approach that drives mongo and couch, you can use any of them. I strongly suggest to avoid traditional SQL-based databases since the JSON-formatted output of the NoSQL database systems integrates seamlessly into the JavaScript-environment that is Node.js.
I developed with JS and Coffee and i can tell you one thing: with a cup of the latter, you will have a much easier time getting your projects up and running. Indentation-based programming plays hand in hand with Jade Templating system, which is also indentation-sensitive. Having the same mindset for server code and view code (and CSS, even thou indentation there is just for your own convenience) makes developing both at the same time much easier. I have yet to find a problem from JS that could not be solved with a much more beautiful CoffeeScript expression.
Follow the node project on github, follow the Express/Connect/cradle/Jade/mongoose/..-project on github, google for "blog node express tutorial" and try joining the IRC community on irc.freenode.net. The interesting channels there would be #node.js and maybe ##javascript. From there on, people will show you to more specialized rooms. I strongly suggest you go there, it is a very helpful bunch.
The O'Reilly publisher has some very good books, but they are outdated the moment they are shipped to the bookstore. Since the community is developing new features and versions on a daily basis, you should try to get as close to the developers of the core functionality as possible. On IRC, you can even ask them with your (probably mildly interesting) problems - you will get answers and hints nonetheless.
In short: stay in touch with the community.
Solution 2:
- Connect is a powerful and flexible mini-framework. With the right set of modules it is the best solution, I think.
- node-mongodb-native for MongoDB, db-mysql for MySQL, just for templating. Use The node toolbox to find more.
- I use MongoDB and MySQL. It depends on the project.
- I use plain JavaScript but it's a matter of taste. I love native.
- Source code. Realy. Node.JS ecosystem is evolving very quickly. Most of the documentation out of date at the time of its writing. Use GitHub to watch for projects. This is really helpful.
Solution 3:
- Use libraries and not framework, except maybe expressjs. Most frameworks tends to make a problem more complex than it's already is. Do use libraries that's on good licensing terms. If they're not maintained anymore, you can at least take over the project.
- ExpressJS, Jade, Stylus, SocketIO, underscore, jsdom
- Mongo is definitely the most popular these days. I think the reason is because it's console interface uses JavaScript. It creates more of a 'language synergy' with the developer.
- CoffeeScript has its own quirks, but still it's a hell lot better than plain JavaScript. Note, this is an opinion.
- Can't help you there; I went through the learn process from just reading online stuff.
Solution 4:
- It depends on your knowledge base .. i started by using a bunch of frameworks and worked my way backwards into understanding core concepts, but I'd recommend start small first
- There are more than enough Express guides, and is a great way to get rolling with node, but it does require a templating engine such as Jade or EJS .. (i prefer ejs to render basic .html files). As an asside, node has a ton of base modules eg: require('http'); that are good starting points to understanding request flow.
- Mongo and Redis are some of the most forgiving db's IMO, and have tons of abstraction. although you could go with something more commercial like Parse.com
- If you already know JS .. stick with it. otherwise, go with CS as a way to rapidly write Javascript, not to replace it's foundations. There are also more JS examples online for beginners, but way more rock solid coffee script implementations on Git
- Not really sure abou this either .. Look at Brad Dayley's "NodeJS, MongoDB, and AngularJS" book and google MEAN stack development
Post a Comment for "Which Technology Stack (modules, Frameworks) Is Better For The First Node.js Project In Order To Study Node And Make A Good Product?"