/nest-prisma

Primary LanguageTypeScript

Node.js Challenge

How to run the project

Api-service

$ cd api-service

$ npm i
# create db container
$ docker-compose up

$ npm run start

Stock-service

$ cd stock-service

$ docker-compuse up

or

$ cd stock-service

$  npm i

$ npm run start

Test

$ cd <project_name>
# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Details

All the endpoints should work as on the Instructions, and a swagger docs can be seen here

Endpoints:

  • POST /register - for basic registration
  • POST /auth/reset-passowrd - to reset user's password
  • GET /stock?q=code - to fetch stock data
  • GET /history - to see the user stock history
  • GET /stats - to see the most requested stocks (admin only route)

Unit test ( api-service)

  • UserService (user.service.spec)
  • StockService (stock.service.spec) (wip)

Unit test ( stock-service)

  • AppService (app.service.spec)
  • AppController ( app.e2e-spec )

Prima Studio

Prisma offers a management enviroment that can be access through:

$ npx prisma studio

or

$ npm run prisma

Email

To use the email service add the configuration into the .env file