views:

434

answers:

4

I've recently "discovered" Node.js, and after I was finished having my mind blown, I started looking for a web application framework like Django or Codeigniter that uses Node.js. The main reasons I found online for using a Node.js-based framework were:

  1. Impressive scalability and speed, especially regarding simultaneous connections
  2. Same language on front-end and server allow for code-reuse and better maintainability
  3. Makes real-time parts of application easy as pie

(If anyone has any other reasons to share, please do so!)

I found Express http://expressjs.com/ and Geddy http://geddyjs.org/.

  • Are there any others worth looking into?
  • Of these two, what are their various strengths / weaknesses, and how do you think they compare to a framework like Django or Codeigniter?
  • Finally, what do you think about switching over to a Node.js-based framework for all future web applications?
+2  A: 

Express and Geddy are the main contenders at the moment and I think either are comparable to Django and CodeIgniter.

I have personally gone with Express as my framework of choice. Some of this is simply a matter of preference - Express is more from the Sinatra school of thought, Geddy seems more atuned to Rails, if you know what I mean. I also think the development around Express is a little more active.

Toby Hede
+1  A: 

I echo Toby Hede's thoughts and encourage you to stick with Express until other frameworks stabilize. The only major problem with Geddy is that it does not expose a http.Server instance required for Socket.IO (currently the best cross-browser websockets library available for node) and hence you are completely cut-off from using websockets to develop anything that has to do with realtime.

So at the present, Express is the way to go.

As far as your last question is concerned: node.js is in itself undergoing rapid development. The current node v0.3.0-pre pretty much breaks quite a lot of modules. If you are wanting to develop anything for production purposes it is not the right time to do so. If you have a itch to scratch, build node v0.2.1.

Shripad K
A: 

There is also Fab .. but it seems to be more difficult to use since it's a whole new way of building apps.

Check out the jsconf video for it and see if it fits you.

never_had_a_name
A: 

To answer my own question, I've made my own Node module / framework, called Ni, inspired by CodeIgniter.

It's cool because it's very minimalistic, easy to use, and is packaged as a regular Node module, so it doesn't get in the way of using other modules and Node plugins in your project.

Using it is as simple as telling Ni where to look for your files, and then asking it to boot:

global.Ni = require('../lib/ni');
Ni.setRoot(__dirname);
Ni.boot(function() {
    // Ready to start the server!
}

The rest of your code now has access to all your models, views, and controllers in Ni.models, Ni.views and Ni.controllers.

Ni also provides a router you can use with Connect to have requests sent to the appropriate controller functions according to URL segments.

It parses the URL and sends the request to the correct controller function as follows:

http://yourapp.com/[controller]/[function]/[argument 1]/[argument 2]/[etc]

Check Ni out on Github, and let me know what you think about it!

Chetan