Single Page App Boilerplate is a toolkit for easily and quickly creating single page javascript applications using best practices such as test driven development, javascript dependency management, automated builds, and (coming soon) continuous deployment.
Single Page App Boilerplate allows you to easily and quickly create single page javascript applications using best practices such as test driven development, javascript dependency management, automated builds, and (coming soon) continuous deployment.
Goals
java -jar ../bin/JsTestDriver.jar --port 9876 & to launch a js-test-driver server at http://localhost:9876
open all the browsers you want to test your code in, navigate to http://localhost:9876 in each and click 'Capture Browser'
mvn test to run your jasmine unit and integration tests across all browsers you captured
import the project into your favorite IDE by importing the maven pom.xml file
add your jasmine specs to src/test/specs. Wrap your jasmine specs in requirejs define calls. See HelloWorldViewTest.js for an example.
add your app code to src/main/webapp/js.{ }Router.js is your application entry point. If you want to use more than one router you can create more instances of Router in main.js.
add your google analytics account number to src/main/webapp/js/Constants.js
mvn install -P optimize to minify and concatenate css. Your deployable site will be output to target/minified-output. To use the optimized version, load index.html. To use the debug version, load index_unminified.html.
Future Project Goals
Run your integration tests during continuous integration only for faster development
jshint integration
deployment to the cloudfront cdn using an s3 or elastic beanstalk origin while setting gzip and caching http headers
no modifications made javascript libraries by using requirejs shims. currently libraries are wrapped with an AMD module
One command to update your javascript libraries to their latest versions
Integrate with yeoman for scaffolding for major js libraries other than Backbone
One command to rollback your application to a different version