# heyshiivam556/mess-management-system architecture

> Architecture diagram of the GitHub repository heyshiivam556/mess-management-system, 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/heyshiivam556/mess-management-system
- Repository: https://github.com/heyshiivam556/mess-management-system

## Overview

This is a role-based mess-management web app. Users sign in and enter student, worker, committee, or super-admin panels; students view routines and request opt-outs, while workers validate meal-entry QR codes and committee staff manage menus and operations. Firebase provides authentication and persistent, live-updating records. The tree and excerpts support the main role and opt-out paths; several page capabilities are represented by their filenames, but their internal wiring was not sampled.

Main entry points: [`src/lib/firestoreService.js`](https://github.com/heyshiivam556/mess-management-system/blob/main/src/lib/firestoreService.js) (Firestore services), [`src/context/AuthContext.jsx`](https://github.com/heyshiivam556/mess-management-system/blob/main/src/context/AuthContext.jsx) (Auth context), [`src/App.jsx`](https://github.com/heyshiivam556/mess-management-system/blob/main/src/App.jsx) (App routing), [`src/lib/firebase.js`](https://github.com/heyshiivam556/mess-management-system/blob/main/src/lib/firebase.js) (Firebase setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_app["App routing<br/>[App.jsx]"]
  node_authui["Login<br/>[Login.jsx]"]
  node_authctx["Auth context<br/>[AuthContext.jsx]"]
  node_protected["Role guards<br/>[ProtectedRoute.jsx]"]
  node_service["Firestore services"]
  node_firebase["Firebase setup<br/>[firebase.js]"]
end

subgraph group_student["Student services"]
  node_studentroutine["Routine and profile<br/>[Routine.jsx]"]
  node_studentoptout["Opt-out requests<br/>[OptOut.jsx]"]
  node_token["Meal token<br/>[TokenOverlay.jsx]"]
  node_history["Wallet history<br/>[WalletHistory.jsx]"]
  node_studentfeedback["Student feedback<br/>[Feedback.jsx]"]
end

subgraph group_mealops["Meal operations"]
  node_worker["Entry terminal<br/>[Terminal.jsx]"]
  node_committee["Committee console<br/>[Dashboard.jsx]"]
  node_menu["Menu manager<br/>[MenuManager.jsx]"]
  node_ledger["Ledger<br/>[Ledger.jsx]"]
  node_students["Student management<br/>[Students.jsx]"]
  node_announcements["Announcements<br/>[Announcements.jsx]"]
  node_feedbackadmin["Feedback review"]
end

subgraph group_governance["Administration"]
  node_superadmin["Super-admin console<br/>[Dashboard.jsx]"]
  node_committeeadmin["Committee assignment<br/>[Committee.jsx]"]
  node_workersadmin["Worker assignment<br/>[Workers.jsx]"]
  node_succession["Succession<br/>[Succession.jsx]"]
end

node_user(("User"))
node_firebaseauth["Firebase Auth"]
node_firestore[("Firestore")]

node_user -->|"opens"| node_app
node_app -->|"reads auth state"| node_authctx
node_app -->|"guards routes"| node_protected
node_app -->|"routes to"| node_authui
node_authui -->|"signs in"| node_authctx
node_authctx -->|"authenticates"| node_firebaseauth
node_authctx -->|"loads profile"| node_service
node_authctx -->|"updates session"| node_firestore
node_studentoptout -->|"submits request"| node_service
node_token -->|"listens for opt-out"| node_service
node_worker -->|"checks entry"| node_service
node_worker -->|"logs denied scan"| node_service
node_menu -->|"saves menu"| node_service
node_workersadmin -->|"changes user role"| node_service
node_committee -->|"loads operations data"| node_service
node_students -->|"manages students"| node_service
node_ledger -->|"reads ledger data"| node_service
node_announcements -->|"manages announcements"| node_service
node_feedbackadmin -->|"reviews feedback"| node_service
node_studentroutine -->|"loads routine"| node_service
node_history -->|"loads history"| node_service
node_studentfeedback -->|"sends feedback"| node_service
node_committeeadmin -->|"manages committee"| node_service
node_succession -->|"manages succession"| node_service
node_superadmin -->|"loads admin data"| node_service
node_service -->|"reads and writes"| node_firestore
node_firebase -->|"configures"| node_firebaseauth
node_firebase -->|"configures"| node_firestore

click node_app "https://github.com/heyshiivam556/mess-management-system/blob/main/src/App.jsx"
click node_authui "https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/auth/Login.jsx"
click node_authctx "https://github.com/heyshiivam556/mess-management-system/blob/main/src/context/AuthContext.jsx"
click node_protected "https://github.com/heyshiivam556/mess-management-system/blob/main/src/components/ProtectedRoute.jsx"
click node_studentroutine "https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/student/Routine.jsx"
click node_studentoptout "https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/student/OptOut.jsx"
click node_token "https://github.com/heyshiivam556/mess-management-system/blob/main/src/components/TokenOverlay.jsx"
click node_history "https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/student/WalletHistory.jsx"
click node_studentfeedback "https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/student/Feedback.jsx"
click node_worker "https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/worker/Terminal.jsx"
click node_committee "https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/committee/Dashboard.jsx"
click node_menu "https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/committee/MenuManager.jsx"
click node_ledger "https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/committee/Ledger.jsx"
click node_students "https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/committee/Students.jsx"
click node_announcements "https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/committee/Announcements.jsx"
click node_superadmin "https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/superadmin/Dashboard.jsx"
click node_committeeadmin "https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/superadmin/Committee.jsx"
click node_workersadmin "https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/superadmin/Workers.jsx"
click node_succession "https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/superadmin/Succession.jsx"
click node_service "https://github.com/heyshiivam556/mess-management-system/blob/main/src/lib/firestoreService.js"
click node_firebase "https://github.com/heyshiivam556/mess-management-system/blob/main/src/lib/firebase.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_app,node_authui,node_authctx,node_protected,node_service,node_firebase,node_user toneBlue
class node_studentroutine,node_studentoptout,node_token,node_history,node_studentfeedback,node_firestore toneAmber
class node_worker,node_committee,node_menu,node_ledger,node_students,node_announcements,node_feedbackadmin toneMint
class node_superadmin,node_committeeadmin,node_workersadmin,node_succession toneRose
class node_firebaseauth toneIndigo
```

## Components

### Access and navigation

- [App routing](https://github.com/heyshiivam556/mess-management-system/blob/main/src/App.jsx): `src/App.jsx`
- [Login](https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/auth/Login.jsx): `src/pages/auth/Login.jsx`
- [Auth context](https://github.com/heyshiivam556/mess-management-system/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Role guards](https://github.com/heyshiivam556/mess-management-system/blob/main/src/components/ProtectedRoute.jsx): `src/components/ProtectedRoute.jsx`
- [Firestore services](https://github.com/heyshiivam556/mess-management-system/blob/main/src/lib/firestoreService.js): `src/lib/firestoreService.js`
- [Firebase setup](https://github.com/heyshiivam556/mess-management-system/blob/main/src/lib/firebase.js): `src/lib/firebase.js`

### Student services

- [Routine and profile](https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/student/Routine.jsx): `src/pages/student/Routine.jsx`
- [Opt-out requests](https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/student/OptOut.jsx): `src/pages/student/OptOut.jsx`
- [Meal token](https://github.com/heyshiivam556/mess-management-system/blob/main/src/components/TokenOverlay.jsx): `src/components/TokenOverlay.jsx`
- [Wallet history](https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/student/WalletHistory.jsx): `src/pages/student/WalletHistory.jsx`
- [Student feedback](https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/student/Feedback.jsx): `src/pages/student/Feedback.jsx`

### Meal operations

- [Entry terminal](https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/worker/Terminal.jsx): `src/pages/worker/Terminal.jsx`
- [Committee console](https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/committee/Dashboard.jsx): `src/pages/committee/Dashboard.jsx`
- [Menu manager](https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/committee/MenuManager.jsx): `src/pages/committee/MenuManager.jsx`
- [Ledger](https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/committee/Ledger.jsx): `src/pages/committee/Ledger.jsx`
- [Student management](https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/committee/Students.jsx): `src/pages/committee/Students.jsx`
- [Announcements](https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/committee/Announcements.jsx): `src/pages/committee/Announcements.jsx`
- **Feedback review**

### Administration

- [Super-admin console](https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/superadmin/Dashboard.jsx): `src/pages/superadmin/Dashboard.jsx`
- [Committee assignment](https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/superadmin/Committee.jsx): `src/pages/superadmin/Committee.jsx`
- [Worker assignment](https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/superadmin/Workers.jsx): `src/pages/superadmin/Workers.jsx`
- [Succession](https://github.com/heyshiivam556/mess-management-system/blob/main/src/pages/superadmin/Succession.jsx): `src/pages/superadmin/Succession.jsx`

### Other components

- **User**
- **Firebase Auth**
- **Firestore**

## Connections

- User → App routing: opens
- App routing → Auth context: reads auth state
- App routing → Role guards: guards routes
- App routing → Login: routes to
- Login → Auth context: signs in
- Auth context → Firebase Auth: authenticates
- Auth context → Firestore services: loads profile
- Auth context → Firestore: updates session
- Opt-out requests → Firestore services: submits request
- Meal token → Firestore services: listens for opt-out
- Entry terminal → Firestore services: checks entry
- Entry terminal → Firestore services: logs denied scan
- Menu manager → Firestore services: saves menu
- Worker assignment → Firestore services: changes user role
- Committee console → Firestore services: loads operations data
- Student management → Firestore services: manages students
- Ledger → Firestore services: reads ledger data
- Announcements → Firestore services: manages announcements
- Feedback review → Firestore services: reviews feedback
- Routine and profile → Firestore services: loads routine
- Wallet history → Firestore services: loads history
- Student feedback → Firestore services: sends feedback
- Committee assignment → Firestore services: manages committee
- Succession → Firestore services: manages succession
- Super-admin console → Firestore services: loads admin data
- Firestore services → Firestore: reads and writes
- Firebase setup → Firebase Auth: configures
- Firebase setup → Firestore: configures
