Skip to content

Repository files navigation

Nevezide - Authentication API

Requirements

  • NodeJS engine
  • PostgreSQL engine with 2 DBs : school and school_test

The package contains

Setup

Copy .env.sample to .env Set .env variables, as following conditions :

NODE_ENV = # prod | dev
API_PORT = # API listening port
TOKEN_SECRET = # Salt for JWT signature
TOKEN_EXPIRATION = # JWT expiration delay (ex: 1800s for 30 minutes)

PROD_DATABASE_URL = # Production | Dev DB connection string (as postgres://user:password@localhost:5432/school)
TEST_DATABASE_URL = # Test DB connection string (as postgres://user:password@localhost:5432/school_test)

Build it for production

docker build -t nevezide44/users-auth-api-boilerplate -f Dockerfile .
docker login -u "nevezide44" -p "<access_token>" docker.io
docker push nevezide44/users-auth-api-boilerplate

Use it

Install dependencies

npm i

Migrate the DB

db-migrate up

Launch it for developement

npm start

Test and Develop it

Test with coverage audit

npm test

Will generate a report into the terminal For more readable reportings, check the doc : https://github.com/bcoe/c8

Test driven developement

npm run tdd

Further information

Mocha test framework : https://mochajs.org/#getting-started Chai assertions : https://www.chaijs.com/api/assert/ Test coverage options and reportings : https://github.com/bcoe/c8

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages