Skip to content

kyro95/tech-test

Repository files navigation

Build

tech-test

Tech stack
A nestjs simple test repo to handle users, products and orders.
Wanna try out the API for yourself? Download Postman.
Check out the documentation on how to setup a gRPC collection as well here. You can also find a postman collection about this API

Run project

The following commands will guide you through installing the dependencies and running the application.
Setup first the .env file. Feel free to copypaste example.env and set your custom enviroment.

# Install deps
$ npm install

# production mode
$ npm run start:prod

# development
$ npm run start

# or if you wanna start in watch mode (build each time the code changes)
# production mode
$ npm run start:prod

Run tests

This section will guide you through running the unit/e2e tests

⚠️ Important: Before running the tests, make sure to stop the default Docker profile if it’s up otherwise main db is going to get polluted. Run instead using the --profile test flag.

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Docker

Just use default if you wanna launch a dockerized instance of the application or test if you wanna launch the unit/e2e tests.

Docker profiles:

  • default - runs app and app database
  • test - runs only test db for e2e tests
  • dev - runs only app database for running the application locally.
# Available profiles: default, test, dev

# Init/Start container
$ docker-compose --profile default up -d --build

# Shutdown container
$ docker-compose --profile default down

# Delete container and volumes
$ docker-compose --profile default down -v

Test gRPC endpoints

As mentioned above download postman as your client and get the collection from the link. All the endpoints have a base body to work with to test your own calls. No need to import any .proto into postman since Server reflection is enabled.

Postman screenshot

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages