NodeCellar: Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB

In my previous post, I shared my recent experience building a RESTful API with Node.js, MongoDB, and Express.

In this post, I’m sharing the client application that uses that RESTful API. The Node Cellar application allows you to manage (retrieve, create, update, delete) the wines in a wine cellar database.

The client application is built with Backbone.js and Twitter Bootstrap.

Run the Application

You can run the application here. For obvious reasons, the create, update, delete features have been disabled in this hosted version.

NOTE: Node.js is running on port 3000 on my EC2 Instance. My friend James Ward convinced me to host the application on their service over at Heroku. It’s now running on port 80 at Thanks James!


The details of the Node.js, MongoDB, and Express implementation are documented in my previous post.


In this application, Node.js is used to provide the RESTful services that the client application needs to manipulate the data. Node.js is not used to generate HTML/Views at the server-side. Instead, the Views are created dynamically at the client-side using Backbone.js and Underscore.js templates. They are injected into- and removed from the DOM as needed as you navigate through the application. Node Cellar is a “single page application”.

This is a Node.js and MongoDB powered version of an application I initially posted here with PHP and Java backends. The original post provides some additional Backbone.js context. This Node.js version also provides an improved user experience with the latest version of Twitter Bootstrap (2.1.1), and a responsive layout. It also uses Adobe Edge Web Fonts.

Source Code

The source code is available in this repository on GitHub.

