This app implements Backbone.js's TODO example app with MongoDB and either Sinatra or Node.js as a backend.
- HTML5 Boilerplate - http://html5boilerplate.com/
- Backbone.js - http://documentcloud.github.com/backbone/
- Sinatra - http://www.sinatrarb.com/
- HAML - http://haml-lang.com/
- Node.js - http://nodejs.org/
- Express - http://expressjs.com/
- Mongoose - https://github.com/LearnBoost/mongoose
- Jade - http://jade-lang.com/
- MongoDB - http://www.mongodb.org/
Obviously, you don't need both the Node.js and Sinatra backends. You can pick one and delete the other.
Make sure that you have installed (and are running) MongoDB.
By default, the app connects to MongoDB running on localhost with its default port.
Make sure that you have bundler and Ruby installed.
git clone git://github.com/criccomini/weapon-of-choice.git cd weapon-of-choice bundle install ruby app.rb
Make sure that you have Node.js installed.
git clone git://github.com/criccomini/weapon-of-choice.git cd weapon-of-choice ./install.sh node app.js
HAML/Jade files should be created in the views folder.
All of the current layout.haml/layout.jade is straight out of HTML5 Boilerplate.
All of the CSS is from HTML5 Boilerplate, except for the TODO css, which is marked with:
/* * Delete below. This is the Todo app's css. */ ... /* * Delete above. This is the Todo app's css. */
I've dumped the Backbone.js and Underscore.js libs inside the public/js/mylibs folder. This is, again, just HTML5 Boilerplate layout.
There is still a little CSS weirdness. The (x) button in the "real" Backbone.js TODO demo doesn't appear. I'm pretty sure this has to do with a fight between HTML5 Boilerplate, and the copy/pased CSS for the Backbone.js TODO app.
It would be pretty cool if the Backbone.js and Mongoose models were actually the same class. I need to figure out how to do this.