This repository contains a REST API of Sales Store Application with storage to a MongoDB database. Each application service is separated into modules that correspond to their respective domain and also each endpoint is documented using the Open API standard through Swagger.
- Install Docker
Here is the official link to download it: https://www.docker.com/get-started/ - Why Docker?
Docker will allow you to connect to the MongoDB database.
- Once Docker is installed and running.
$ docker-compose up -d
This will create a container with the mongodb database.
- Install the necessary dependencies for this project.
$ npm install
- The repository contains a file called .env.example which shows an example of the environment variables needed to run the application. In the root directory ("/") create an .env file and add the environment variables detailed in the .env.example file.
# development
$ npm run start
# watch mode
$ npm run start:dev
# up mongo database
$ docker-compose up -d mongo
Once the application is running, access the following URI where you will find the documentation for each endpoint and Dto (Data Transfer Object).
/docs
URL example
http://localhost:3000/docs