A daily diet api created using Nodejs + Typescript + SOLID principles
This is a project used for study purposes only โข Samir El Hassan
- fastify
- prisma
- zod
- vitest
Install all the packages
yarn install
Generate the prisma typescript and generate the local databse
yarn prisma generate && yarn prisma migrate dev
create a .env file following the values on .env.example, after that run:
yarn dev
Unit tests:
yarn test
- It should be possible to create a user
- It must be possible to identify the user among the requests
- It must be possible to register a meal made, with the following information:
- Name
- Description
- Data and Time
- Is on or off the diet
- It should be possible to list all meals of a user
- It should be possible to visualize a single meal
- It must be possible to delete a meal
- It must be possible to edit a meal
- It should be possible to retrieve a user's metrics
- Total number of registered meals
- Total number of meals within the diet
- Total amount of off-diet meals
- Best sequence of meals within the diet
- User can only view, edit and delete meals which he created