# pugazhendhidev/canteen-management architecture

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

- Interactive diagram: https://gitdiagram.com/pugazhendhidev/canteen-management
- Repository: https://github.com/pugazhendhidev/canteen-management

## Overview

This repository implements a food-ordering system with separate customer, administrator, and counter interfaces backed by an Express API. The main customer journey is account access, browsing food, managing a cart, placing orders, and reviewing order history; administrators maintain accounts and the food catalog, while counter staff retrieve orders and update delivery status. The tree and server route registrations document these capabilities, but most page and handler implementations were not sampled, so uncertain frontend-to-API links are omitted.

Main entry points: [`server/index.js`](https://github.com/pugazhendhidev/canteen-management/blob/main/server/index.js) (Express API), [`client/src/App.jsx`](https://github.com/pugazhendhidev/canteen-management/blob/main/client/src/App.jsx) (Customer app), [`admin/src/App.jsx`](https://github.com/pugazhendhidev/canteen-management/blob/main/admin/src/App.jsx) (Admin app), [`counter/src/App.jsx`](https://github.com/pugazhendhidev/canteen-management/blob/main/counter/src/App.jsx) (Counter app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_apps["User interfaces"]
  node_client_app["Customer app<br/>[App.jsx]"]
  node_client_pages["Shopping pages"]
  node_client_signup["Signup<br/>[signup.jsx]"]
  node_admin_app["Admin app<br/>[App.jsx]"]
  node_admin_pages["Admin pages"]
  node_admin_login["Admin login<br/>[login.jsx]"]
  node_counter_app["Counter app<br/>[App.jsx]"]
  node_counter_pages["Counter pages"]
end

subgraph group_api["API and access"]
  node_api_server["Express API<br/>[index.js]"]
  node_firebase_auth["Firebase Auth"]
  node_supabase[("Supabase")]
end

subgraph group_catalog["Catalog management"]
  node_food_routes["Food routes"]
  node_batch_routes["Batch list<br/>[getBatchList.js]"]
  node_food_realtime["Quantity updates<br/>[index.js]"]
end

subgraph group_orders["Orders and fulfillment"]
  node_order_routes["Order processing"]
end

subgraph group_accounts["Accounts"]
  node_account_routes["Account management"]
  node_admin_auth_routes["Admin authentication"]
  node_user_routes["User details and cart"]
  node_shop_auth["Shop authentication<br/>[shopLogin.js]"]
end

node_customer(("Customer"))
node_admin_actor(("Administrator"))
node_counter_actor(("Counter staff"))

node_customer -->|"uses"| node_client_app
node_admin_actor -->|"uses"| node_admin_app
node_counter_actor -->|"uses"| node_counter_app
node_client_app -->|"checks identity"| node_firebase_auth
node_admin_app -->|"checks identity"| node_firebase_auth
node_counter_app -->|"checks identity"| node_firebase_auth
node_client_signup -->|"creates account"| node_firebase_auth
node_client_signup -->|"posts user details"| node_api_server
node_admin_login -->|"signs in"| node_firebase_auth
node_admin_login -->|"posts login"| node_api_server
node_client_app -->|"routes to"| node_client_pages
node_admin_app -->|"routes to"| node_admin_pages
node_counter_app -->|"routes to"| node_counter_pages
node_api_server -->|"dispatches"| node_food_routes
node_api_server -->|"dispatches"| node_batch_routes
node_api_server -->|"dispatches"| node_account_routes
node_api_server -->|"dispatches"| node_admin_auth_routes
node_api_server -->|"dispatches"| node_user_routes
node_api_server -->|"dispatches"| node_shop_auth
node_api_server -->|"dispatches"| node_order_routes
node_food_routes -->|"uses"| node_supabase
node_batch_routes -->|"uses"| node_supabase
node_account_routes -->|"uses"| node_supabase
node_admin_auth_routes -->|"uses"| node_supabase
node_user_routes -->|"uses"| node_supabase
node_shop_auth -->|"uses"| node_supabase
node_order_routes -->|"uses"| node_supabase

click node_client_app "https://github.com/pugazhendhidev/canteen-management/blob/main/client/src/App.jsx"
click node_client_pages "https://github.com/pugazhendhidev/canteen-management/tree/main/client/src/pages"
click node_client_signup "https://github.com/pugazhendhidev/canteen-management/blob/main/client/src/auth/signup.jsx"
click node_admin_app "https://github.com/pugazhendhidev/canteen-management/blob/main/admin/src/App.jsx"
click node_admin_pages "https://github.com/pugazhendhidev/canteen-management/tree/main/admin/src/pages"
click node_admin_login "https://github.com/pugazhendhidev/canteen-management/blob/main/admin/src/auth/login.jsx"
click node_counter_app "https://github.com/pugazhendhidev/canteen-management/blob/main/counter/src/App.jsx"
click node_counter_pages "https://github.com/pugazhendhidev/canteen-management/tree/main/counter/src/pages"
click node_api_server "https://github.com/pugazhendhidev/canteen-management/blob/main/server/index.js"
click node_food_routes "https://github.com/pugazhendhidev/canteen-management/tree/main/server/routes/food"
click node_batch_routes "https://github.com/pugazhendhidev/canteen-management/blob/main/server/routes/batchList/getBatchList.js"
click node_food_realtime "https://github.com/pugazhendhidev/canteen-management/blob/main/server/index.js"
click node_account_routes "https://github.com/pugazhendhidev/canteen-management/tree/main/server/routes/accountManagement"
click node_admin_auth_routes "https://github.com/pugazhendhidev/canteen-management/tree/main/server/routes/adminAuth"
click node_user_routes "https://github.com/pugazhendhidev/canteen-management/tree/main/server/routes/userDetails"
click node_shop_auth "https://github.com/pugazhendhidev/canteen-management/blob/main/server/routes/shopAuth/shopLogin.js"
click node_order_routes "https://github.com/pugazhendhidev/canteen-management/tree/main/server/routes/orders"

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_client_app,node_client_pages,node_client_signup,node_admin_app,node_admin_pages,node_admin_login,node_counter_app,node_counter_pages toneBlue
class node_api_server,node_firebase_auth,node_supabase toneAmber
class node_food_routes,node_batch_routes,node_food_realtime toneMint
class node_order_routes toneRose
class node_account_routes,node_admin_auth_routes,node_user_routes,node_shop_auth,node_customer,node_admin_actor,node_counter_actor toneIndigo
```

## Components

### User interfaces

- [Customer app](https://github.com/pugazhendhidev/canteen-management/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Shopping pages](https://github.com/pugazhendhidev/canteen-management/tree/main/client/src/pages): `client/src/pages`
- [Signup](https://github.com/pugazhendhidev/canteen-management/blob/main/client/src/auth/signup.jsx): `client/src/auth/signup.jsx`
- [Admin app](https://github.com/pugazhendhidev/canteen-management/blob/main/admin/src/App.jsx): `admin/src/App.jsx`
- [Admin pages](https://github.com/pugazhendhidev/canteen-management/tree/main/admin/src/pages): `admin/src/pages`
- [Admin login](https://github.com/pugazhendhidev/canteen-management/blob/main/admin/src/auth/login.jsx): `admin/src/auth/login.jsx`
- [Counter app](https://github.com/pugazhendhidev/canteen-management/blob/main/counter/src/App.jsx): `counter/src/App.jsx`
- [Counter pages](https://github.com/pugazhendhidev/canteen-management/tree/main/counter/src/pages): `counter/src/pages`

### API and access

- [Express API](https://github.com/pugazhendhidev/canteen-management/blob/main/server/index.js): `server/index.js`
- **Firebase Auth**
- **Supabase**

### Catalog management

- [Food routes](https://github.com/pugazhendhidev/canteen-management/tree/main/server/routes/food): `server/routes/food`
- [Batch list](https://github.com/pugazhendhidev/canteen-management/blob/main/server/routes/batchList/getBatchList.js): `server/routes/batchList/getBatchList.js`
- [Quantity updates](https://github.com/pugazhendhidev/canteen-management/blob/main/server/index.js): `server/index.js`

### Orders and fulfillment

- [Order processing](https://github.com/pugazhendhidev/canteen-management/tree/main/server/routes/orders): `server/routes/orders`

### Accounts

- [Account management](https://github.com/pugazhendhidev/canteen-management/tree/main/server/routes/accountManagement): `server/routes/accountManagement`
- [Admin authentication](https://github.com/pugazhendhidev/canteen-management/tree/main/server/routes/adminAuth): `server/routes/adminAuth`
- [User details and cart](https://github.com/pugazhendhidev/canteen-management/tree/main/server/routes/userDetails): `server/routes/userDetails`
- [Shop authentication](https://github.com/pugazhendhidev/canteen-management/blob/main/server/routes/shopAuth/shopLogin.js): `server/routes/shopAuth/shopLogin.js`

### Other components

- **Customer**
- **Administrator**
- **Counter staff**

## Connections

- Customer → Customer app: uses
- Administrator → Admin app: uses
- Counter staff → Counter app: uses
- Customer app → Firebase Auth: checks identity
- Admin app → Firebase Auth: checks identity
- Counter app → Firebase Auth: checks identity
- Signup → Firebase Auth: creates account
- Signup → Express API: posts user details
- Admin login → Firebase Auth: signs in
- Admin login → Express API: posts login
- Customer app → Shopping pages: routes to
- Admin app → Admin pages: routes to
- Counter app → Counter pages: routes to
- Express API → Food routes: dispatches
- Express API → Batch list: dispatches
- Express API → Account management: dispatches
- Express API → Admin authentication: dispatches
- Express API → User details and cart: dispatches
- Express API → Shop authentication: dispatches
- Express API → Order processing: dispatches
- Food routes → Supabase: uses
- Batch list → Supabase: uses
- Account management → Supabase: uses
- Admin authentication → Supabase: uses
- User details and cart → Supabase: uses
- Shop authentication → Supabase: uses
- Order processing → Supabase: uses
