- Redis
Install the dependencies and build the project resources
npm install
Redis is used for session handling by the application and will need to be installed and running prior to starting the app - if you don't have it installed locally you can run from a docker container:
docker run -d -p 6379:6379 redis
Initiate the server in development mode (Express is used to serve the static resources in development).
To see some log messages set the log level with the env var LOG_LEVEL.
npm run dev
See the development documentation for a complete description of the application and how to maintain and support BRP.
Start the application in default mode (production).
npm start
Start the application with Nodemon in development mode. Debug is switched on and the server restarts when the JS or Sass are recompiled.
npm run dev
Compile the Sass to CSS
npm run sass
Compile JS using Browserify
npm run browserify
To run all unit and acceptance tests and linting run:
npm run test
Unit tests are run using Mocha. Tests are defined in ./test/unit
npm run test:unit
Acceptance tests use webdriverio and cucumber-js to run feature tests
npm run test:acceptance
Run the EcmaScript (ES) linter. Rules are defined in .eslintrc
npm run lint
Run the jscs style checker. Rules are defined in .jscsrc.json
npm run style
Analyse the test coverage of the codebase (for results - open ./reports/coverage/lcov-report/index.html)
npm run coverage
or using environment variable on unit tests
export npm_config_coverage=true
npm run test:unit
Analyse the quality of the codebase (for results - open ./reports/plato/index.html)
npm run quality
Maildev can be run as a development SMTP server to catch emails being sent and preview the results.
npm run maildev
By default, in development, a stub transport will be used for emails. To sent to maildev you will need to create the env var SMTP_USER and set it to any value:
export SMTP_USER='test';
Now start the app and it will send emails via maildev.
- See the package.json for a full list of scripts.
- Full list of environment variables