Integration of Node.js and Backbone.js

40,310

Solution 1

This is a good tutorial that shows how to setup that entire stack.

http://backbonetutorials.com/nodejs-restify-mongodb-mongoose/

In short...

Node.js

You can use a library like restify to provide a restful API for your client-side Backbone application. It can also serve your static assets for your Backbone application. The example uses restify, but could be accomplished with other libraries like express.

Mongoose

Mongoose is a javascript abstraction layer for MongoDB. This provides an easy way to interact with MongoDB from Node.js.

Backbone

Your Backbone application can utilize your restify node.js backend to handle the model synchronization. You should have plenty of control to setup the routes via restify in a way that makes Backbone happy.

Solution 2

This ebook could be useful (it's on Backbone, but uses Node for the backend):

http://addyosmani.github.io/backbone-fundamentals/

You also may want to look at this book:

http://www.amazon.com/Building-Node-Applications-MongoDB-Backbone/dp/1449337392

Solution 3

There is also Node Cellar Source.

There is not much explanation about the code, but the app is simple enough to get started and understand the basics layouts of node / backbone

It is, i think, just between an 'Hello World' code and a full app.

Solution 4

I use for ap in backbone yeoman https://github.com/yeoman/generator-backbone and you use it with node.js too

Share:
40,310

Related videos on Youtube

Will Piers
Author by

Will Piers

Intern Developer at Rally Software. Math Student at Colorado State University.

Updated on October 16, 2020

Comments

  • Will Piers
    Will Piers over 3 years

    I have done considerable reading on both Node.js and Backbone.js; I've read some tutorials and done the relevant courses on Code School. I feel that I've got a pretty good idea of the functions that each technology serves in the context of a web application.

    My problem is that I don't really know how to integrate the two technologies and use them in tandem. I would really appreciate if someone could point me to a resource which goes through the entire development of an application using Node, MongoDB, and Backbone together.

    Many thanks

  • Aravind
    Aravind about 11 years
    I would not recommend the second suggestion offered above(Building Node Applications with MongoDB and Backbone) as it lacks clarity and needs serious editing.Definitely not for people who are just starting to build applications in node.
  • Aravind
    Aravind about 11 years
    Ahh I see, the idea behind building a social network is all great, and there are some great guidelines on managing your files well, however the code parts are presented in pieces and for a beginner it may be very difficult to see how the pieces fit together.
  • Will Piers
    Will Piers about 11 years
    I have some experience developing with Rails. It's just a little confusing in this new environment because Rails automatically makes a lot of these connections for you. Just thought I'd add that, in case that would change your recommendations
  • Juan Fuentes
    Juan Fuentes almost 8 years