- User service API for web & mobile apps
-
Install Node.js v8.6.0
-
Install npm v5.3.0
-
Install project dependencies:
-
Install all dependencies defined in package.json:
npm install
-
-
Setup environment variables
This project uses dotenv, please configure the proper environment variables before running this application.
- Copy the
.sample-env
file and rename it to.env
- Edit all sample fields with the correct environment variables for the application server
- Copy the
-
Database migration (using Sequelize):
- create model (and migration):
node node_modules/.bin/sequelize model:create --name <model_name> --attributes <attributes>
- create migration:
node node_modules/.bin/sequelize migration:create
- run:
node node_modules/.bin/sequelize db:migrate
- undo:
node node_modules/.bin/sequelize db:migrate:undo
- help:
node node_modules/.bin/sequelize help
- create model (and migration):
-
How to run tests:
npm test
-
Deployment instructions
npm start
ornode index.js
-
Writing tests:
This project use Mocha as the testing environment, and Chai as the assertion library. This project also provide code coverage using Istanbul. Code coverage report can be viewed in
coverage/lcov-report/index.html
after running test. All test files should be located under thetests
directory. -
Writing code:
Please fork this repository first for starting a contribution. This project use ESLint as Javascript lint library.
- To run ESlint, type
node node_modules/.bin/eslint .
- Fixing code errors, just type
node node_modules/.bin/eslint . --fix
- To run ESlint, type