# shivaay100/college-dispensary-management-system architecture

> Architecture diagram of the GitHub repository shivaay100/college-dispensary-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/shivaay100/college-dispensary-management-system
- Repository: https://github.com/shivaay100/college-dispensary-management-system

## Overview

College Dispensary Management System serves public visitors, students, and dispensary staff through a React application and Express API backed by MongoDB. Visitors browse dispensary information; students register or log in and view their medical history; staff manage student records, medical visits, medicine stock, staff, facilities, nearby hospitals, gallery content, and event notifications. The backend route/controller layers connect those workflows to Mongoose models, with authentication protecting selected staff operations. The README documents these capabilities, but most individual controllers and page implementations were not sampled, so their detailed call wiring is not inferred.

Main entry points: [`frontendDispensary/src/App.jsx`](https://github.com/shivaay100/college-dispensary-management-system/blob/main/frontendDispensary/src/App.jsx) (Application routing), [`backend/Routes/user.js`](https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Routes/user.js) (User API routes), [`backend/index.js`](https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/index.js) (Express API entry), [`frontendDispensary/src/pages/Admin`](https://github.com/shivaay100/college-dispensary-management-system/tree/main/frontendDispensary/src/pages/Admin) (Staff workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["Application routing<br/>[App.jsx]"]
  node_login["Login and registration<br/>[login.jsx]"]
  node_home["Public information<br/>[home.jsx]"]
  node_studentview["Student dashboard"]
  node_adminview["Staff workspace"]
  node_stockview["Stock view<br/>[stock.jsx]"]
  node_header["Events and logout<br/>[header.jsx]"]
end

subgraph group_api["API and domain"]
  node_api["Express API entry<br/>[index.js]"]
  node_useroutes["User API routes<br/>[user.js]"]
  node_historyroutes["History routes<br/>[history.js]"]
  node_medroutes["Medicine routes<br/>[medicine.js]"]
  node_contentroutes["Dispensary content routes"]
  node_usersvc["Accounts and staff logic<br/>[user.js]"]
  node_historysvc["Medical history logic<br/>[history.js]"]
  node_medsvc["Medicine inventory logic<br/>[medicine.js]"]
  node_contentsvc["Facilities and public content"]
end

subgraph group_data["Persistence and identity"]
  node_auth["JWT authorization<br/>[auth.js]"]
  node_userdb[("User records<br/>[user.js]")]
  node_historydb[("History records<br/>[history.js]")]
  node_meddb[("Medicine records<br/>[medicine.js]")]
  node_contentdb[("Dispensary content records")]
end

node_visitor(("Visitor"))
node_student(("Student"))
node_staff(("Admin / staff"))
node_mongo[("MongoDB")]
node_email["Email service"]

node_visitor -->|"opens"| node_app
node_student -->|"uses"| node_app
node_staff -->|"uses"| node_app
node_app -->|"renders"| node_home
node_app -->|"routes"| node_login
node_app -->|"routes"| node_studentview
node_app -->|"routes"| node_adminview
node_app -->|"routes"| node_stockview
node_login -->|"HTTP requests"| node_useroutes
node_studentview -->|"fetches history"| node_historyroutes
node_adminview -->|"manages users"| node_useroutes
node_adminview -->|"manages records"| node_historyroutes
node_adminview -->|"manages stock"| node_medroutes
node_stockview -->|"fetches stock"| node_medroutes
node_home -->|"loads public content"| node_contentroutes
node_header -->|"fetches events"| node_contentroutes
node_api -->|"mounts"| node_useroutes
node_api -->|"mounts"| node_historyroutes
node_api -->|"mounts"| node_medroutes
node_api -->|"mounts"| node_contentroutes
node_useroutes -->|"dispatches"| node_usersvc
node_historyroutes -->|"dispatches"| node_historysvc
node_medroutes -->|"dispatches"| node_medsvc
node_contentroutes -->|"dispatches"| node_contentsvc
node_useroutes -->|"protects selected routes"| node_auth
node_usersvc -->|"reads and writes"| node_userdb
node_historysvc -->|"reads and writes"| node_historydb
node_medsvc -->|"reads and writes"| node_meddb
node_contentsvc -->|"reads and writes"| node_contentdb
node_auth -->|"loads account"| node_userdb
node_userdb -->|"persists"| node_mongo
node_historydb -->|"persists"| node_mongo
node_meddb -->|"persists"| node_mongo
node_contentdb -->|"persists"| node_mongo
node_usersvc -.->|"sends account mail"| node_email

click node_app "https://github.com/shivaay100/college-dispensary-management-system/blob/main/frontendDispensary/src/App.jsx"
click node_login "https://github.com/shivaay100/college-dispensary-management-system/blob/main/frontendDispensary/src/pages/Login/login.jsx"
click node_home "https://github.com/shivaay100/college-dispensary-management-system/blob/main/frontendDispensary/src/pages/Home/home.jsx"
click node_studentview "https://github.com/shivaay100/college-dispensary-management-system/blob/main/frontendDispensary/src/pages/Student/studentDashboard.jsx"
click node_adminview "https://github.com/shivaay100/college-dispensary-management-system/tree/main/frontendDispensary/src/pages/Admin"
click node_stockview "https://github.com/shivaay100/college-dispensary-management-system/blob/main/frontendDispensary/src/pages/Stock/stock.jsx"
click node_header "https://github.com/shivaay100/college-dispensary-management-system/blob/main/frontendDispensary/src/components/Header/header.jsx"
click node_api "https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/index.js"
click node_useroutes "https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Routes/user.js"
click node_historyroutes "https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Routes/history.js"
click node_medroutes "https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Routes/medicine.js"
click node_contentroutes "https://github.com/shivaay100/college-dispensary-management-system/tree/main/backend/Routes"
click node_usersvc "https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Controllers/user.js"
click node_historysvc "https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Controllers/history.js"
click node_medsvc "https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Controllers/medicine.js"
click node_contentsvc "https://github.com/shivaay100/college-dispensary-management-system/tree/main/backend/Controllers"
click node_auth "https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Authentication/auth.js"
click node_userdb "https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Models/user.js"
click node_historydb "https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Models/history.js"
click node_meddb "https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Models/medicine.js"
click node_contentdb "https://github.com/shivaay100/college-dispensary-management-system/tree/main/backend/Models"

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_login,node_home,node_studentview,node_adminview,node_stockview,node_header toneBlue
class node_api,node_useroutes,node_historyroutes,node_medroutes,node_contentroutes,node_usersvc,node_historysvc,node_medsvc,node_contentsvc,node_mongo toneAmber
class node_auth,node_userdb,node_historydb,node_meddb,node_contentdb toneMint
class node_visitor,node_student,node_staff,node_email toneIndigo
```

## Components

### Web application

- [Application routing](https://github.com/shivaay100/college-dispensary-management-system/blob/main/frontendDispensary/src/App.jsx): `frontendDispensary/src/App.jsx`
- [Login and registration](https://github.com/shivaay100/college-dispensary-management-system/blob/main/frontendDispensary/src/pages/Login/login.jsx): `frontendDispensary/src/pages/Login/login.jsx`
- [Public information](https://github.com/shivaay100/college-dispensary-management-system/blob/main/frontendDispensary/src/pages/Home/home.jsx): `frontendDispensary/src/pages/Home/home.jsx`
- [Student dashboard](https://github.com/shivaay100/college-dispensary-management-system/blob/main/frontendDispensary/src/pages/Student/studentDashboard.jsx): `frontendDispensary/src/pages/Student/studentDashboard.jsx`
- [Staff workspace](https://github.com/shivaay100/college-dispensary-management-system/tree/main/frontendDispensary/src/pages/Admin): `frontendDispensary/src/pages/Admin`
- [Stock view](https://github.com/shivaay100/college-dispensary-management-system/blob/main/frontendDispensary/src/pages/Stock/stock.jsx): `frontendDispensary/src/pages/Stock/stock.jsx`
- [Events and logout](https://github.com/shivaay100/college-dispensary-management-system/blob/main/frontendDispensary/src/components/Header/header.jsx): `frontendDispensary/src/components/Header/header.jsx`

### API and domain

- [Express API entry](https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/index.js): `backend/index.js`
- [User API routes](https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Routes/user.js): `backend/Routes/user.js`
- [History routes](https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Routes/history.js): `backend/Routes/history.js`
- [Medicine routes](https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Routes/medicine.js): `backend/Routes/medicine.js`
- [Dispensary content routes](https://github.com/shivaay100/college-dispensary-management-system/tree/main/backend/Routes): `backend/Routes`
- [Accounts and staff logic](https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Controllers/user.js): `backend/Controllers/user.js`
- [Medical history logic](https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Controllers/history.js): `backend/Controllers/history.js`
- [Medicine inventory logic](https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Controllers/medicine.js): `backend/Controllers/medicine.js`
- [Facilities and public content](https://github.com/shivaay100/college-dispensary-management-system/tree/main/backend/Controllers): `backend/Controllers`

### Persistence and identity

- [JWT authorization](https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Authentication/auth.js): `backend/Authentication/auth.js`
- [User records](https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Models/user.js): `backend/Models/user.js`
- [History records](https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Models/history.js): `backend/Models/history.js`
- [Medicine records](https://github.com/shivaay100/college-dispensary-management-system/blob/main/backend/Models/medicine.js): `backend/Models/medicine.js`
- [Dispensary content records](https://github.com/shivaay100/college-dispensary-management-system/tree/main/backend/Models): `backend/Models`

### Other components

- **Visitor**
- **Student**
- **Admin / staff**
- **MongoDB**
- **Email service**

## Connections

- Visitor → Application routing: opens
- Student → Application routing: uses
- Admin / staff → Application routing: uses
- Application routing → Public information: renders
- Application routing → Login and registration: routes
- Application routing → Student dashboard: routes
- Application routing → Staff workspace: routes
- Application routing → Stock view: routes
- Login and registration → User API routes: HTTP requests
- Student dashboard → History routes: fetches history
- Staff workspace → User API routes: manages users
- Staff workspace → History routes: manages records
- Staff workspace → Medicine routes: manages stock
- Stock view → Medicine routes: fetches stock
- Public information → Dispensary content routes: loads public content
- Events and logout → Dispensary content routes: fetches events
- Express API entry → User API routes: mounts
- Express API entry → History routes: mounts
- Express API entry → Medicine routes: mounts
- Express API entry → Dispensary content routes: mounts
- User API routes → Accounts and staff logic: dispatches
- History routes → Medical history logic: dispatches
- Medicine routes → Medicine inventory logic: dispatches
- Dispensary content routes → Facilities and public content: dispatches
- User API routes → JWT authorization: protects selected routes
- Accounts and staff logic → User records: reads and writes
- Medical history logic → History records: reads and writes
- Medicine inventory logic → Medicine records: reads and writes
- Facilities and public content → Dispensary content records: reads and writes
- JWT authorization → User records: loads account
- User records → MongoDB: persists
- History records → MongoDB: persists
- Medicine records → MongoDB: persists
- Dispensary content records → MongoDB: persists
- Accounts and staff logic → Email service: sends account mail