162 Responses to NodeCellar: Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB

  1. Chun October 5, 2012 at 11:12 am #

    Hi Christophe,
    I’d like to keep the node server listening on port 3000, where can I update your client code to send http://localhost:3000/wines ?

  2. Christophe October 5, 2012 at 11:48 am #

    @Chun: The source code in GitHub still uses port 3000 by default. It’s in server.js.

  3. Chun October 5, 2012 at 12:32 pm #

    Yes I see that the server code still uses the port 3000 in the “app.configure” function.
    My question is about the client code : clicking on the button “Start Browsing Cellar” for example ends up with a GET http://localhost/wines which results in the error 404 as I see in the console debugger in Chrome.
    How can I modify the client code to add the 3000 ?
    Thank you.

  4. Christophe October 5, 2012 at 1:39 pm #

    @Chun: All the links should be relative. So if you initially access the app using http://localhost:3000, then clicking the “start browsing” button should take you to http://localhost:3000/#wines.

    • Chun October 8, 2012 at 6:59 am #

      Hi Christophe,
      I asked you these questions because I want to take a step further by making the client a mobile app using PhoneGap.
      The REST API will be hosted on another machine (the mongoDB and the node server) to which the client on my smartphone will send request.
      I need your advice for this. Thanks.

      • Lakshmi February 27, 2013 at 6:47 am #

        I have the same requirement. I need to have the REST API listening on lets say, Port 3000, and the client listening on say port 2000 and I need to have the client redirect the calls to the rest server. I am using Node.js, Express and MongoDB…

        • Sohel January 15, 2014 at 8:03 am #

          @Lakshmi even i am having the same requirement, by any change did u find something…

  5. Paul Bergsma October 5, 2012 at 4:15 pm #

    Connecting to with my Samsung Galaxy S and Galaxy Tab 10.1, I expected to see the effects of responsive design, the app looks good on both devices.
    I notice that on the smartphone, the text of the home page is not exactly vertically centered, I try to fix this, do you have any suggestion ? Thx

  6. Ihor October 5, 2012 at 4:19 pm #

    Nice sample! And big thank for the sourse.
    1. but, why I see a low speed of response your sample? localy nodejs show me very very high speed
    2. i can;t find any solutions about session and security. As example DEL and PUT rests can use any body w/o rights in any sample that I see before.

  7. VLR October 5, 2012 at 4:42 pm #

    Thanks for this great sample, I wish you would releaser a version of it with Sencha Touch 2 (and ExtJS now that your apps has already reached the stage of integrating the Responsive Design), do you think this makes sense ?

    • Thorsten Schaeff February 10, 2014 at 4:24 pm #

      Hi VLR, i just published a Sencha Touch Winecellar Tutorial on my website: . It might be too late for you but maybe others find this useful :)
      Best regards and thank you Christophe for all the great Tutorials!

  8. Christophe October 5, 2012 at 6:27 pm #

    @Paul: good catch on the smartphone. Thanks. The problem was that my padding in the CSS was too big. I added a few media queries to my style sheet to change the padding depending on the screen size. It should work fine now. I also pushed the changes to the GitHub repo.

  9. FredyCC October 5, 2012 at 11:13 pm #

    Thank you very much, great post and fantastic examples.

  10. Dan October 6, 2012 at 2:46 am #

    Hi @Christophe. Great tutorial and example of using Node.js to build a functional site. I managed to get everything working, but had to comment out the last res.send() line in addWine, updateWine, and deleteWine to get rid of the error: “Can’t set headers after they are sent..”

    Also moved the res.send(wine) into the else block of addWine.

    Even with these minor updates, this is one of the best examples that I have seen so far.

  11. Christophe October 6, 2012 at 12:44 pm #

    Dan: Thanks for catching that! I introduced that bug yesterday after making changes to the hosted version that has the CRUD operations disabled, and just sends back an unchanged object. Fixed it in the GitHub repo. Thanks again. Christophe

  12. John October 9, 2012 at 8:29 pm #

    Hi Christophe,

    Thanks for these tutorials. I am curious as to what sort of IDE or environment you like to use for coding your javascript apps. Put more directly, I am wondering if you would share your set up as part of one of your posts.

  13. To Tan October 10, 2012 at 6:06 am #

    Hi Christophe,
    Thanks for this sample application which covers many interesting features.
    I try to wrap the client in PhoneGap to deploy in my iPad3 but I have the problem of invoking the Rest service hosted with Node.js on my Windows 7 laptop.
    Can you give me some directions ?

  14. YannM October 10, 2012 at 9:20 am #

    Good sample application but as many people have mentioned I would like to have it run not only on the same machine as the rest server but as a phonegap application. Thanks.

  15. David Noleto(Brazil) October 10, 2012 at 2:28 pm #

    when you make an example with Sencha Touch 2 and PhoneGap ?

  16. dan October 10, 2012 at 4:43 pm #

    Small bug, the link to the git repository on the demo site doesn’t work

  17. Christophe October 12, 2012 at 8:15 pm #

    @Yann & Tan: there shouldn’t be any problem running this as a PhoneGap app. Take everything that’s in the /public folder and package it as your PhoneGap app. Make sure the URLs in models.js point to the right service and that you include the remote server in the server white list.

    • To Tan October 13, 2012 at 8:32 am #

      Thanks, your client works using MDS Phonegap plugin for Android and model.js updated as you adviced. Two remarks though : 1. with or without , the client can query the node server running on my laptop 2. the back button from an external link make me return to your app home page which is no longer centered on the vertical (for example : on the home page, I tap on Christophe Coenraets, your blog shows, then I use the Samsung back button, I return to the home page and see it not centered).

  18. Brian October 13, 2012 at 12:51 pm #

    Christophe – TY for sharing! This is exactly the stack I was looking for. Thanks for putting me a few weeks ahead of schedule.

    All – I see a few people have used PhoneGap on this example. If someone would send me over a high level on getting this in place that would same me some more time! briancarter AT

  19. sreekanth October 16, 2012 at 6:16 pm #

    Hi Christophe,
    I am new to Node.js and I need to implement Rest API using Slime Framework with backbone and actual my requirement is on every insert operation(i.e every transaction ) I need to update all users resultset who ever access the that data can you tell me how can i call my Slim Framework Rest API using node.js on every insert update delete operations

  20. wine software October 18, 2012 at 8:54 am #

    Nice post, for all the wine restaurants I recommend take a look at top cellar wine menu software as well.

  21. Stefano October 18, 2012 at 5:13 pm #

    Many thanks Chris! A question: why this route doesn’t work?
    app.get(‘/’, function(req, res){
    console.log(‘Route / ‘);

  22. Mike October 20, 2012 at 8:33 pm #

    Great tutorial. I start to use backbone.js and node.js for the development. My question is how can i embed it into a portlet which has a div to embed into. Do i need to use request.js or some lib to bootsratp it? Any idea wiill appreciate it.

  23. web ressource October 26, 2012 at 7:43 pm #

    We are a group of volunteers and opening a new scheme in our community.
    Your web site offered us with valuable information to work
    on. You’ve done an impressive job and our entire community will be grateful to you.

  24. Rob October 29, 2012 at 10:33 pm #

    Nice post, I’ve a newbie question: what if I’ve not a heroku account and want to deploy nodecellar in one of my servers (just to try it and modify it and inderstand it).

  25. Andi November 2, 2012 at 9:43 pm #


    Thank you so much for your sharing. I’ve been reading your posts from several years ago when I was a Flex developer. I don’t have any Javascript experience, I use your sample application as my learning ‘Bible’.

    I hope you can write some books, I’ll definitely buy those books =:)


  26. Help With Insomnia November 5, 2012 at 10:34 pm #

    Hello just wanted to give you a quick heads up.

    The words in your article seem to be running off the screen in Chrome.

    I’m not sure if this is a formatting issue or something to do with browser compatibility but I thought I’d post to let you know.
    The style and design look great though! Hope
    you get the problem solved soon. Many thanks

  27. Gilvam November 12, 2012 at 9:37 am #

    What I do when this error appears:
    ERROR: XHR: api/wines Object {method=”GET”, url=”api/wines”, …} Object {status=404, …}

  28. Angel Martin Perezagua November 12, 2012 at 10:05 pm #

    Thank you so much for this tutorial.
    I’ve been researching how to include Asynchronous Module Definition (AMD) in this example and finally I created a project in Githup. It uses Require.js to load all modules that the application needs. Now all views and templates are included in this manner.
    Also I’ve replaced the fetch() method for Backbone.Pagination created by Addi Osmani. Now the application only returns a number of records defined in the collection.
    I’m not an expert in any of the technologies that Christophe uses, so I would appreciate any suggestions or improvements that you give me.

    The Githup project:

    Best regards
    Angel Martin

  29. Taymoor November 14, 2012 at 6:13 am #

    CHRISTOPHE can you please add authentication and authorization in this example app, because many peoples including me, have lots of misconceptions to build an app using backbone.js and node.js that supports authentication and authorization as well.

    • Ryan November 21, 2012 at 5:36 pm #

      +1 on this. Would be great to see how that is handled for someone that is authorized to post and delete from wine database instead of random user using curl to delete via the api

      • Dan November 30, 2012 at 5:23 am #

        +1 as well. Perhaps integrating passport into this would be a good next step.

        • Jaap January 14, 2013 at 4:58 am #

          +1 on authentication example. Thanks

  30. daslicht November 16, 2012 at 2:51 pm #

    Nice one, thank you very much!

    One BIG question:
    How would you make this site indexable by web pages ?

    Is there a way to reuse the client-side templating on the server side as well?

  31. daslicht November 16, 2012 at 3:09 pm #

    Maybe use this :

  32. Dragos November 30, 2012 at 2:45 am #

    Authentication middleware for Node.

  33. Dan November 30, 2012 at 5:25 am #

    I was able to get up and running on my local with this, but I wasn’t able to get image uploading to work. Every time I added a wine, the image gets added to the database as null. Any steps that I need to take in order to get that portion working?

    • rich c May 30, 2013 at 7:37 pm #

      I am having the same issue with the images, were you able to resolve it

  34. FELIX CHERUIYOT December 1, 2012 at 9:53 am #

    Thank you for the great work you are doing. I am a big fan of your tuts and this example on nodejs came the right time when I have just learned express and mongodb. My concern though is how we organize our views and the routes. I would like to build an application that I forsee it might end up beign complex with time. Do you think with this method we can comfortable manage and handle big applications?What are your suggestions?
    Note: I have been to bbb but no solid example on managing files, though I know using bbb might be the best alternative.I have not been able to grasp the concept well.

    I hope to hear from you soon

    Thank you

  35. operafan December 7, 2012 at 4:39 pm #

    hi uploading image by drag-drop style doesn’t work at opera may you fix it

  36. gelo December 18, 2012 at 5:48 pm #


    thanks for the tutorial,
    I’am trying to get the data into the sidebar. I have a mysql database and the wine table exists and is filled with the data.
    My sidebar keeps beeing empty but function getWines() doesent give a PDOExeption.
    What could be the reason?

    Thanks for any Idea!


  37. Nick December 19, 2012 at 2:16 am #

    Seriously amazing. You even populated it with sample data for us. :) Thank you!!

  38. Chris Lee December 20, 2012 at 3:02 pm #

    If i visit, I can see all the details in mongodb.
    That’s not good.

  39. kelebek indir December 20, 2012 at 6:34 pm #

    very thanks

  40. sohbet odalari December 20, 2012 at 6:34 pm #

    good blog very nice

  41. Klara December 21, 2012 at 8:36 am #

    Excellent site you have here.. It’s difficult to find quality writing like yours nowadays. I seriously appreciate individuals like you! Take care!!

  42. Paul December 29, 2012 at 10:31 pm #


    I notice that you don’t have copyright info included in your github page. I’m working on a small project in my spare time and want to reuse some code from your nodeceller github repository. Would you be so kind as to let me know if this is something you’d be okay with? Maybe you could add a copyright file to you repo to set your expectations when somebody forks or reuses code ?

  43. Pramod January 9, 2013 at 1:10 am #

    Have you tried angularjs ? I seem to like it better than backbone.jar. Wondering if you had any opinions on it.


    • Martin June 8, 2014 at 10:03 am #

      I fully second that. By now it seems that the combo of MongoDB, Node/Express, and Angular seems to be a very well established stack. It even got the name MEAN Stack and has its own website at
      So I think it would be cool to kick out Backbone and have a tutorial, which keeps the Node/Express/Mongo part but uses Angular instead of backbone.
      Christophe, would it be possible for you to set up such a tutorial? I think it would be at the edge of technology and great for many web developers to use these technologies in combination.

      All the best


  44. Varun January 10, 2013 at 6:17 am #


    I have a webapp which we have done using Backbone and now we want this webapp to work on touch devices. So is it possibel to integrate BackBone webapp with sencha touch ??

    if yes do you have any example of how we can integrate both ??


  45. Ethan January 13, 2013 at 6:16 pm #

    Great stack!

  46. Chuck January 15, 2013 at 7:01 pm #


    I’ve followed all the steps and the app seems to have installed easily on heroku…

    Listing wines does not work – can you shed any light on the issue?

    • Chuck January 16, 2013 at 3:02 am #

      New link same problem – seems like anything database related is not going through…

      • Chuck January 16, 2013 at 5:10 am #

        In Hopes this might help someone like me:

        The issue was that i wasn’t connecting to the database properly (or at all) with the default code base from the Git repo. I needed to customize slightly the database connection methods to make compatible with Heroku add on MongoLab.

        Here is a quick link:

        Enjoy and good luck !

        • Rich Costello May 21, 2013 at 7:30 pm #

          Thanks for posting that fix for the DB connection you just saved me hours.

        • fangstar January 11, 2014 at 10:39 am #

          thanks for the fix!

        • Andrea January 24, 2014 at 4:22 am #

          Thanks, very helpful!

        • e w February 4, 2014 at 1:48 am #

          Thanks so much Chuck. I spent a lot of time trying to figure out the MongoLab connection and just couldn’t get it. You rock!

  47. Chumster January 20, 2013 at 8:34 am #

    Hey Christophe, another great tutorial. I keep ending up on your blog :-) Just wondering if you’ve given any thought as to which js framework (clearly from the ones you’ve been using/evangelizing) might be a good candidate for building a Chrome extension. I believe Backbone.js should work, assuming the Models live on the Background.html and communicate to the Views/Templates on the Pop-ups and Content Scripts while keeping each other in sync through the Chrome API’s. But I’ve never tried it out. You seem to have a knack for in-depth tutorials. This would be a cool one to tackle … especially if you could work from one of your existing tutorials, like in the past. Cheers!

  48. Dan Stroot January 25, 2013 at 4:18 am #

    Love your work!!! This stuff is so cool. I just dropped a pull request to make the api a little more robust. May help some people who are new to this. Cheers!

  49. Karim January 26, 2013 at 2:32 am #

    I followed the first tutorial and this one, when I click in the link :

    Browse Wine nothing happened.

    When I try to add a new wine ,In the node server console I have :

    GET /pics/generic.jpg 304 3ms
    GET /favicon.ico 404 2ms
    Adding wine: {“_id”:null,”name”:”newWine”,”grapes”:”newGrapes”,”country”:”USA”,”
    region”:”California”,”year”:””,”description”:”some notes.”,”picture”:null}
    GET /favicon.ico 404 2ms
    GET /favicon.ico 404 3ms

    Thanks,your help is appreciated.

  50. Karim January 26, 2013 at 2:50 am #

    I have never seen the output of the console coming from wines.js ”

    “Connected to ‘winedb’ database”


    “The ‘wines’ collection doesn’t exist. Creating it with sample data…”


  51. Augustus January 26, 2013 at 7:53 am #

    Spot on with this write-up, I really think this
    website needs a great deal more attention. I’ll probably be returning to read more, thanks for the information!

  52. Paras Goel February 3, 2013 at 4:08 am #

    I am new with all above technology but i keen to understand them so for this i need a clear picture that how can i build the above application step by step with backbone.js node.js and other mentioned above ..and the software required to run the application.

    I will appreciate your help and It will great help for me.

    Just I want in simple way step by step so a person who is know only java script ; can understand the application and run on his machine.

    Thanks Paras

  53. public speaking tutor February 27, 2013 at 12:16 am #

    Seriously content I came across this webpage currently has
    made me happy quite honestly

  54. Bob Miner March 14, 2013 at 6:18 pm #

    Great post! Thanks for sharing! I noticed when running the web app that the URL kept changing, as if you were fetching new pages. Did you consider making this a single-page web app? Or perhaps a better question is how did you decide when to go to a new page instead of retrieving more data using a REST API and modifying the data and/or visibility of DOM elements shown in the current page? I apologize if this is bad question, as I’m new to node.js. Thanks.

  55. Max April 16, 2013 at 7:56 am #


    I’m just learning Node and NoSQL DBs and I just can’t figure out one moment. I’m trying to repeat almost the same app that you did, but I want to show items grouped by categories. In your example it could be a country, i.e.
    – wines from France
    – wines from Algeria
    – wines from Spain

    If I decide to store Wine objects as subobjects of Country, I could easily query this way. But to get single Wine details, I will need to query the whole Country.

    If I decide to store Country as a field of Wine object, how can I group Wines by Country? What is the best way to do this?

    Thanks in advance,

  56. Zach May 19, 2013 at 12:13 pm #

    Running into this error when executing ($ node serverwithanalytics.js)

    info – started
    Express server listening on port 3000
    GET / 200 11ms – 2.74kb
    GET / 200 11ms – 2.74kb
    GET /css/bootstrap.css 304 3ms
    GET /css/bootstrap.css 304 3ms

    throw new Error(‘Can\’t set headers after they are sent.’);
    Error: Can’t set headers after they are sent.
    at ServerResponse.OutgoingMessage.setHeader (http.js:704:11)
    at ServerResponse.res.setHeader (/home/zach/nodecellar/node_modules/express/node_modules/connect/lib/patch.js:59:22)
    at SendStream.type (/home/zach/nodecellar/node_modules/express/node_modules/send/lib/send.js:455:7)
    at SendStream.send (/home/zach/nodecellar/node_modules/express/node_modules/send/lib/send.js:347:8)
    at /home/zach/nodecellar/node_modules/express/node_modules/send/lib/send.js:322:10
    at Object.oncomplete (fs.js:107:15)

    I did not install node modules global, but local. Please advise.

    Thank you.

    • Zach May 19, 2013 at 3:47 pm #

      I updated to 0.9.14 by changing package.json.. serverwithanalytics.js does not completely die, but will not display entire page.

      • Zach May 19, 2013 at 3:50 pm #

        Cleared Chrome History. Loading..

      • christopher May 23, 2015 at 11:16 am #

        thanks for that zach, perfect.

  57. Rich Costello May 24, 2013 at 5:14 pm #

    Images not saving when i add a new wine. I was able to get the drop and drag image to work but when I click to save the default image still displays. How do I save a new image to the database.

    • ace July 24, 2013 at 6:07 am #

      I face the save issue after drag and drop, unable to save the image.

      The html of the image is as follows:

      How can I convert it to png/jpeg format before saving?

  58. ykel May 25, 2013 at 9:48 pm #

    Please how do I run the sample app on my local machine, I have downloaded the sorce from github, I can fetch wines by this http://localhost:3000/wines/
    how do I run the client application?

  59. Garcinia Cambogia HCA May 30, 2013 at 4:21 pm #

    Thanks for another informative website. The place else could I get that type of info written
    in such a perfect means? I’ve a venture that I am just now operating on, and I have been on the look out for such information.

  60. Hans June 7, 2013 at 2:15 pm #

    arośniętej jakości. – Widziałeś? – spytał balcony [Hans]
    rozochocony rycerz, słysząc Arnolda w środku tuleja.
    – Kogo? – Lecz owo
    Cztan spośród Rogowa! Obaj rycerze spoglądali z podziwem na mocarza, kto, w charakterze leg.

  61. Guy Korland June 12, 2013 at 5:07 pm #

    I’m trying to extend your example by adding JQuery-Sortable to let the user reorder bottles, did you try doing that?

  62. Alex July 3, 2013 at 10:55 pm #

    Thanks so much for this sample app. It really does a great job of bridging the gap between Hello World and more complex apps, while also introducing a great full stack for nodejs. I’ve been learning incredibly fast from extending the functionality and building off of this project, great work!

  63. Misha July 9, 2013 at 4:33 pm #

    Hey Christophe,

    thanks a lot for your time and investigations!
    I was reading and searching a lot lately …about websockets and push notifications…

    If there is a client/server communication, there definitely should be a better way then “ringing” every second from the client to the server using the setInterval or setTimeout functions, and asking “are there some news for me?”

    But as far as I understood, has a fallback to setInterval on Android….
    So if I develop an App for iOS and Android – shouldn’t I then directly use setInteval on both?

    Thanks a lot,
    Regards- Misha

  64. Grant July 22, 2013 at 8:20 am #

    It is an awesome internet site, thank you in this.
    I have for you to google and yahoo regarding a number of hrs to
    uncover this kind of site.
    I actually loathe when each time I really search engines to get written content that
    will look at I personally typically get inadequate article content and also a great
    deal junk e-mail.
    You actually plainly obtain treatment method connected with each of the spam plus keep your blog nice and clean and
    top quality. Do you possess methods for my own, personal web site?

  65. Clash of Clans Cheats July 28, 2013 at 1:04 pm #

    My spouse and I stumbled over here different website and thought I might as well check things out.
    I like what I see so i am just following you.
    Look forward to looking over your web page

  66. Chetwyn September 13, 2013 at 7:53 pm #

    Hi, I’m really tring to exoand the app, spent hours on it but just can’t figure it out, coudl someone please help me?

    All i want to do is expand the list all wines to a search. I’ve got the RESTFUL service done as you can see here whcih is working great:

    exports.searchByFilter = function(req, res) {
    var filter = “.*” + + “*”;
    // var filter = “.*Merlot*”;
    console.log(‘wines lookup’);
    db.collection(‘wines’, function(err, collection) {
    collection.find({‘grapes':{ “$regex”: filter, “$options”: ‘i’ }}).toArray(function(err, items) {
    console.log(‘Success: ‘ + JSON.stringify(items[0]));

    But I just can’t seem to figure out how to pass the results to the view via the model.

    I’ve defined a route here like: app.get(‘/wines/search/:id’, wine.searchByFilter);

    so the REST service is all working. I’m tryng to put a search box on the header so you can either list all the wines or just a search using that service.

    could some ppplleeaasseee help me… it’s killing me…

  67. Vaibhav September 28, 2013 at 5:31 am #

    Thank you so so much!!!!

  68. October 18, 2013 at 5:44 pm #

    Hi there, the whole thing is going perfectly here and ofcourse every one is sharing data, that’s genuinely fine, keep up writing.

  69. Tejaswi November 12, 2013 at 7:53 pm #

    Hello! Christophe,

    I have modified your web site and I am planning to include a reference to it in my upcoming book on Windows Azure Web Sites. The modified web site is here

    The book will provide reference to your article. I hope you are fine with it. I will also upload the new site to Github for public consumption.


  70. Quanta November 29, 2013 at 1:27 pm #

    Great example! can you tell me how i can include a datepicker within this app? I can’t seem to add a calendar drop down to it…


  71. Subbu March 11, 2014 at 8:32 am #

    Hi can you please explain this as you have done in your previous post

  72. hiun kim March 24, 2014 at 4:39 am #

    thank you.

  73. julio March 30, 2014 at 8:38 am #

    Hello everybody
    i try to lunch: “node serverwithanalytics.js ”
    on the begging i dont have erro, but after 20 second, i got thie error:

    GET / 304 2ms
    GET / 304 2ms

    throw new Error(‘Can\’t set headers after they are sent.’);
    Error: Can’t set headers after they are sent.
    at ServerResponse.OutgoingMessage.setHeader (http.js:691:11)

    Can somebody helpme?


    • julio March 30, 2014 at 8:41 am #

      pd: after lunch “serverwithanalytics.js” , and trying to lunch the app … the index page doesn’t show anything.

  74. TC April 23, 2014 at 2:07 pm #

    I downloaded the source files form GitHub, and have it running locally on my dev system. I’m new to backbone, bootstrap, etc., so this is probably going to sound like a dumb question, but for the life of me I can’t figure it out:

    In WineView.html, I want to turn the Year dropdown into a loop that goes from the current year down to the current year minus 25 years. I can do that on a normal html page using javascript, but when I try to replace the existing option statements with my code, the page hangs. Seems I can’t but *any* tags on the page (even just to output “hello world”), the rest of the page fails to load.

    So, what’s the secret?


    • TC April 23, 2014 at 5:51 pm #

      Ok, I figured it out. I changed the select statement to this (although I altered my parameters to 30 years prior to this year):

      <select class="input-small" id="year" name="year" value="”>
      = curryear-30; index–){ %>

      • TC April 23, 2014 at 5:57 pm #

        Messed up my formatting. Let’s try that again:

        <select class="input-small" id="year" name="year" value="”>
        = curryear-30; index–){ %>

      • TC April 23, 2014 at 5:58 pm #

        Try again (not sure how to format code on this comment system):

        <select class="input-small" id="year" name="year" value="”>
        = curryear-30; index–){ %>


      • TC April 23, 2014 at 5:58 pm #

        I give up…

  75. michael April 26, 2014 at 1:45 am #

    Where is the GitHub repo ??? Followed all repo links, tried, and searched all over GitHub … but there is nothing. Where is it?

    • michael April 26, 2014 at 1:47 am #

      err … never mind : found it. that was weird.

  76. wedding cake topper April 27, 2014 at 7:28 pm #

    Greetings! Very helpful advice within this article!

    It’s the little changes that make the largest changes. Many thanks for sharing!

  77. red wine April 29, 2014 at 2:40 am #

    I got this web site from my friend who told me regarding this web page and at the moment this time I am browsing this website and
    reading very informative content here.

  78. worldventure May 4, 2014 at 5:49 am #

    Also they try not to hurt the researcher and thus avoid
    negative answers. To keep you more focused, here is an objective and honest Worldventures review.
    So these guys are not getting any benefit
    from their web site and are losing out.

  79. You need to pass out flyers, buy samples to hand out, purchase bags
    and anything else needed for your customers. Consider your past knowledge,
    help available from your kids and spouse, initial investment and approximate monthly income to choose any home based business idea.
    Be sure to hang on for all receipts linked to the expense of working the organization.

  80. Aniket May 20, 2014 at 10:15 pm #

    I have the same question as Paul … I would like to reuse code from this project. Are there any copyright terms and conditions?

    Thanks for this sample project!

  81. Aniket May 21, 2014 at 3:05 am #

    Can you provide the version of node required for this project?

    I tried to do a node server.js, and got following error:
    connect: multipart: use parser (multiparty, busboy, formidable) directly
    connect: limit: Restrict request size at location of read

    throw er; // Unhandled ‘error’ event
    Error: listen EADDRINUSE
    at errnoException (net.js:904:11)
    at Server._listen2 (net.js:1042:14)
    at listen (net.js:1064:10)
    at Server.listen (net.js:1138:5)
    at Object. (/Users/aniket/projects/nodecellar/server.js:21:24)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)

  82. Felipe May 22, 2014 at 6:06 am #

    Advanced questions bout swarovski jewellery ebay uk resolved and consequently why
    you would need to review each and every statement within tthis
    e book.

  83. garcinia cambogia green tea May 25, 2014 at 12:56 am #

    Hello everyone, it’s my first pay a visit at this web page,
    and article is actually fruitful in favor oof me, keep
    up posting these types of content.

  84. streaming May 30, 2014 at 6:17 pm #

    I have read so many articles on the topic of the blogger lovers except this
    post is genuinely a nice article, keep it up.

  85. June 11, 2014 at 9:51 am #

    Hi there, I discovered your website by the use of
    Google while looking for a comparable topic, your site got here up, it seems good.
    I have bookmarked it in my google bookmarks.
    Hello there, just changed into alert to your weblog through Google, and located that
    it’s truly informative. I am going to watch out for brussels.
    I will appreciate should you continue this in future.
    A lot of other people will likely be benefited out of your writing.


  86. Plumbing Installation June 19, 2014 at 4:27 am #

    When you are thinking of home design and fittings there’s
    a popular saying “home is where the heart is”. One thing that is a must for any
    plumbing service is the education of the public about sewer lines.
    The modern plumbing professional employs such advanced technology as a
    video sewer inspection system.

  87. castle clash hack download apk June 20, 2014 at 11:36 pm #

    I always spent my half an hour to read this webpage’s articles or
    reviews daily along with a cup of coffee.

  88. brave frontier hack apk 1.1.5 June 21, 2014 at 3:55 pm #

    I’m impressed, I must say. Rarely do I come across a blog that’s both educative
    and engaging, and without a doubt, you’ve hit the nail on the head.
    The problem is something that too few people are
    speaking intelligently about. I am very happy that I stumbled across this in my search for something concerning this.

  89. dragon city hack tool v1.02 no survey June 28, 2014 at 7:52 pm #

    Good day! This is kind of off topic but I need some adcvice from an established blog.
    Is it tough to set up your own blog? I’m not very techincal but I can figure
    things out pretty fast. I’m thinking about makig my
    own but I’m not sure where to begin. Do you have any tips or suggestions?
    Wiith thanks

  90. crous July 1, 2014 at 6:45 am #

    de choisir. Through this, the entrepreneur will know if
    there’s a conflict with another name online. mieux comprendre
    dans d’autres sujets de la meilleure mani.

  91. kratka na brzuchu July 1, 2014 at 1:16 pm #

    Excellent blog! Do you have any helpful hints for aspiring writers?
    I’m planning to start my own site soon but I’m a little lost on everything.

    Would you advise starting with a free platform like WordPress or go for a paid option? There are so many options out
    there that I’m totally confused .. Any tips? Appreciate it!

  92. plaski brzuch July 2, 2014 at 2:35 pm #

    Good respond in return of this question with firm arguments and telling all about that.

  93. platki owsiane July 3, 2014 at 12:02 am #

    I like it when folks get together and share ideas. Great
    site, continue the good work!

  94. funny pranks 2014 July 3, 2014 at 3:53 pm #

    We stumbled over here different page and thought I might check things out.
    I like what I see so i am just following you. Look forward to
    looking into your web page for a second time., funny videos epic fails pranks cats compilation 2014

  95. It’s the best time to make some plans for the future and it is time
    to be happy. I have read this post and if I could I wish to
    suggest you few interesting things or advice. Perhaps you could write next
    articles referring to this article. I desire to read even more things about

  96. funny pranks 2014 July 3, 2014 at 8:40 pm #

    Please let me know if you’re looking for a writer for your weblog.
    You have some really great articles and I think I would be a good asset.

    If you ever want to take some of the load off, I’d absolutely love to write some content
    for your blog in exchange for a link back to mine. Please blast me an email if interested.
    Kudos!, funny videos epic fails pranks cats compilation 2014

  97. top sports July 4, 2014 at 4:33 pm #

    Excellent post. I was checking constantly this blog and I’m inspired!

    Extremely useful information particularly the remaining
    part :) I take care of such information much.
    I was looking for this particular info for a long time.
    Thank you and best of luck.

  98. Crystle July 5, 2014 at 12:56 am #

    This post will assist the internet people for creating new webpage
    or even a weblog from start to end.

  99. cheap celine bags for sale July 6, 2014 at 1:03 am #

    cheap celine bags for sale
    Someone essentially assist to make severely articles I might state.
    That is the very first time I frequented your website page and thus far?

    I surprised with the research you made to make this particular
    post extraordinary. Fantastic task!

  100. Hi it’s me, I am also visiting this web page daily, this web site is really fastidious and the users are genuinely sharing nice thoughts.

  101. dieta intermittent fasting July 7, 2014 at 7:26 am #

    We’re a group of volunteers and opening a new scheme in our community.
    Your web site offered us with valuable info to work
    on. You’ve done a formidable job and our entire community will
    be grateful to you.

  102. hungry shark evolution hack tool July 7, 2014 at 11:19 pm #

    We stumbled over here different page and thought I should check things out.

    I like what I see so now i am following you.
    Look forward to looking over your web page yet

  103. cwiczenia na plaski brzuch July 8, 2014 at 11:22 am #

    Hey! This is kind of off topic but I need some guidance from an established blog.
    Is it tough to set up your own blog? I’m not
    very techincal but I can figure things out pretty quick.
    I’m thinking about setting up my own but I’m not sure where to start.
    Do you have any tips or suggestions? Cheers

  104. silowanie na reke July 9, 2014 at 12:39 am #

    Wonderful work! That is the kind of info that should be shared across the web.
    Disgrace on Google for now not positioning this put up higher!
    Come on over and discuss with my website . Thank you =)

  105. trening nog July 9, 2014 at 6:46 pm #

    I delight in, cause I found just what I used to be having a look
    for. You have ended my four day long hunt! God Bless you man. Have a great
    day. Bye

  106. suple July 9, 2014 at 7:58 pm #

    I think this is among the most important information for me.
    And i am glad reading your article. But wanna remark on some general things, The website style is great,
    the articles is really excellent : D. Good job, cheers

  107. sporty silowe July 10, 2014 at 7:43 am #

    Asking questions are genuinely good thing if you are not understanding anything entirely,
    but this paragraph provides pleasant understanding yet.

  108. facebook July 10, 2014 at 9:08 am #

    Don’t worry, I’m not going to jump on the bandwagon and whine about how frustrating it is, or rant about
    why I think things should be different. Events can be a great supplement to your other promotional activities.

    Yet so many people are either unaware of them or do not fully understand the ramifications of the content
    they might share online.

  109. battlefield 3 klucz aktywacyjny July 11, 2014 at 5:36 am #

    Fastidious answer back in return of this difficulty with
    genuine arguments and telling the whole thing on the topic of that.

  110. July 16, 2014 at 8:25 pm #

    Thanks for your marvelous posting! I seriously enjoyed reading it, you could
    be a great author.I will ensure that I bookmark your blog and will often come back in the foreseeable future.
    I want to encourage you to continue your great work, have a nice

  111. murai batu lampung July 17, 2014 at 5:43 pm #

    Hmm it seems like your blog ate my first comment (it was extremely
    long) so I guess I’ll just sum it up what I had
    written and say, I’m thoroughly enjoying your blog.
    I as well am an aspiring blog writer but I’m still
    new to everything. Do you have any tips and hints for rookie blog writers?
    I’d certainly appreciate it.,

  112. murai batu medan July 17, 2014 at 5:48 pm #

    I every time emailed this website post page to all my
    friends, because if like to read it afterward my contacts will too.,

  113. Hey there! I just wanted to ask if you ever have any issues with hackers?
    My last blog (wordpress) was hacked and I ended up losing months of hard work due to no backup.
    Do you have any methods to stop hackers?,

  114. Bret August 12, 2014 at 10:20 am #

    How does the backbone app start? Could you give a simple workflow of once node server.js gets the request how its routed and what functionality calls each piece?

    Very helpful tutorial, i followed the previous one with mongodb and node js and it was great!

  115. Guillermo September 3, 2014 at 2:36 pm #

    Can this article be updated with steps so instead of cloning its repository and getting it working, we can get a more deeper knowledge on how to integrate Backbone and Bootstrap?


  116. Samuelver December 6, 2014 at 9:05 am #

    6.0%となった。ロイターがまとめた市場 う要望に応え、「ビューンおトク読み」を追同空港で記者会見。同行したみんなの党の山育所にかかる費用を無償化した場合、年約2 [url=]ショウエイ ヘルメット 部品[/url] 国支援を目的とする「BRICS開発銀行」 南カリフォルニアの文化を演出するカフェと[url=]メンズ ブーツ[/url] 動の一環として運営しているので、入場料は 、体のラインが出る服をよく着ている人がウ[url=]クロエ バッグ 高島屋[/url] は憲法改正が必要と考える」と述べ、世界各 だ。成功の背景には「実店舗とネット通販の[url=]ダウンのブランド[/url]  維新も生活との合流には懐疑的だ。小沢氏 【AFP=時事】 グラス1、2杯の酒はむ[url=]デュベティカ ダウンベスト ウール[/url] 重的であるのは、そうした困難を反映してい

  117. 1140126 December 10, 2014 at 1:38 pm #

    I installed the homepage. It is running correctly on localhost:3000. The only thing is when in click the browse button I have no wine to select. Also to add a wine is not possible. I can fill out the form but nothing will be saved.
    Could you please tell me how can I run the program without these faults?

  118. vivek March 11, 2015 at 12:25 am #

    Thank you very much . i learned lot from this article

    • B.E. April 8, 2015 at 1:34 pm #

      Did you manage to get it all working with the latest mongodb driver?

  119. B.E. April 8, 2015 at 1:36 pm #

    I got everything to work except when trying to view an existing wine product. i keep getting this error:

    TypeError: Cannot read property ‘findOne’ of undefined
    at E:\nodecellar\routes\wines.js:28:19

    Any suggestion is appreciated.

  120. George Phan August 6, 2015 at 7:58 pm #

    This is one of the best tutorial on the internet I’ve seen. I am able to use it for my project immediately.

  121. forma imalatı November 19, 2015 at 3:33 am #

    Fabrics we use in our form; The first-class micro-interlock; flex-fit, anti-bacterial, it has a thermo-balance, and immediately drying. This gives you the freedom to move your soccer jerseys of the match; It is designed stylish enough to be worn on a daily basis. Our models are produced in two types as my special jerseys and other digital printed.
      His highest production of our company, we use the sport socks products: cotton, cotton, polyester, nylon and lycra. It includes anti-bacterial.

  122. Specto training March 26, 2016 at 2:26 am #

    Vey very nice blog!!
    Hi there,I enjoy reading through your article post, I wanted to write a little comment to support you and wish you a good continuationAll the best for all your blogging efforts

  123. Specto training March 26, 2016 at 2:48 am #

    Keep working ,great job!
    Awesome post

    ERP Online Training

  124. Dan in space May 4, 2016 at 10:34 pm #

    Excellent sample app! It really helped me get started on a SPA project with Backbone.

    I converted the MongoDB portion to MySQL and posted the code difference here:


  1. Creating a REST API using Node.js, Express, and MongoDB - October 12, 2012

    […] In my next post, I’ll share a client application that makes use of that API. Update: The “next post” is now available here. […]

  2. Real Time Web Analytics with Node.js and Socket.IO | Christophe Coenraets - November 16, 2012

    […] Rejecting cross-domain connections means that the application pages now also have to be served by the Node.js server. To put our new authorization policy into practice, let’s add the real-time web analytics capability to the Node Cellar application that I shared in my previous post. […]

  3. Ежедневник kvarkson'a | 19 Ноября / Почти во сне - November 19, 2012

    […] простоты – пример приложения на Backbone.js, Bootstrap, Node.js, Express и MongoDB. Да ещё и про вино. […]

  4. Backbone.js | Josh Coe - December 24, 2012

    […] tool for designers & developers. In terms of self-education check out the proof-of-concept NodeCellar from Christophe Coenraets that uses Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB. […]

  5. NodeCellar: Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB | - July 16, 2013

    […] Check it out […]

  6. MongoDB: Links, News, And Resources (3) | Angel "Java" Lopez on Blog - February 6, 2014

    […] NodeCellar: Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB; […]

  7. Node.Js: Links, News And Resources (21) | Angel "Java" Lopez on Blog - July 11, 2014

    […] NodeCellar: Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB; […]

  8. Blueprint Authoring Guide | Topmist - January 7, 2015

    […] Nodecellar – This is the application business logic packed as a Node.JS application. […]

  9. Learn MEAN Stack – A List of Resources | JavaScript App Development | Angular, Node.js, MongoDB, Ionic - April 8, 2015

    […] a ToDo App. Link to blog post Setting up MEAN Stack from  –  build a ToDo App NodeCellar – this is from 2012. However the app is still online and working and you can find the Github […]

  10. Design a website with nodejs, backbonejs, expressjs, and bootstrap | Ho's Blog - April 17, 2015

    […] Example:; […]

Leave a Reply