The Daily Diet API it's a project develop as a challenge along the specialization in NodeJS from Rocketseat, the goal it's to create a complete API that allows a user create a account and register their meals along the day. The user can only edit or delete the meals that he creates. Will also add a complete information about the meals, like how many consecutive days the user eat foods that are in their diet list.
To create more friendly query searchs the Knex was used and in the development the Sqlite3 was used as a database.
To check if user id exists or if is the users who creates a meals is the one who tries to edit it, was create two separate middlewares.
- Users
- [Get] Check me route /me to see their own information
- [Post] Create new user
- Meals
- [Get] Get the information about one meal
- [Get] List of all meals from one user
- [Post] Create a new meal
- [Put] Edit a meal
- [Delete] Delete a meal
- Metrics
- [Get] Retrieve all informations about a user meals
{
"name": "Jack Ryan Jr",
"email": "jackryanjr@gmail.com"
}
{
"name": "Pizza",
"description": "An amazing pizza to put end on your diet",
"date": "03-29-2023",
"time": "21:15",
"isOnDiet": false
}