Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnmata0427/food-ordering-api-restful
RESTful API for System Food Ordering at ESFOT faculty of EPN
https://github.com/johnmata0427/food-ordering-api-restful
backend expressjs mongoose restful-api
Last synced: about 20 hours ago
JSON representation
RESTful API for System Food Ordering at ESFOT faculty of EPN
- Host: GitHub
- URL: https://github.com/johnmata0427/food-ordering-api-restful
- Owner: JohnMata0427
- Created: 2024-06-27T17:55:16.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2024-08-18T02:11:34.000Z (3 months ago)
- Last Synced: 2024-10-20T18:34:42.675Z (26 days ago)
- Topics: backend, expressjs, mongoose, restful-api
- Language: JavaScript
- Homepage: https://food-ordering-api-restful.onrender.com/
- Size: 285 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
$\color{Apricot}{Food\ Ordering\ at\ ESFOT\ API\ RESTful}$
---
> [!IMPORTANT]
> **Problematic Introduction**
>
> The lunchtime rush at ESFOT poses a significant operational challenge.
> The influx of students seeking to order their meals within a limited timeframe (11 AM to 2 PM) results in the formation of long queues.
> These extended wait times not only inconvenience students but also negatively impact their overall dining experience.
> Additionally, the manual ordering process, with its inherent limitations, can lead to inefficiencies and potential errors.
> The existing system struggles to accommodate the high volume of orders during peak hours, leading to delays and frustration among students.---
π₯£ Sprint 0 - Development Environment Configuration
β Definition of Requirements and Constraints
> - **User Registration and Authentication**
>
> - Users must be able to register with a username, password, and other relevant details.
> - Users must be able to log in and log out of the system.
>
> - **Menu Management**
>
> - Administrators must be able to add, edit, and delete menu items.
> - Users must be able to view the available menu, including descriptions, prices, and availability of dishes.
>
> - **Placing Orders**
>
> - Users must be able to select menu items and place an order.
> - Users must be able to view a summary of their order before confirming it.
> - Users must be able to modify or cancel an order before final confirmation.
>
> - **Order History**
>
> - Users must be able to view their past orders.
> - Users must be able to repeat previous orders easily.β Backend Project Structure
> - **Tools**
>
> | Image | Name |
> |--------------------------------------------------------------|----------------------------|
> | ![VSCode](https://skillicons.dev/icons?i=vscode&theme=light) | Visual Studio Code |
> | ![MongoDB](https://skillicons.dev/icons?i=mongo&theme=light) | MongoDB Atlas y Compass |
> | ![NodeJS](https://skillicons.dev/icons?i=nodejs&theme=light) | Node.js |
> | ![PNPM](https://skillicons.dev/icons?i=pnpm&theme=light) | PNPM (Recommendation) |
>
> - **Project Initialization and Installation Dependencies**
>
> - Open the terminal and run the following command:
> ```
> npm init -y
> ```
> - Now proceed to install the following modules for the development and production environment:
> ```
> npm i express bcryptjs mongoose dotenv nodemailer jsonwebtoken cors
> ```
>
> - **Project File Structure**
>
> - Now we proceed to create a series of files and directories for the web server, running each of these commands in order:
> ```
> mkdir src
> ```
> ```
> cd src
> ```
> ```
> "config","controllers",βhelpersβ,βmiddlewaresβ,βmodelsβ,βroutersβ | %{New-Item -Name β$_β -ItemType βDirectoryβ}
> ```
> ```
> cd ..
> ```
> - Create the directories database.js index.js server.js .env .env.example .gitignore, the final result is this:
>
> ![image](https://github.com/JohnMata0427/Food-Ordering-API-RESTful/assets/150484680/a97398f6-1260-40ba-a4a8-56721dad300f)β Database Development
> - MongoDB Collections
> - Chefs
> - Students
> - Orders
> - Productsβ User Roles
> - Students π§βππ©βπ
> - Chefs π¨βπ³π©βπ³---
π¨βπ³ Sprint 1 - Chef Module
β Endpoints to be Developeds
>
>Development in Express
>
>
>
>To create the backend endpoints, the MVC model is used, and the files that contain the sprint presentable are:
>
> [![Model](https://img.shields.io/badge/Chef%20Model-000000.svg?logo=JavaScript)](/src/models/chef.js)
> [![Controller](https://img.shields.io/badge/Chef%20Controller-000000.svg?logo=JavaScript)](/src/controllers/chef_controller.js)
> [![View](https://img.shields.io/badge/Chef%20Route-000000.svg?logo=JavaScript)](/src/routes/chef.routes.js)
>
> π οΈ Endpoint for registration
>
> ```http
> POST /api/register
> ```
>
> π οΈ Endpoints for sending and verifying email
>
> ```http
> GET /api/confirmar/:token
> ```
>
> π οΈ Endpoint for login
>
> ```http
> POST /api/login
> ```
>
> π οΈ Endpoint for password reset
>
> ```http
> POST /api/chef/recuperarpassword
> ```
>
> π οΈ Endpoint for cheking token for password reset
>
> ```http
> GET /api/chef/recuperarpassword/:token
> ```
>
> π οΈ Endpoint for new password
>
> ```http
> POST /api/chef/nuevopassword/:token
> ```
>
> π οΈ Endpoint for updating profile
>
> ```http
> PUT /api/chef/:id
> ```
>
> π οΈ Endpoint for updating password
>
> ```http
> POST /api/chef/actualizarpassword
> ```
>
> π οΈ Endpoint for getting chef by id
>
> ```http
> GET /api/chef/:id
> ```
>
> π οΈ Endpoint for getting all chefts
> ```http
> GET /api/chefs
> ```βΆοΈ Interface Design
>
>Prototyping in Figma
>
>
>
> π¨ Figma layout URL: https://www.figma.com/design/QgTkoUAXTEj120bpNTTu5c/Food-Ordering-Application-at-ESFOT---
π©βπ Sprint 2 - Student Module
β Endpoints to be Developeds
>
>Development in Express
>
>
>
>To create the backend endpoints, the MVC model is used, and the files that contain the sprint presentable are:
>
> [![Model](https://img.shields.io/badge/Student%20Model-000000.svg?logo=JavaScript)](/src/models/estudiante.js)
> [![Controller](https://img.shields.io/badge/Student%20Controller-000000.svg?logo=JavaScript)](/src/controllers/estudiante_controller.js)
> [![View](https://img.shields.io/badge/Student%20Routes-000000.svg?logo=JavaScript)](/src/routes/estudiante.routes.js)
>
> π οΈ Endpoint for registration
>
> ```http
> POST /api/estudiantes/registro
> ```
>
> π οΈ Endpoints for sending and verifying email
>
> ```http
> GET /api/estudiantes/confirmar/:id
> ```
>
> π οΈ Endpoint for login
>
> ```http
> POST /api/estudiantes/login
> ```
>
> π οΈ Endpoint for password reset
>
> ```http
> PUT /api/estudiantes/recuperarpassword
> ```
>
> π οΈ Endpoint for cheking token for password reset
>
> ```http
> GET /api/estudiantes/recuperarpassword/:token
> ```
>
> π οΈ Endpoint for new password
>
> ```http
> POST /api/estudiantes/nuevopassword/:token
> ```
>
> π οΈ Endpoint for updating profile
>
> ```http
> PUT /api/estudiantes/:id
> ```
>
> π οΈ Endpoint for updating password
>
> ```http
> PUT /api/estudiantes/actualizarpassword
> ```
>
> π οΈ Endpoint for getting student by ID
>
> ```http
> GET /api/estudiante/:id
> ```
>
> π οΈ Endpoint for getting all students
>
> ```http
> GET /api/estudiantes
> ```
>
> π οΈ Endpoint for getting student profile
>
> ```http
> GET /api/estudiantes/perfil
> ```
>
> π οΈ Endpoint for deleting student account
> ```http
> DELETE /api/estudiantes/:id
> ```---
π·οΈπ Sprint 3 - Products and Orders Module
β Endpoints to be Developeds
>
>Development in Express
>
>
>
>To create the backend endpoints, the MVC model is used, and the files that contain the sprint presentable are:
>
> [![Model](https://img.shields.io/badge/Order%20Model-000000.svg?logo=JavaScript)](/src/models/pedido.js)
> [![Controller](https://img.shields.io/badge/Order%20Controller-000000.svg?logo=JavaScript)](/src/controllers/pedido_controller.js)
> [![View](https://img.shields.io/badge/Order%20Routes-000000.svg?logo=JavaScript)](/src/routes/pedido.routes.js)
>
> [![Model](https://img.shields.io/badge/Product%20Model-000000.svg?logo=JavaScript)](/src/models/producto.js)
> [![Controller](https://img.shields.io/badge/Product%20Controller-000000.svg?logo=JavaScript)](/src/controllers/producto_controller.js)
> [![View](https://img.shields.io/badge/Product%20Routes-000000.svg?logo=JavaScript)](/src/routes/producto.routes.js)
>
> π οΈ Endpoint for order registration
>
> ```http
> POST /api/pedido/registro
> ```
>
> π οΈ Endpoints for getting order by id
>
> ```http
> GET /api/pedido/:id
> ```
>
> π οΈ Endpoint for getting all orders
>
> ```http
> GET /api/pedidos
> ```
>
> π οΈ Endpoint for getting all orders of authenticated student
>
> ```http
> GET /api/pedidos/estudiante
> ```
>
> π οΈ Endpoint for updating order state
>
> ```http
> PUT /api/pedido/:id
> ```
>
> π οΈ Endpoint for deleting order
>
> ```http
> DELETE /api/pedido/:id
> ```
>
> π οΈ Endpoint for creating product
>
> ```http
> POST /api/productos/registro
> ```
>
> π οΈ Endpoint for getting all products
>
> ```http
> GET /api/productos
> ```
>
> π οΈ Endpoint for getting product by id
>
> ```http
> GET /api/productos/:id
> ```
>
> π οΈ Endpoint for updating product
>
> ```http
> PUT /api/productos/:id
> ```
>
> π οΈ Endpoint for deleting product
> ```http
> DELETE /api/productos/:id
> ```---
π₯€π« Sprint 4 - Deploy and Documentation
βΆοΈ Deploy
>
>Deployment in Render
>
>
>
> π Render Deployment URL: https://food-ordering-api-restful.onrender.comβΆοΈ API Documentation
>
>Documentation in Swagger
>
>
>
> π API Documentation URL: https://app.swaggerhub.com/apis/ALANRIOSHD/api-res_tful_para_el_sistema_de_pedidos_de_comida_esfot/1.0.0