A standalone sample application using Backbone and Marionette that connects to the GitHub API to download a list of repositories for a specified user; and displays them in a list.
Run the included index.html locally or run the hosted distributable example. You can run npm start
once you have built the project to start a small webserver and open the demo in your browser automatically.
You will need to install node if you haven't got it already.
Open the project directory and run this command to download the latest development dependencies. You only need to do this if you want to build the project. This will install Grunt and Bower locally to the project.
npm install
Written against v3 of the GitHub API.
Grunt allows the source to be minified for production use.
Bower manages the rest of the front end packages, such as Backbone and Marionette themselves. If the bower_components
directory in the projects root is deleted, you can install all these components again by running npm run bower
from the command line. You can also keep this project up to date by running npm run bower:update
.
Both Grunt and Bower can installed automatically by running the npm install
command as above.
You can run the full unminified version by just opening the root index.html. There is also a /dist/ directory that contains the full compiled version (minified css/js etc), this directory contains all the files needed to run the application.
To regenerate this directory run npm run build
.
The debug template also always uses pre-compiled view templates from the auto-generated js/templates.js. The content of this file consists of all the un-compiled html views that are found in the /views/ folder.
You can manually force a template compilation by running npm run build:jst
. Alternatively, if you simply run npm run watch
when you start working on the application, the templates.js file will be regenerated automatically as soon as any changes to the view folder are made.
Unit and Integration tests can be performed separately. By default, only unit tests are performed.
Run npm test
to execute unit tests using Jasmine inside a PhantomJS instance.
Run npm run integration
to perform a slower integration test only; which will actually connect to the live APIs used by this application.
You can also load the test runners themselves in your browser for the unit test runner (hosted example) and integration test runner (hosted example). These two spec runner files are generated automatically by running the npm run build
command.
The default test runner is Karma which will perform unit testing instrumented with code coverage by Istanbul, this in turn generates a complete code coverage report. This is in addition to the automated code coverage data published by Coveralls from the continuous integration builds run by Travis.
Created as a sample application by Sam Kelleher.