Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        


Logo
$\color{Apricot}{Food\ Ordering\ at\ ESFOT\ API\ RESTful}$
Logo

---

> [!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