# thakuramulyasingh16-gif/college-erp-management-system architecture

> Architecture diagram of the GitHub repository thakuramulyasingh16-gif/college-erp-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thakuramulyasingh16-gif/college-erp-management-system
- Repository: https://github.com/thakuramulyasingh16-gif/college-erp-management-system

## Overview

College ERP is a full-stack system with Admin, Teacher, and Student portals. Users authenticate, then enter a role-specific dashboard; dashboard features make authenticated REST requests to the backend, whose routes enforce access and dispatch ERP operations backed by MySQL. The sampled ERP controller covers multiple academic and administrative domains, while route excerpts confirm notices, departments, courses, people, and fees. Other dashboard capabilities are grouped because their implementation details were not sampled; the README gives only a high-level product description.

Main entry points: [`backend/server.js`](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/server.js) (Express API server), [`backend/routes/authRoutes.js`](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/routes/authRoutes.js) (Auth routes), [`frontend/src/App.jsx`](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/App.jsx) (Application router), [`frontend/src/pages/Dashboard.jsx`](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/pages/Dashboard.jsx) (Role dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web portals"]
  node_app["Application router<br/>[App.jsx]"]
  node_login["Login page<br/>[Login.jsx]"]
  node_dashboard["Role dashboard<br/>[Dashboard.jsx]"]
  node_admin["Admin portal<br/>[AdminDashboard.jsx]"]
  node_teacher["Teacher portal"]
  node_student["Student portal"]
end

subgraph group_identity["Identity and access"]
  node_authstate["Client auth state<br/>[AuthContext.jsx]"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_authcontroller["Auth operations<br/>[authController.js]"]
  node_authmw["JWT and role guard<br/>[auth.js]"]
  node_sms["SMS service<br/>[smsService.js]"]
  node_uploadauth["Protected media<br/>[uploadAuth.js]"]
end

subgraph group_erp["ERP services"]
  node_erproutes["ERP routes<br/>[erpRoutes.js]"]
  node_erpcontroller["ERP operations<br/>[erpController.js]"]
  node_upload["Upload handling<br/>[upload.js]"]
end

subgraph group_platform["API and data"]
  node_fetch["Authenticated fetch<br/>[api.js]"]
  node_axios["API client<br/>[index.js]"]
  node_server["Express API server<br/>[server.js]"]
  node_database[("MySQL database<br/>[db.js]")]
end

node_user(("College user"))

node_user -->|"opens portal"| node_app
node_app -->|"provides auth"| node_authstate
node_app -->|"routes login"| node_login
node_app -->|"routes dashboard"| node_dashboard
node_login -->|"uses auth"| node_authstate
node_authstate -.->|"verifies session"| node_authroutes
node_authstate -.->|"requests logout"| node_authroutes
node_dashboard -->|"renders by role"| node_admin
node_dashboard -->|"renders by role"| node_teacher
node_dashboard -->|"renders by role"| node_student
node_admin -->|"requests data"| node_fetch
node_teacher -->|"requests data"| node_fetch
node_student -->|"requests data"| node_fetch
node_admin -->|"requests data"| node_axios
node_teacher -->|"requests data"| node_axios
node_student -->|"requests data"| node_axios
node_fetch -.->|"calls REST API"| node_server
node_axios -.->|"calls REST API"| node_server
node_server -->|"mounts routes"| node_authroutes
node_server -->|"mounts routes"| node_erproutes
node_authroutes -->|"guards routes"| node_authmw
node_authroutes -->|"dispatches auth"| node_authcontroller
node_authcontroller -->|"blacklists token"| node_authmw
node_authcontroller -->|"sends OTP"| node_sms
node_authcontroller -->|"reads and writes"| node_database
node_authmw -->|"checks session"| node_database
node_erproutes -->|"guards routes"| node_authmw
node_erproutes -->|"dispatches ERP"| node_erpcontroller
node_erpcontroller -->|"reads and writes"| node_database
node_erproutes -->|"handles uploads"| node_upload
node_server -->|"protects media"| node_uploadauth

click node_app "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/App.jsx"
click node_login "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/pages/Login.jsx"
click node_dashboard "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/pages/Dashboard.jsx"
click node_admin "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/components/AdminDashboard.jsx"
click node_teacher "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/components/TeacherDashboard.jsx"
click node_student "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/components/StudentDashboard.jsx"
click node_authstate "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/context/AuthContext.jsx"
click node_fetch "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/utils/api.js"
click node_axios "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/api/index.js"
click node_authroutes "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/routes/authRoutes.js"
click node_authcontroller "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/controllers/authController.js"
click node_authmw "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/middleware/auth.js"
click node_sms "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/services/smsService.js"
click node_server "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/server.js"
click node_erproutes "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/routes/erpRoutes.js"
click node_erpcontroller "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/controllers/erpController.js"
click node_upload "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/middleware/upload.js"
click node_uploadauth "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/middleware/uploadAuth.js"
click node_database "https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/config/db.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_login,node_dashboard,node_admin,node_teacher,node_student,node_user toneBlue
class node_authstate,node_authroutes,node_authcontroller,node_authmw,node_sms,node_uploadauth toneAmber
class node_erproutes,node_erpcontroller,node_upload toneMint
class node_fetch,node_axios,node_server,node_database toneRose
```

## Components

### Web portals

- [Application router](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Login page](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Role dashboard](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Admin portal](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/components/AdminDashboard.jsx): `frontend/src/components/AdminDashboard.jsx`
- [Teacher portal](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/components/TeacherDashboard.jsx): `frontend/src/components/TeacherDashboard.jsx`
- [Student portal](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/components/StudentDashboard.jsx): `frontend/src/components/StudentDashboard.jsx`

### Identity and access

- [Client auth state](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Auth routes](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Auth operations](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [JWT and role guard](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`
- [SMS service](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/services/smsService.js): `backend/services/smsService.js`
- [Protected media](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/middleware/uploadAuth.js): `backend/middleware/uploadAuth.js`

### ERP services

- [ERP routes](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/routes/erpRoutes.js): `backend/routes/erpRoutes.js`
- [ERP operations](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/controllers/erpController.js): `backend/controllers/erpController.js`
- [Upload handling](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/middleware/upload.js): `backend/middleware/upload.js`

### API and data

- [Authenticated fetch](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/utils/api.js): `frontend/src/utils/api.js`
- [API client](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/frontend/src/api/index.js): `frontend/src/api/index.js`
- [Express API server](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/server.js): `backend/server.js`
- [MySQL database](https://github.com/thakuramulyasingh16-gif/college-erp-management-system/blob/main/backend/config/db.js): `backend/config/db.js`

### Other components

- **College user**

## Connections

- College user → Application router: opens portal (evidence: `frontend/src/App.jsx`)
- Application router → Client auth state: provides auth (evidence: `frontend/src/App.jsx`)
- Application router → Login page: routes login (evidence: `frontend/src/App.jsx`)
- Application router → Role dashboard: routes dashboard (evidence: `frontend/src/App.jsx`)
- Login page → Client auth state: uses auth (evidence: `frontend/src/pages/Login.jsx`)
- Client auth state → Auth routes: verifies session (evidence: `frontend/src/context/AuthContext.jsx`)
- Client auth state → Auth routes: requests logout (evidence: `frontend/src/context/AuthContext.jsx`)
- Role dashboard → Admin portal: renders by role (evidence: `frontend/src/pages/Dashboard.jsx`)
- Role dashboard → Teacher portal: renders by role (evidence: `frontend/src/pages/Dashboard.jsx`)
- Role dashboard → Student portal: renders by role (evidence: `frontend/src/pages/Dashboard.jsx`)
- Admin portal → Authenticated fetch: requests data (evidence: `frontend/src/components/AdminDashboard.jsx`)
- Teacher portal → Authenticated fetch: requests data (evidence: `frontend/src/components/TeacherDashboard.jsx`)
- Student portal → Authenticated fetch: requests data (evidence: `frontend/src/components/StudentDashboard.jsx`)
- Admin portal → API client: requests data (evidence: `frontend/src/components/AdminDashboard.jsx`)
- Teacher portal → API client: requests data (evidence: `frontend/src/components/TeacherDashboard.jsx`)
- Student portal → API client: requests data (evidence: `frontend/src/components/StudentDashboard.jsx`)
- Authenticated fetch → Express API server: calls REST API (evidence: `frontend/src/utils/api.js`)
- API client → Express API server: calls REST API (evidence: `frontend/src/api/index.js`)
- Express API server → Auth routes: mounts routes (evidence: `backend/server.js`)
- Express API server → ERP routes: mounts routes (evidence: `backend/server.js`)
- Auth routes → JWT and role guard: guards routes (evidence: `backend/routes/authRoutes.js`)
- Auth routes → Auth operations: dispatches auth (evidence: `backend/routes/authRoutes.js`)
- Auth operations → JWT and role guard: blacklists token (evidence: `backend/controllers/authController.js`)
- Auth operations → SMS service: sends OTP (evidence: `backend/controllers/authController.js`)
- Auth operations → MySQL database: reads and writes (evidence: `backend/controllers/authController.js`)
- JWT and role guard → MySQL database: checks session (evidence: `backend/middleware/auth.js`)
- ERP routes → JWT and role guard: guards routes (evidence: `backend/routes/erpRoutes.js`)
- ERP routes → ERP operations: dispatches ERP (evidence: `backend/routes/erpRoutes.js`)
- ERP operations → MySQL database: reads and writes (evidence: `backend/controllers/erpController.js`)
- ERP routes → Upload handling: handles uploads (evidence: `backend/routes/erpRoutes.js`)
- Express API server → Protected media: protects media (evidence: `backend/server.js`)
