Skip to content

tanem/express-backbone-boilerplate

Repository files navigation

Express Backbone Boilerplate

build status

A small sample app built using Express and Backbone plus a few friends. I've used it as the basis for a few bigger projects, so hope it can help others in this regard too.

Dependencies

Ensure the following are installed:

Install the global dependencies:

$ npm install -g grunt-cli karma istanbul node-inspector bower

Change to your project directory then install the local dependencies:

$ npm install; bower install

Client

To start using default options:

$ grunt start

Can be accessed via http://127.0.0.1:3000/. Node Inspector will also be available via http://0.0.0.0:8080/debug?port=5858.

Once started, the app will also:

  • Watch the server source files, and restart the Node server if any changes are made
  • Watch the SASS files, and recompile the dev CSS if any changes are made
  • Watch the relevant JS files, and run the relevant JSHint tasks if any changes are made

Unit tests

Client

  • Jasmine is used for testing the JS
  • The Jasmine SpecRunner.html is automatically generated via grunt
  • Karma is used to run the tests against various browsers, as well as providing code coverage via Istanbul

Tests can be run in the browser via http://127.0.0.1:3000/test.

To run tests only:

$ grunt client:test

To run tests with coverage:

$ grunt client:cover

Coverage information is output to ./coverage/client.

Server

  • Mocha and expect.js are used for testing the Node server JS
  • Istanbul is used to run the tests and provide code coverage

To run tests only:

$ grunt server:test

To run tests with coverage:

$ grunt server:coverage

Coverage information is output to ./coverage/server.

Docs

  • Docker is used to generate the documentation.

To generate:

$ grunt docs

Can be accessed via http://localhost:3000/docs.

Distribution

  • Uses the RequireJS optimiser to compress the JS
  • Rewrites the index.html file to only include the one script

To generate:

$ grunt dist

Thanks

About

🚧 Sample app built using Express and Backbone plus a few friends.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published