This project is created with Nest and TypeORM is a marketplace API based on Polygon's technical test challenge.
Use clean architecture based on DDD and SOLID principles.
The endpoints that satisfy the challenge are the following:
- List of products. => GET /api/products
- Search products. => GET /api/products/search/:term
- See product detail. => GET /api/products/:id
- Add products to the shopping cart. => POST /api/shopping-cart-details
- See shopping cart detail. => GET /api/shopping-carts/:id
- Remove products from the shopping cart. => DELETE /api/shopping-cart-details/:id
- Display products by category. => GET /api/products/category/:id
In the infrastructure part the project uses Docker with a docker-compose.yml file that has the definition of the database service in PostgreSQL and a service with Adminer to view the content of the database in web format.
To use docker-compose you must have docker installed and execute the following commands before running the project:
$ docker-compose up -d // Start the services.
$ docker-compose stop // Stop the services.
$ docker-compose down -v // Stop and delete the services
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
Due to time constraints I couldn't implement the unit and e2e tests.
To document the API a Postman collection is included in the documentation
folder.