JWT auth provider + user management system written in nodejs.
- Language: Typescript
- Framework: Express
- Database: postgres
- ORM: Prisma
- Payload validation: celebrate
- JWT token: jsonwebtoken
- Test: jest, supertest
- issue token & introspect token endpoints
- user regsitration & login
- express auth token authentication middleware
- TODO: refresh token
To run app on docker:
- Copy
.env.sample
and rename to.env
. - Run
docker-compose up
- App should be accessible at http://localhost:7000
To run app locally:
- Prerequisites: nodejs v16
- Copy
.env.sample
and rename to.env
. - Run
docker-compose up
- Run
npm install
- Setup prisma schemas. Run
npx prisma generate
- Run
npm run dev
. Your local server should be running at http://localhost:5555
# unit tests
npm run test:unit
# integration tests, requires DB connection (run docker-compose up)
npm run test:integration