Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andresilveira1/food-explorer-api
https://github.com/andresilveira1/food-explorer-api
express javascript knex nodejs sqli sqlite sqlite3
Last synced: about 10 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/andresilveira1/food-explorer-api
- Owner: andresilveira1
- Created: 2023-10-10T12:33:21.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-03T23:14:48.000Z (9 months ago)
- Last Synced: 2024-03-04T00:24:32.298Z (9 months ago)
- Topics: express, javascript, knex, nodejs, sqli, sqlite, sqlite3
- Language: JavaScript
- Homepage: https://foodexplorer1000.netlify.app/
- Size: 9.74 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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](./.github/preview.png)
### FrontEnd repository: [Link](https://github.com/andresilveira1/food-explorer-web)
## Technologies
- Node.js
- Express
- SQLite
- Knex
- Cors
- JWT## Requisites
- [Node.js](https://nodejs.org/en)
## Setup
- Clone the repository;
- Install dependencies (`npm install`)
- Run application (`npm run dev`)
#
HTTP
##
Menu
### POST`/users`
Create a new user.
#### Request body
```json
{
"name": "username",
"email": "[email protected]",
"password": "123456"
}
```#### Authentication: `/sessions`
```json
{
"email": "[email protected]",
"password": "123456"
}
```### GET`/menus`
#### Find a dish by query.
```http
/menus?name
```#### Find a dish by ID.
```http
/menus/:id
```### POST`/menus`
Create a dish.
#### Request body
```json
{
"name": "dish name",
"description": "dish description",
"price": "12,34",
"category:": "dish category",
"ingredient": ["tag1", "tag2", "tag3"]
}
```#### Add or update dish image.
```http
PATCH`/menus/img/:id`
```### PUT`/menus/:menu_id`
Update a dish.
```json
{
"name": "dish name",
"description": "dish description",
"price": "12,34",
"category:": "dish category",
"ingredient": ["tag1", "tag2", "tag3"]
}
```### DELETE`/menus`
```http
/menus/:menu_id
```##
Favorites
### GET`/favorites`
```http
/favorites/:user_id
```### POST`/favorites`
```json
{
"name": "product name"
}
```### DELETE`/favorites`
```http
/favorites/:id
```##
Tags
### GET`/tags`
```http
/tags/:menu_id
```##
Payment
### GET`/payment`
```http
/payment/:user_id
```### POST`/payment`
```json
{
"quantity": "1",
"menu_id": "1"
}
```### DELETE`/payment`
```http
/payment/:id
```
[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)