Artur-Poffo / 02-Daily-Diet-API-Ignite

Second challenge of the updated Node.js track of the Ignite course

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A meals and diet API

Status: Finished

AboutFeaturesAPI RoutesHow it worksTech StackAuthor

About

Daily Diet API - Second challenge of Ignite's updated Node.js trail, API that allows you to manage your meals


Features

  • Sign Up
  • Sign In
    • JWT Authentication
  • List all meals of a user
  • Filter one unique meal with ID
  • Add meals
  • Update meals
  • Delete meals
  • View your user metrics
  • Persist data in Postgres database with docker

API Routes

  • Users
    • POST /users - Create a new user
    • POST /users/signin - Sign in and generate JWT
    • GET /users - Get your user metrics require a Bearer Token in the req's header
  • Meals - All routes require a Bearer Token in the req's header
    • GET /meals - List all meals of your user
    • GET /meals/:id - See a specific meal of your user
    • POST /meals - Create a new meal
    • PATCH /meals/:id - Update one of yours meals
    • DELETE /meals/:id - Delete one of yours meals

How it works

Pre-requisites

Before you begin, you will need to have the following tools installed on your machine: Git, Node.js. In addition, it is good to have an editor to work with the code like VSCode and a REST client like Insomnia

it is very important that before running the project you configure the environment variables as indicated in the file: .env.example

Run the app

# Clone this repository
$ git clone https://github.com/Artur-Poffo/02-Daily-Diet-API-Ignite.git

# Access the project folder cmd/terminal
$ cd 02-Daily-Diet-API-Ignite

# install the dependencies
$ npm install

# With your database running and conected:
$ npx prisma migrate dev

# Run the application in development mode
$ npm run dev

# The server will start at port: 3333 - You can now test in Insomnia or another REST client: http://localhost:3333

Tech Stack

The following tools were used in the construction of the project:

  • Node.js
  • TypeScript
  • tsx
  • tsup
  • Fastify
  • bcrypt
  • zod
  • prisma

See the file package.json


Author

  • Artur Poffo - Developer

Linkedin Badge Gmail Badge


About

Second challenge of the updated Node.js track of the Ignite course


Languages

Language:TypeScript 100.0%