# shingadesuraj59/easyserve-canteen-preorder-app architecture

> Architecture diagram of the GitHub repository shingadesuraj59/easyserve-canteen-preorder-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shingadesuraj59/easyserve-canteen-preorder-app
- Repository: https://github.com/shingadesuraj59/easyserve-canteen-preorder-app

## Overview

EasyServe is a canteen preorder product with separate student-facing and canteen-admin React applications backed by an Express API. Students browse canteens and food, manage a cart, submit an order with a pickup time, pay through Stripe, and view orders; canteen staff authenticate, manage food listings, and update order status. The excerpts show client API calls, server route mounting, and several controller-to-model operations. Route-to-controller wiring and some documented capabilities are not visible in the sampled source, so uncertain links are omitted or dashed.

Main entry points: [`Frontend/src/App.jsx`](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Frontend/src/App.jsx) (Customer app), [`Backend/index.js`](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/index.js) (API server), [`Backend/src/controllers/orderController.js`](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/controllers/orderController.js) (Order and payment), [`Admin/src/App.jsx`](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Admin/src/App.jsx) (Admin dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Student ordering"]
  node_customer_app["Customer app<br/>[App.jsx]"]
  node_catalog_ui["Canteen and menu<br/>[DisplayCanteen.jsx]"]
  node_recommendations["Recommendations"]
  node_cart_ui["Cart<br/>[Cart.jsx]"]
  node_checkout_ui["Place order<br/>[PlaceOrder.jsx]"]
  node_orders_ui["Order tracking<br/>[MyOrders.jsx]"]
  node_customer_state["Customer state<br/>[StoreContext.jsx]"]
end

subgraph group_admin["Canteen administration"]
  node_canteen_admin["Admin dashboard<br/>[App.jsx]"]
  node_admin_login["Admin sign-in<br/>[Login.jsx]"]
  node_admin_state["Admin state<br/>[StoreContext.jsx]"]
  node_food_management["Food management<br/>[Add.jsx]"]
  node_admin_orders["Order management<br/>[Order.jsx]"]
end

subgraph group_api["Backend API"]
  node_server["API server<br/>[index.js]"]
  node_user_controller["User accounts<br/>[userController.js]"]
  node_canteen_controller["Canteen accounts"]
  node_food_controller["Food catalog<br/>[foodController.js]"]
  node_cart_controller["Cart operations<br/>[cartController.js]"]
  node_order_controller["Order and payment<br/>[orderController.js]"]
end

subgraph group_integrations["Persistence and services"]
  node_food_store[("Food records<br/>[foodModel.js]")]
  node_user_store[("User records<br/>[userModel.js]")]
  node_canteen_store[("Canteen records<br/>[canteenModel.js]")]
  node_order_store[("Order records<br/>[orderModel.js]")]
  node_stripe["Stripe checkout"]
  node_cloudinary["Cloudinary images"]
end

node_student(("Student"))

node_student -->|"uses"| node_customer_app
node_customer_app -->|"routes to"| node_catalog_ui
node_customer_app -->|"routes to"| node_cart_ui
node_customer_app -->|"routes to"| node_checkout_ui
node_customer_app -->|"routes to"| node_orders_ui
node_catalog_ui -->|"reads state"| node_customer_state
node_recommendations -->|"reads state"| node_customer_state
node_customer_app -.->|"renders"| node_recommendations
node_customer_app -->|"provides state"| node_customer_state
node_customer_state -.->|"requests API"| node_server
node_canteen_admin -->|"renders"| node_admin_login
node_canteen_admin -->|"routes to"| node_food_management
node_canteen_admin -->|"routes to"| node_admin_orders
node_admin_login -->|"updates state"| node_admin_state
node_food_management -->|"reads state"| node_admin_state
node_canteen_admin -.->|"provides state"| node_admin_state
node_admin_state -.->|"requests API"| node_server
node_server -->|"mounts food routes"| node_food_controller
node_server -->|"mounts user routes"| node_user_controller
node_server -->|"mounts cart routes"| node_cart_controller
node_server -->|"mounts order routes"| node_order_controller
node_server -->|"mounts canteen routes"| node_canteen_controller
node_food_controller -->|"reads and writes"| node_food_store
node_food_controller -->|"uploads images"| node_cloudinary
node_cart_controller -->|"reads and writes"| node_user_store
node_order_controller -->|"creates and updates"| node_order_store
node_order_controller -->|"updates cart"| node_user_store
node_order_controller -->|"creates checkout"| node_stripe
node_canteen_controller -->|"reads and writes"| node_canteen_store
node_user_controller -->|"uses records"| node_user_store
node_admin_orders -.->|"updates status"| node_order_controller
node_student -->|"preorders"| node_customer_app

click node_customer_app "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Frontend/src/App.jsx"
click node_catalog_ui "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Frontend/src/Components/DisplayCanteen/DisplayCanteen.jsx"
click node_recommendations "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Frontend/src/Components/Recommendations/Recommendations.jsx"
click node_cart_ui "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Frontend/src/Pages/Cart/Cart.jsx"
click node_checkout_ui "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Frontend/src/Pages/PlaceOrder/PlaceOrder.jsx"
click node_orders_ui "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Frontend/src/Pages/MyOrders/MyOrders.jsx"
click node_customer_state "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Frontend/src/Context/StoreContext.jsx"
click node_canteen_admin "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Admin/src/App.jsx"
click node_admin_login "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Admin/src/components/Login/Login.jsx"
click node_admin_state "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Admin/src/context/StoreContext.jsx"
click node_food_management "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Admin/src/pages/Add/Add.jsx"
click node_admin_orders "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Admin/src/pages/Order/Order.jsx"
click node_server "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/index.js"
click node_user_controller "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/controllers/userController.js"
click node_canteen_controller "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/controllers/canteenController.js"
click node_food_controller "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/controllers/foodController.js"
click node_cart_controller "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/controllers/cartController.js"
click node_order_controller "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/controllers/orderController.js"
click node_food_store "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/models/foodModel.js"
click node_user_store "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/models/userModel.js"
click node_canteen_store "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/models/canteenModel.js"
click node_order_store "https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/models/orderModel.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_customer_app,node_catalog_ui,node_recommendations,node_cart_ui,node_checkout_ui,node_orders_ui,node_customer_state toneBlue
class node_canteen_admin,node_admin_login,node_admin_state,node_food_management,node_admin_orders toneAmber
class node_server,node_user_controller,node_canteen_controller,node_food_controller,node_cart_controller,node_order_controller toneMint
class node_food_store,node_user_store,node_canteen_store,node_order_store,node_stripe,node_cloudinary toneRose
class node_student toneIndigo
```

## Components

### Student ordering

- [Customer app](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [Canteen and menu](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Frontend/src/Components/DisplayCanteen/DisplayCanteen.jsx): `Frontend/src/Components/DisplayCanteen/DisplayCanteen.jsx`
- [Recommendations](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Frontend/src/Components/Recommendations/Recommendations.jsx): `Frontend/src/Components/Recommendations/Recommendations.jsx`
- [Cart](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Frontend/src/Pages/Cart/Cart.jsx): `Frontend/src/Pages/Cart/Cart.jsx`
- [Place order](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Frontend/src/Pages/PlaceOrder/PlaceOrder.jsx): `Frontend/src/Pages/PlaceOrder/PlaceOrder.jsx`
- [Order tracking](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Frontend/src/Pages/MyOrders/MyOrders.jsx): `Frontend/src/Pages/MyOrders/MyOrders.jsx`
- [Customer state](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Frontend/src/Context/StoreContext.jsx): `Frontend/src/Context/StoreContext.jsx`

### Canteen administration

- [Admin dashboard](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Admin/src/App.jsx): `Admin/src/App.jsx`
- [Admin sign-in](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Admin/src/components/Login/Login.jsx): `Admin/src/components/Login/Login.jsx`
- [Admin state](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Admin/src/context/StoreContext.jsx): `Admin/src/context/StoreContext.jsx`
- [Food management](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Admin/src/pages/Add/Add.jsx): `Admin/src/pages/Add/Add.jsx`
- [Order management](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Admin/src/pages/Order/Order.jsx): `Admin/src/pages/Order/Order.jsx`

### Backend API

- [API server](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/index.js): `Backend/index.js`
- [User accounts](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/controllers/userController.js): `Backend/src/controllers/userController.js`
- [Canteen accounts](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/controllers/canteenController.js): `Backend/src/controllers/canteenController.js`
- [Food catalog](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/controllers/foodController.js): `Backend/src/controllers/foodController.js`
- [Cart operations](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/controllers/cartController.js): `Backend/src/controllers/cartController.js`
- [Order and payment](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/controllers/orderController.js): `Backend/src/controllers/orderController.js`

### Persistence and services

- [Food records](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/models/foodModel.js): `Backend/src/models/foodModel.js`
- [User records](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/models/userModel.js): `Backend/src/models/userModel.js`
- [Canteen records](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/models/canteenModel.js): `Backend/src/models/canteenModel.js`
- [Order records](https://github.com/shingadesuraj59/easyserve-canteen-preorder-app/blob/main/Backend/src/models/orderModel.js): `Backend/src/models/orderModel.js`
- **Stripe checkout**
- **Cloudinary images**

### Other components

- **Student**

## Connections

- Student → Customer app: uses
- Customer app → Canteen and menu: routes to (evidence: `Frontend/src/App.jsx`)
- Customer app → Cart: routes to (evidence: `Frontend/src/App.jsx`)
- Customer app → Place order: routes to (evidence: `Frontend/src/App.jsx`)
- Customer app → Order tracking: routes to (evidence: `Frontend/src/App.jsx`)
- Canteen and menu → Customer state: reads state (evidence: `Frontend/src/Components/DisplayCanteen/DisplayCanteen.jsx`)
- Recommendations → Customer state: reads state (evidence: `Frontend/src/Components/Recommendations/Recommendations.jsx`)
- Customer app → Recommendations: renders
- Customer app → Customer state: provides state (evidence: `Frontend/src/main.jsx`)
- Customer state → API server: requests API
- Admin dashboard → Admin sign-in: renders (evidence: `Admin/src/App.jsx`)
- Admin dashboard → Food management: routes to (evidence: `Admin/src/App.jsx`)
- Admin dashboard → Order management: routes to (evidence: `Admin/src/App.jsx`)
- Admin sign-in → Admin state: updates state (evidence: `Admin/src/components/Login/Login.jsx`)
- Food management → Admin state: reads state (evidence: `Admin/src/pages/Add/Add.jsx`)
- Admin dashboard → Admin state: provides state
- Admin state → API server: requests API
- API server → Food catalog: mounts food routes (evidence: `Backend/index.js`)
- API server → User accounts: mounts user routes (evidence: `Backend/index.js`)
- API server → Cart operations: mounts cart routes (evidence: `Backend/index.js`)
- API server → Order and payment: mounts order routes (evidence: `Backend/index.js`)
- API server → Canteen accounts: mounts canteen routes (evidence: `Backend/index.js`)
- Food catalog → Food records: reads and writes (evidence: `Backend/src/controllers/foodController.js`)
- Food catalog → Cloudinary images: uploads images (evidence: `Backend/src/controllers/foodController.js`)
- Cart operations → User records: reads and writes (evidence: `Backend/src/controllers/cartController.js`)
- Order and payment → Order records: creates and updates (evidence: `Backend/src/controllers/orderController.js`)
- Order and payment → User records: updates cart (evidence: `Backend/src/controllers/orderController.js`)
- Order and payment → Stripe checkout: creates checkout (evidence: `Backend/src/controllers/orderController.js`)
- Canteen accounts → Canteen records: reads and writes (evidence: `Backend/src/controllers/canteenController.js`)
- User accounts → User records: uses records (evidence: `Backend/src/controllers/userController.js`)
- Order management → Order and payment: updates status
- Student → Customer app: preorders
