Skip to content

alexeygorbachevsky/nest-rest-service

Repository files navigation

REST service

Prerequisites

Downloading

git clone {repository URL}

Installing

1. npm install (npm modules installing)
2. Download pgAdmin (postrges database). You can change name of db and other credentials in .env file.
3. Install and run Docker if you want run app from it.

Running application

  1. For running app from Docker change POSTGRES_HOST value to 'host.docker.internal' in .env file.

  2. npm start

Use one of the next commands for build docker images, create and start docker containers:

docker compose up

or

docker-compose up

After starting the app on port (4000 as default) you can open in your browser OpenAPI documentation by typing http://localhost:4000/doc/. For more information about OpenAPI/Swagger please visit https://swagger.io/.

Testing

After application running open new terminal and enter:

To run all tests without authorization

npm test

To run only one of all test suites (users, boards or tasks)

npm test <suite name>

To run all test with authorization

npm run test:auth

To run only specific test suite with authorization (users, boards or tasks)

npm run test:auth <suite name>

To run load test scenarios

npm run test:load

Generate load test report after scenarios run

npm run artillery:report

Compare Performance (Fastify vs Express)

  1. Express test results
  2. Fastify test results

Development

If you're using VSCode, you can get a better developer experience from integration with ESLint and Prettier extensions.

Auto-fix and format

npm run lint

Debugging in VSCode

Press F5 to debug.


Tasks

Task 1. Caesar cipher CLI tool

Task 2. Express REST service

Task 3. Debug in Node.js

Task 4. Typescript basics

Task 5. Logging & Error Handling

Task 6. Docker basics

Task 7. PostgreSQL & Typeorm

Task 8. Authentification & JWT

Task 9. NestJS


For more information, visit: https://code.visualstudio.com/docs/editor/debugging

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published