Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Building Single Page Applications with Backbone.js and Express.js

DZone's Guide to

Building Single Page Applications with Backbone.js and Express.js

· Web Dev Zone
Free Resource

Start coding today to experience the powerful engine that drives data application’s development, brought to you in partnership with Qlik.

This Saturday I was doing my first Backbone.js class. It went really fine, except one fact.

I wanted to show the aspects of creating Single Pages Application running on Backbone. Started the application from scratch, we had to spend a lot of time writing some infrastructure code before we even jump to Backbone. So, after the class I decided to create some boilerplate project, so next time we would just clone it from github and start to work.

That's how the backbone-express-spa born.

Backbone.js + Express.js SPA boilerplate

The project is a Express.js application using Backbone.js as front-end framework. The idea is you just simply clone it, remove non needed routes and application and build something on your own.

I won't put to much details in a blog post, since repo neat readme section. Just several facts:

  • Minimal and simple - pure Backbone code, no plugins. For some real needs plugins are required anyway and you are free to include whatever you want.
  • AMD modules with RequireJS - modularity is key factor for large-scale apps, RequireJS
  • Concept of Application - to group all view, models, collection related to one application unit in one place.
  • Handlebars template - using Handlebars as template engine.

Further work

It's not yet completely done. I want to create more meaningful app, show some layouts principles + prepare readme section of building application for production.

I'm also thinking of putting some examples of unit tests both for Express.js and Backbone.js.

Conclusions

Check the backbone-express-spa out. If you like it, please give some stars or shout in twitter. I would be really happy to see some pull requests for improving applications or infrastructure. So, if you want to join - you are welcome!


Create data driven applications in Qlik’s free and easy to use coding environment, brought to you in partnership with Qlik.

Topics:

Published at DZone with permission of Alexander Beletsky, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}