Skip to content

thiagohrcosta/Daily-Diet-Api

Repository files navigation

enter image description here

Daily Diet API

NodeJS TypeScript Fastify

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.

What user can do on this API

  • 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

enter image description here

To create a user

{
	"name": "Jack Ryan Jr",
	"email": "jackryanjr@gmail.com"
}

To create a meal

{
	"name": "Pizza",
	"description": "An amazing pizza to put end on your diet",
	"date": "03-29-2023",
	"time": "21:15",
	"isOnDiet": false
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published