README.md
July 3, 2022 ยท View on GitHub
Install
npm i or yarn
Local development
- Make sure to have a postgres DB instance running locally
- Run migrations ๐
npx prisma migrate dev - Run seeds on local DB ๐
npx prisma db seed
DataBase
- For any changes made on
prisma.schema, remember to runnpx prisma migrate devlocally in order to generate new prisma client and update migrations SQL scripts.
ERD

Test
- Run all tests once, with coverage results ๐
npm run test - Run all tests while developing with --watch flag ๐
npm run test:watch
API Docs - (swagger)
Environments
- DEV ๐
http://dev.detoxify.ar/api - PROD ๐
http://detoxify.ar/api
Endpoints
Health Check
GET /health
Users
All routes need Authorization header with a valid bearer token provided to the user making the request.
GET /users
GET /users/:id
GET /users/:id/details
GET /users/:id/achievements
GET /users/:id/snapshot
PUT /users/:id
POST /users
Auth
POST /auth/login
POST /auth/register
TODO:
- Add TLS certificates
- Configure chron job to calculate user stats