Skip to content

andresilveira1/food-explorer-api

Repository files navigation

Food Explorer Backend

A Rest API build with Node.js and Express. This API have two types of users, a Admin and Customer. The Admin can Create, Edit and delete new dish to menu that contains a Name, image, category, ingredients, price and a description. The Customer can interact with the menu, view details, search, set as favorite and include on a order list.

preview

FrontEnd repository: Link

Technologies

  • Node.js
  • Express
  • SQLite
  • Knex
  • Cors
  • JWT

Requisites

Setup

  • Clone the repository;
  • Install dependencies (npm install)
  • Run application (npm run dev)

HTTP

Menu

POST/users

Create a new user.

Request body

{
  "name": "username",
  "email": "useremail@email.com",
  "password": "123456"
}

Authentication: /sessions

{
  "email": "useremail@email.com",
  "password": "123456"
}

GET/menus

Find a dish by query.

/menus?name

Find a dish by ID.

/menus/:id

POST/menus

Create a dish.

Request body

{
  "name": "dish name",
  "description": "dish description",
  "price": "12,34",
  "category:": "dish category",
  "ingredient": ["tag1", "tag2", "tag3"]
}

Add or update dish image.

PATCH`/menus/img/:id`

PUT/menus/:menu_id

Update a dish.

{
  "name": "dish name",
  "description": "dish description",
  "price": "12,34",
  "category:": "dish category",
  "ingredient": ["tag1", "tag2", "tag3"]
}

DELETE/menus

/menus/:menu_id

Favorites

GET/favorites

/favorites/:user_id

POST/favorites

{
  "name": "product name"
}

DELETE/favorites

/favorites/:id

Tags

GET/tags

/tags/:menu_id

Payment

GET/payment

/payment/:user_id

POST/payment

{
  "quantity": "1",
  "menu_id": "1"
}

DELETE/payment

/payment/:id

MIT License