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 render restful-api
Last synced: 5 months 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 (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-01-12T20:35:41.000Z (over 1 year ago)
- Last Synced: 2025-04-11T01:51:38.226Z (about 1 year ago)
- Topics: backend, expressjs, mongoose, render, restful-api
- Language: JavaScript
- Homepage: https://food-ordering-api-restful.onrender.com/
- Size: 303 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 |
> |--------------------------------------------------------------|----------------------------|
> |  | Visual Studio Code |
> |  | MongoDB Atlas y Compass |
> |  | Node.js |
> |  | 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:
>
> 
β
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:
>
> [](/src/models/chef.js)
> [](/src/controllers/chef_controller.js)
> [](/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:
>
> [](/src/models/estudiante.js)
> [](/src/controllers/estudiante_controller.js)
> [](/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:
>
> [](/src/models/pedido.js)
> [](/src/controllers/pedido_controller.js)
> [](/src/routes/pedido.routes.js)
>
> [](/src/models/producto.js)
> [](/src/controllers/producto_controller.js)
> [](/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