lucassus / angular-coffee-seed

AngularJS seed based on grunt JavaScript tasks runner and bower a package manager for the web
http://lucassus-angular-seed.herokuapp.com/
MIT License
32 stars 9 forks source link

Custom AngularJS seed project

Build status Dependency Status Stories in Ready

This is a custom AngularJS seed project based on grunt the JavaScript task runner.

Demo: http://lucassus-angular-seed.herokuapp.com

Directory structure

Third-party libraries

Generated stuff

Bootstrap

Install nodejs v0.10.12 from the sources:

sudo apt-get install build-essential openssl libssl-dev pkg-config

wget http://nodejs.org/dist/v0.10.12/node-v0.10.12.tar.gz
tar -xzf node-v0.10.12.tar.gz

cd node-v0.10.7
./configure
make
sudo make install

Install grunt, nodemon and bower globally

sudo npm install -g grunt-cli
sudo npm install -g nodemon
sudo npm install -g bower

Run the app

npm install
bower install
script/start-server

Navigate to http://localhost:9000

Running tests

By default all tests are executed in PhantomJS browser

Run test against specific browsers

grunt test:unit --browsers=Chrome,Firefox,Opera,PhantomJS

Running integration tests

How to develop specs

WebDriver and PhantomJS

Running tests for the server side application

mocha --compilers coffee:coffee-script --watch --reporter spec server/test

How to debug failing specs

Put debugger in the failing spec:

describe "Failing spec", ->

  it "should run smoothly", ->
    debugger # this is like setting a breakpoint
    failMiserably()

Run karma in Chrome browser:

grunt test:unit:watch --browsers=Chrome

Run karma directly without CoffeeScript compilation:

karma start test/karma-conf.coffee --single-run

or with auto watch option:

karma start test/karma-conf.coffee

or

karma test:unit:watch

Running tests headlessly

Start Xvfb and export DISPLAY variable:

./script/xvfb start
export DISPLAY=:99

Perform single run:

grunt test --browsers=Firefox,Chrome,Opera,PhantomJS

or

grunt test:watch --browsers=Chrome

Build process

script/build will build the minified production release.

(cd dist/ ; python -m SimpleHTTPServer 8000) will serve a static assets from ./dist directory.

Navigate to http://localhost:8000 to see the production release.

Heroku deployment

git co heroku-production
git merge master
grunt build
git push heroku heroku-production:master -f