Development
- Run with:
npm run dev-server
ornpm run dev
The following project follows a simplifed variant of the clean architecture. It organize features using vertical slicing
- MongoDB Client
- NestJS
- Joi
Before running the project, create the necessary env files located in env-vars
folder.
For development, create inside env-vars
a file called .env.dev
and copy the content of .dev.env.example
into it.
- Nodejs 14 or greater
- Authentication is mocked by passing the app user ID in the authorization header instead of a token
- Email and password login is not implemented until the authentication strategy is defined. Nevertheless, almost the necessary code is already implemented but not used.
- The controllers can be found in all files ending with .controller.ts
- This project is focused more on the CRUD part, It does not contain any form of authentication
- Even if there is no authentication, permission validations are sometimes considered.
- There is no strong validation on data integrity related to products, orders and restaurants. Example: an order with several products from different restaurants.
- To keep it simple, every time an order status changes to delivered, the restaurant's popularity increases by one. A better way to implement this functionality is to use a cron job that finds all delivered orders and sets the correct popularity for all restaurants.
- Examples of how to consume the API are inside the folder
test-endpoints