What does it means?
- liquid - like a liquid
- ator - authenticator
There are 3 endpoints:
- /auth/register - register
- /auth/log-in - log-in
- /user - get user info
There are Swagger documentation.
After you run tests you can find coverage results in this file
Install packages:
yarn install
Start dev docker:
yarn start:docker:dev
Run migrations in dev DB:
yarn db:dev:migrate
Run tests:
yarn start:dev
Then you can open Swagger
Install packages if not installed yet
yarn install
Start test docker:
yarn start:docker:test
Run migrations in test DB:
yarn db:test:migrate
Run tests:
yarn test:e2e
Test coverage results:
--------------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
--------------------------|---------|----------|---------|---------|-------------------
All files | 95.96 | 93.75 | 97.05 | 95.33 |
src | 73.33 | 100 | 50 | 71.42 |
app.module.ts | 100 | 100 | 100 | 100 |
app.ts | 100 | 100 | 100 | 100 |
drizzle.config.ts | 0 | 100 | 100 | 0 | 1-5
main.ts | 0 | 100 | 0 | 0 | 1-10
src/auth | 100 | 100 | 100 | 100 |
auth.controller.ts | 100 | 100 | 100 | 100 |
auth.module.ts | 100 | 100 | 100 | 100 |
src/auth/decorators | 83.33 | 0 | 100 | 83.33 |
get-user.decorator.ts | 83.33 | 0 | 100 | 83.33 | 14
src/auth/dto | 100 | 100 | 100 | 100 |
auth.dto.ts | 100 | 100 | 100 | 100 |
src/auth/guards | 100 | 100 | 100 | 100 |
auth-jwt.guard.ts | 100 | 100 | 100 | 100 |
src/auth/services | 100 | 100 | 100 | 100 |
auth.service.ts | 100 | 100 | 100 | 100 |
jwt-internal.service.ts | 100 | 100 | 100 | 100 |
src/config | 100 | 100 | 100 | 100 |
index.ts | 100 | 100 | 100 | 100 |
src/db | 100 | 100 | 100 | 100 |
schema.ts | 100 | 100 | 100 | 100 |
src/drizzle | 100 | 100 | 100 | 100 |
diozzle.service.ts | 100 | 100 | 100 | 100 |
drizzle.module.ts | 100 | 100 | 100 | 100 |
src/redis | 100 | 100 | 100 | 100 |
redis.module.ts | 100 | 100 | 100 | 100 |
redis.service.ts | 100 | 100 | 100 | 100 |
src/user | 100 | 100 | 100 | 100 |
user.controller.ts | 100 | 100 | 100 | 100 |
user.module.ts | 100 | 100 | 100 | 100 |
user.service.ts | 100 | 100 | 100 | 100 |
src/user-cache | 100 | 100 | 100 | 100 |
user-cache.module.ts | 100 | 100 | 100 | 100 |
user-cache.service.ts | 100 | 100 | 100 | 100 |
--------------------------|---------|----------|---------|---------|-------------------
I would use standard flow:
- user get URL
- user go to the URL
- user receive response with token
- user send the token to our API
- our API generate access JWT token end send it to a user
Diagram:
I would use Kubernetes to scale pods if needed also I would use distributed database