JWT Auth boilerplate for Node projects using Express and PostgreSQL
Install node packages. Make sure you have installed at least Node.js v10.
$ npm i
Create a .env
file with the contents from .env.sample
Build and Start the Node server
$ npm start
# development using nodemon with live reload
$ npm run dev:watch
# debug
$ npm run debug
The server started at http://localhost:3000
-
Run
npm run test
in order to run all the unit tests. This will build the results into./reports/results/unit
folder. -
Run
npm run test:coverage
in order to run all the unit tests and create a coverage folder. This will build the coverage into./reports/coverage
folder.
- Run
npm run test:functional
in order to run all the functional tests. This will build the results into./reports/results/functional
folder.
-
Run
docker-compose up db
to start the database container -
Connect to the database named
pgdb
and create a schema namedjwt_auth
-
Run
npm run db:migrate
to populate the schema with the required tables
-
Run
npm run docker:build
in order to build docker image with taglatest
. -
Run
docker-compose up
from project's root path to start the containers
- Run
npm run docs
in order to create API reference manual. This will build the documentation into./reports/apidoc
folder.