- PostgreSQL - PostgreSQL database
- Node.js - JavaScript runtime
- npm - Node.js dependency manager
- windows-build-tools - Build Tools for Windows
Install dependencies:
$ npm install
Copy example file and edit it providing correct data:
$ cp .env.example .env
$ vim .env
-
Create development and test databases:
$ npm run db:create $ NODE_ENV=test npm run db:create
-
Run all migrations:
$ npm run db:migrate $ NODE_ENV=test npm run db:migrate
IntelliJ IDEA / WebStorm / PhpStorm:
-
Install the following plugins:
-
Go to
File > Settings > Languages & Frameworks > JavaScript > Prettier
Check run for files
On save
and use below as a value:{**/*,*}.{js,json,md,yml}
From now on every change in code base will be automatically formatted by Prettier.
Run server and start hacking:
$ npm start
-
Run tests:
$ npm test
-
Run tests in watch mode:
$ npm run test:watch
-
Generate code coverage report:
$ npm run test:coverage
-
Run server:
$ npm start
-
Explore API docs at http://localhost:3001/api/docs/
-
Edit
docs/swagger.yml
file to update API docs.