-
run MongoDB (if using local install of MongoDB and it's not already running)
-
[just in case] run
npm install && bower update && bower install
(from the root directory of this app - all commands are from the root directory of this app unless noted otherwise) -
Run grunt from the root project folder (the folder that has "Gruntfile.js" in it) to build all files. Grunt should be run after most file changes and prior to any commits. NOTE: the default
grunt
command also runs tests and requires a node test server to be running first (more below) and there are other grunt commands as well.- NOTE: you'll have to re-run this command every time you update a (frontend) .less (or .scss) or .html file to rebuild assets. When in doubt, re-run grunt!
grunt q
- Start the node server from the root project folder.
- NOTE: you'll have to re-run this command to restart the server every time you change a (backend) node.js file
node run.js
- To view the site and/or documentation, open a browser and go to the following urls. The precise urls used will depend on the domain and port specified in config.json. Assuming
localhost
and3000
, they would be:- View site:
http://localhost:3000/
- View api docs:
http://localhost:3000/api/help
- View YUI auto documentation (make sure to run
grunt yui
first to generate these pages):- frontend: open
/yuidocs/frontend/index.html
in a browser - backend: open
/yuidocs/backend/index.html
in a browser
- frontend: open
- View site:
Grunt is the main automation / workflow tool. See Gruntfile.js
for more info and all commands, but the most common ones are:
grunt dev
to watch and auto build and test code as you're workinggrunt dev-test
to watch and run ONLY tests as you're workinggrunt dev-karma-cov
to generate frontend coverage reports as well (due to a grunt karma limitation, need 2 separate commands unfortunately..)
grunt dev-build
to watch and ONLY build as you're working (basically it auto-runsgrunt q
for you on file changes)
grunt
prior to ANY git commits & pushes - always ensure your code quality is high (tests, etc.) BEFORE pushing changes to ensure you don't break the build/code for others / on the live server!
- Run
grunt q
- Run
grunt
from the root app directory - this will run all tests:- backend node.js Jasmine (API route) tests
- frontend Karma unit tests
- frontend Protractor / Selenium end-to-end (E2E) tests
To ONLY run BACKEND (Node) tests, run grunt test-backend
.
To ONLY run FRONTEND (Angular) tests, run grunt-frontend
BUT FIRST you must run the test server (this is normally auto-run by the backend tests) by doing:
- Open a NEW command prompt/terminal window and type
node run.js config=test
to run the test server (this connects to the test database and wipes it clean on each run)- NOTE: this used to be a required step before running ANY tests BUT it has been updated so that
app/test/all.spec.js
sets the test configuration command line args and requiresrun.js
which thus self-runs the test server instead of needing to run in a separate window! And it exits when done so don't need to use forever to always keep the test server running and eating up resources!
- NOTE: this used to be a required step before running ANY tests BUT it has been updated so that