This API is intended for daily diet control, allowing users to record food consumed throughout the day, calculate nutritional information and track progress against established goals.
Technologies | Services | Packages | Features | Links | Versioning | License
Here are the technologies used in this project.
- TypeScript 4.9.5
- NodeJS 18.13.0
- Fastify 4.12.0
- Vitest 0.28.4
- Knex 2.4.2
Here are the services used in this project.
Here are the packages used in this project.
- @fastify/cookie -> A plugin for the Fastify framework that allows developers to set, get and delete HTTP cookies.
- zod -> Used to validate and manipulate structured data with JavaScript.
Here are the main features of the project.
- Application Rules
- Must 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:
Meals must be related to a user.
- Name
- Description
- Date and time
- Is on or off the diet
- It must be possible to edit a meal, being able to change all the above data
- It must be possible to delete a meal
- 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 retrieve a user's metrics
- Total number of registered meals
- Total amount of meals within the diet
- Total number of meals outside the diet
- Best sequence per day of meals within the diet
- User can only view, edit and delete meals which he created
- Endpoints:
- POST /users: Create a new user if not exists.
- GET /meals: List all meals.
- POST /meals: Create a new meal.
- PUT /meals: Update a meal.
- GET /meals/:id: List all meals for a user.
- PATCH /meals/:id: Lists a specific meal.
- DELETE /meals/:id: Lists a meal.
- GET /resume: Retrieve a user's metrics.
- Deploy on : Em breve
- Repository: https://github.com/DevPedroHB/daily-diet-api
Here are the versions of the parts of the project.
- API -> 1.0.0
This project is licensed under the MIT license.
Made with ♥ by Pedro Henrique 🚀 Never stop learning!