Skip to content

Latest commit

 

History

History
90 lines (61 loc) · 1.49 KB

File metadata and controls

90 lines (61 loc) · 1.49 KB

YATA - Nest.js Backend

Development setup

Required software

  • Node.js - recommended v18.13.0
  • npm (recommended v8.19.3) or another package manager
  • Nest.js CLI - recommended v9.2.0
  • Docker

Installing dependencies

npm install

Creating database container

Create a docker container and then run it:

docker compose up yata-dev-db -d

Running Prisma migration

Run Prisma migration:

npx prisma migrate dev

(Read more about it in the Prisma documentation)

Registering user using API

You need a user account to use the app. To sign up, send a POST request to the /signup endpoint. You can use cURL or any other software of your choice:

curl --location 'http://localhost:9339/signup' \
--header 'Content-Type: application/json' \
--data '{
    "username": "test",
    "password": "Qwerty123/",
    "name": "Test user"
}'

Running the backend

Make sure database is running in docker container and then start backend:

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Testing

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Linting and formatting code

Before every commit don't forget to lint and format code:

$ npm run lint && npm run format

License

Project is MIT licensed.