# msyathin10/ccms_portal architecture

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

- Interactive diagram: https://gitdiagram.com/msyathin10/ccms_portal
- Repository: https://github.com/msyathin10/ccms_portal

## Overview

CCMS takes a student grievance from authenticated submission through administrative review and staff assignment, work, student verification, and feedback. The React portal presents separate student, administrator, and staff workflows; its API client calls the Express API, whose controllers apply domain operations to MongoDB models. The README also describes analytics, campus intelligence, AI-assisted suggestions and duplicate detection, notifications, and theme switching. Some page and controller implementations were not sampled, so those capabilities and links are shown only where documented or supported by the source index.

Main entry points: [`server/src/routes/api.js`](https://github.com/msyathin10/ccms_portal/blob/main/server/src/routes/api.js) (API routing), [`client/src/App.jsx`](https://github.com/msyathin10/ccms_portal/blob/main/client/src/App.jsx) (Role-based portal), [`server/src/controllers/authController.js`](https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/authController.js) (Authentication), [`server/src/controllers/adminController.js`](https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/adminController.js) (Admin operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Web portal"]
  node_app["Role-based portal<br/>[App.jsx]"]
  node_authui["Session and roles<br/>[AuthContext.jsx]"]
  node_studentflows["Student complaints"]
  node_adminflows["Admin console"]
  node_staffflows["Staff task board"]
  node_timeline["Status timeline<br/>[StatusTimeline.jsx]"]
  node_notifyui["Notification center"]
  node_theme["Theme switcher<br/>[ThemeContext.jsx]"]
end

subgraph group_api["API and workflows"]
  node_api["HTTP API client<br/>[api.js]"]
  node_server["Express API server<br/>[app.js]"]
  node_router["API routing<br/>[api.js]"]
  node_auth["Authentication<br/>[authController.js]"]
  node_complaints["Complaint handling"]
  node_assignment["Technician assignment"]
  node_status["Status progression"]
  node_feedback["Resolution feedback"]
  node_updates["Activity updates"]
  node_adminops["Admin operations<br/>[adminController.js]"]
  node_ai["AI and duplicates"]
  node_notifications["Notification service"]
end

subgraph group_domain["Complaint domain"]
  node_complaintmodel["Complaint record<br/>[Complaint.js]"]
  node_user["User identity<br/>[User.js]"]
  node_studentmodel["Student profile<br/>[Student.js]"]
  node_staffmodel["Staff profile<br/>[Staff.js]"]
  node_category["Issue categories<br/>[Category.js]"]
  node_department["Departments<br/>[Department.js]"]
end

subgraph group_state["Persistence and signals"]
  node_notificationmodel["Notification record<br/>[Notification.js]"]
  node_mongodb[("MongoDB<br/>[db.js]")]
end

node_student(("Student"))
node_admin(("Administrator"))
node_staff(("Department staff"))

node_student -->|"uses portal"| node_app
node_admin -->|"uses portal"| node_app
node_staff -->|"uses portal"| node_app
node_app -->|"routes to"| node_studentflows
node_app -->|"routes to"| node_adminflows
node_app -->|"routes to"| node_staffflows
node_app -->|"provides session"| node_authui
node_studentflows -->|"calls"| node_api
node_adminflows -->|"calls"| node_api
node_staffflows -->|"calls"| node_api
node_authui -->|"requests session"| node_api
node_notifyui -->|"polls notifications"| node_api
node_studentflows -->|"renders progress"| node_timeline
node_api -->|"sends HTTP requests"| node_server
node_server -->|"mounts routes"| node_router
node_router -->|"dispatches auth"| node_auth
node_router -->|"dispatches complaints"| node_complaints
node_router -->|"dispatches assignment"| node_assignment
node_router -->|"dispatches status"| node_status
node_router -->|"dispatches feedback"| node_feedback
node_router -->|"dispatches updates"| node_updates
node_router -->|"dispatches admin"| node_adminops
node_router -->|"dispatches AI"| node_ai
node_router -->|"dispatches notices"| node_notifications
node_auth -->|"reads identity"| node_user
node_auth -->|"reads student profile"| node_studentmodel
node_auth -->|"reads staff profile"| node_staffmodel
node_auth -->|"reads department"| node_department
node_auth -->|"reads categories"| node_category
node_complaints -->|"creates and queries"| node_complaintmodel
node_complaints -->|"reads category"| node_category
node_complaints -->|"populates user"| node_user
node_complaints -->|"reads profile"| node_studentmodel
node_assignment -->|"assigns complaint"| node_complaintmodel
node_assignment -->|"creates notice"| node_notificationmodel
node_assignment -->|"reads user"| node_user
node_status -->|"updates status"| node_complaintmodel
node_status -->|"creates notice"| node_notificationmodel
node_status -->|"reads user"| node_user
node_adminops -->|"aggregates issues"| node_complaintmodel
node_adminops -->|"manages departments"| node_department
node_adminops -->|"manages categories"| node_category
node_adminops -->|"manages accounts"| node_user
node_adminops -->|"creates staff"| node_staffmodel
node_ai -->|"checks issues"| node_complaintmodel
node_ai -->|"suggests category"| node_category
node_notifications -->|"serves notices"| node_notificationmodel
node_studentflows -->|"submits and tracks"| node_complaints

click node_app "https://github.com/msyathin10/ccms_portal/blob/main/client/src/App.jsx"
click node_authui "https://github.com/msyathin10/ccms_portal/blob/main/client/src/context/AuthContext.jsx"
click node_studentflows "https://github.com/msyathin10/ccms_portal/tree/main/client/src/pages/student"
click node_adminflows "https://github.com/msyathin10/ccms_portal/tree/main/client/src/pages/admin"
click node_staffflows "https://github.com/msyathin10/ccms_portal/tree/main/client/src/pages/staff"
click node_timeline "https://github.com/msyathin10/ccms_portal/blob/main/client/src/components/StatusTimeline.jsx"
click node_notifyui "https://github.com/msyathin10/ccms_portal/blob/main/client/src/context/NotificationContext.jsx"
click node_theme "https://github.com/msyathin10/ccms_portal/blob/main/client/src/context/ThemeContext.jsx"
click node_api "https://github.com/msyathin10/ccms_portal/blob/main/client/src/services/api.js"
click node_server "https://github.com/msyathin10/ccms_portal/blob/main/server/src/app.js"
click node_router "https://github.com/msyathin10/ccms_portal/blob/main/server/src/routes/api.js"
click node_auth "https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/authController.js"
click node_complaints "https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/complaintController.js"
click node_assignment "https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/assignmentController.js"
click node_status "https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/statusController.js"
click node_feedback "https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/feedbackController.js"
click node_updates "https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/updateController.js"
click node_adminops "https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/adminController.js"
click node_ai "https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/aiHelperController.js"
click node_notifications "https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/notificationController.js"
click node_complaintmodel "https://github.com/msyathin10/ccms_portal/blob/main/server/src/models/Complaint.js"
click node_user "https://github.com/msyathin10/ccms_portal/blob/main/server/src/models/User.js"
click node_studentmodel "https://github.com/msyathin10/ccms_portal/blob/main/server/src/models/Student.js"
click node_staffmodel "https://github.com/msyathin10/ccms_portal/blob/main/server/src/models/Staff.js"
click node_category "https://github.com/msyathin10/ccms_portal/blob/main/server/src/models/Category.js"
click node_department "https://github.com/msyathin10/ccms_portal/blob/main/server/src/models/Department.js"
click node_notificationmodel "https://github.com/msyathin10/ccms_portal/blob/main/server/src/models/Notification.js"
click node_mongodb "https://github.com/msyathin10/ccms_portal/blob/main/server/src/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_authui,node_studentflows,node_adminflows,node_staffflows,node_timeline,node_notifyui,node_theme toneBlue
class node_api,node_server,node_router,node_auth,node_complaints,node_assignment,node_status,node_feedback,node_updates,node_adminops,node_ai,node_notifications toneAmber
class node_complaintmodel,node_user,node_studentmodel,node_staffmodel,node_category,node_department toneMint
class node_notificationmodel,node_mongodb toneRose
class node_student,node_admin,node_staff toneIndigo
```

## Components

### Web portal

- [Role-based portal](https://github.com/msyathin10/ccms_portal/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Session and roles](https://github.com/msyathin10/ccms_portal/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Student complaints](https://github.com/msyathin10/ccms_portal/tree/main/client/src/pages/student): `client/src/pages/student`
- [Admin console](https://github.com/msyathin10/ccms_portal/tree/main/client/src/pages/admin): `client/src/pages/admin`
- [Staff task board](https://github.com/msyathin10/ccms_portal/tree/main/client/src/pages/staff): `client/src/pages/staff`
- [Status timeline](https://github.com/msyathin10/ccms_portal/blob/main/client/src/components/StatusTimeline.jsx): `client/src/components/StatusTimeline.jsx`
- [Notification center](https://github.com/msyathin10/ccms_portal/blob/main/client/src/context/NotificationContext.jsx): `client/src/context/NotificationContext.jsx`
- [Theme switcher](https://github.com/msyathin10/ccms_portal/blob/main/client/src/context/ThemeContext.jsx): `client/src/context/ThemeContext.jsx`

### API and workflows

- [HTTP API client](https://github.com/msyathin10/ccms_portal/blob/main/client/src/services/api.js): `client/src/services/api.js`
- [Express API server](https://github.com/msyathin10/ccms_portal/blob/main/server/src/app.js): `server/src/app.js`
- [API routing](https://github.com/msyathin10/ccms_portal/blob/main/server/src/routes/api.js): `server/src/routes/api.js`
- [Authentication](https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/authController.js): `server/src/controllers/authController.js`
- [Complaint handling](https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/complaintController.js): `server/src/controllers/complaintController.js`
- [Technician assignment](https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/assignmentController.js): `server/src/controllers/assignmentController.js`
- [Status progression](https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/statusController.js): `server/src/controllers/statusController.js`
- [Resolution feedback](https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/feedbackController.js): `server/src/controllers/feedbackController.js`
- [Activity updates](https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/updateController.js): `server/src/controllers/updateController.js`
- [Admin operations](https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/adminController.js): `server/src/controllers/adminController.js`
- [AI and duplicates](https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/aiHelperController.js): `server/src/controllers/aiHelperController.js`
- [Notification service](https://github.com/msyathin10/ccms_portal/blob/main/server/src/controllers/notificationController.js): `server/src/controllers/notificationController.js`

### Complaint domain

- [Complaint record](https://github.com/msyathin10/ccms_portal/blob/main/server/src/models/Complaint.js): `server/src/models/Complaint.js`
- [User identity](https://github.com/msyathin10/ccms_portal/blob/main/server/src/models/User.js): `server/src/models/User.js`
- [Student profile](https://github.com/msyathin10/ccms_portal/blob/main/server/src/models/Student.js): `server/src/models/Student.js`
- [Staff profile](https://github.com/msyathin10/ccms_portal/blob/main/server/src/models/Staff.js): `server/src/models/Staff.js`
- [Issue categories](https://github.com/msyathin10/ccms_portal/blob/main/server/src/models/Category.js): `server/src/models/Category.js`
- [Departments](https://github.com/msyathin10/ccms_portal/blob/main/server/src/models/Department.js): `server/src/models/Department.js`

### Persistence and signals

- [Notification record](https://github.com/msyathin10/ccms_portal/blob/main/server/src/models/Notification.js): `server/src/models/Notification.js`
- [MongoDB](https://github.com/msyathin10/ccms_portal/blob/main/server/src/config/db.js): `server/src/config/db.js`

### Other components

- **Student**
- **Administrator**
- **Department staff**

## Connections

- Student → Role-based portal: uses portal (evidence: `README.md`)
- Administrator → Role-based portal: uses portal (evidence: `README.md`)
- Department staff → Role-based portal: uses portal (evidence: `README.md`)
- Role-based portal → Student complaints: routes to (evidence: `client/src/App.jsx`)
- Role-based portal → Admin console: routes to (evidence: `client/src/App.jsx`)
- Role-based portal → Staff task board: routes to (evidence: `client/src/App.jsx`)
- Role-based portal → Session and roles: provides session (evidence: `client/src/App.jsx`)
- Student complaints → HTTP API client: calls (evidence: `client/src/pages/student/SubmitComplaint.jsx`)
- Admin console → HTTP API client: calls (evidence: `client/src/pages/admin/AdminComplaintDetails.jsx`)
- Staff task board → HTTP API client: calls (evidence: `client/src/pages/staff/StaffComplaintDetails.jsx`)
- Session and roles → HTTP API client: requests session (evidence: `client/src/context/AuthContext.jsx`)
- Notification center → HTTP API client: polls notifications (evidence: `client/src/context/NotificationContext.jsx`)
- Student complaints → Status timeline: renders progress (evidence: `client/src/pages/student/StudentComplaintDetails.jsx`)
- HTTP API client → Express API server: sends HTTP requests (evidence: `client/src/services/api.js`)
- Express API server → API routing: mounts routes (evidence: `server/src/app.js`)
- API routing → Authentication: dispatches auth (evidence: `server/src/routes/api.js`)
- API routing → Complaint handling: dispatches complaints (evidence: `server/src/routes/api.js`)
- API routing → Technician assignment: dispatches assignment (evidence: `server/src/routes/api.js`)
- API routing → Status progression: dispatches status (evidence: `server/src/routes/api.js`)
- API routing → Resolution feedback: dispatches feedback (evidence: `server/src/routes/api.js`)
- API routing → Activity updates: dispatches updates (evidence: `server/src/routes/api.js`)
- API routing → Admin operations: dispatches admin (evidence: `server/src/routes/api.js`)
- API routing → AI and duplicates: dispatches AI (evidence: `server/src/routes/api.js`)
- API routing → Notification service: dispatches notices (evidence: `server/src/routes/api.js`)
- Authentication → User identity: reads identity (evidence: `server/src/controllers/authController.js`)
- Authentication → Student profile: reads student profile (evidence: `server/src/controllers/authController.js`)
- Authentication → Staff profile: reads staff profile (evidence: `server/src/controllers/authController.js`)
- Authentication → Departments: reads department (evidence: `server/src/controllers/authController.js`)
- Authentication → Issue categories: reads categories (evidence: `server/src/controllers/authController.js`)
- Complaint handling → Complaint record: creates and queries (evidence: `server/src/controllers/complaintController.js`)
- Complaint handling → Issue categories: reads category (evidence: `server/src/controllers/complaintController.js`)
- Complaint handling → User identity: populates user (evidence: `server/src/controllers/complaintController.js`)
- Complaint handling → Student profile: reads profile (evidence: `server/src/controllers/complaintController.js`)
- Technician assignment → Complaint record: assigns complaint (evidence: `server/src/controllers/assignmentController.js`)
- Technician assignment → Notification record: creates notice (evidence: `server/src/controllers/assignmentController.js`)
- Technician assignment → User identity: reads user (evidence: `server/src/controllers/assignmentController.js`)
- Status progression → Complaint record: updates status (evidence: `server/src/controllers/statusController.js`)
- Status progression → Notification record: creates notice (evidence: `server/src/controllers/statusController.js`)
- Status progression → User identity: reads user (evidence: `server/src/controllers/statusController.js`)
- Admin operations → Complaint record: aggregates issues (evidence: `server/src/controllers/adminController.js`)
- Admin operations → Departments: manages departments (evidence: `server/src/controllers/adminController.js`)
- Admin operations → Issue categories: manages categories (evidence: `server/src/controllers/adminController.js`)
- Admin operations → User identity: manages accounts (evidence: `server/src/controllers/adminController.js`)
- Admin operations → Staff profile: creates staff (evidence: `server/src/controllers/adminController.js`)
- AI and duplicates → Complaint record: checks issues (evidence: `server/src/controllers/aiHelperController.js`)
- AI and duplicates → Issue categories: suggests category (evidence: `server/src/controllers/aiHelperController.js`)
- Notification service → Notification record: serves notices
- Student complaints → Complaint handling: submits and tracks (evidence: `README.md`)
