zer0fire / code-challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

code-challenge

Description

This project built by Nest framework, and dockerize the project and database

Installation

$ pnpm install

Running the app

use Docker to build all app

$ docker compose up

and if you want to develop, use pnpm to start this project

# development
$ pnpm run start

# watch mode
$ pnpm dev
$ pnpm start: dev

# production mode
$ pnpm run start:prod

Document

open the watch mode and access localhost:3000//api/doc path, access the api document

$ pnpm dev

Stories

  1. Use /init interface to create seed data
  2. Use /auth/login to login, and if username and password are correct, it will return a JWT token
  3. if username is incorrect, it will return User not exist, and if password is incorrect, it will return Password error
  4. When a user has an incorrect password and tries 3 times in 5 minutes, they will be blocked. and it will return User has been blocked

Test

# unit tests
$ pnpm run test

# e2e tests
$ pnpm run test:e2e

# test coverage
$ pnpm run test:cov

About


Languages

Language:TypeScript 94.0%Language:Dockerfile 3.5%Language:JavaScript 2.5%