This project is a simple API to manage a list of products and their prices and general data. It is a simple project to learn NestJS and Typescript emulating a ecommerce.
Built with NestJS, Typescript and PostgreSQL. Dockerized with different environments for development, testing and production.
- Typescript
- NestJS
- PostgreSQL
- PgAdmin
- Docker
-
Clone the repository
-
Create a
dev.env
file with the same variables as.env.example
-
Up the database and backend with:
yarn docker-compose:dev
-
Execute the seed to populate the database sending a
GET
request to:http:https://localhost:3000/api/seed
Note: If you want to use the database with PgAdmin, go to http:https://localhost:5050
and introduce the credentials
assigned in the .env
file in the ADMIN_EMAIL
and ADMIN_PASS
variables.
You can find the API documentation in http:https://localhost:3000/api/
You can see the project deployed in Teslo API
To deploy the project in production, you can use the following command:
yarn docker-compose:prod
This will build the project and create the image for the backend without the database. To execute this command you need
to have the prod.env
file with the same variables as .env.example
.
After that, you can push the docker image to your docker registry and deploy it in your server.