How pratikrrajput2006-ship-it/complaint-management-system works
CMS is a role-based complaint-management web application. Students and Staff submit and track complaints; the backend routes them to Higher Authority (HA) review or Admin fallback, supports proposed solutions and submitter responses, and records feedback and notifications. Admins also manage departments, categories, users, and HA assignments. The graph follows the documented REST architecture and sampled route/controller wiring; some frontend and controller internals were not sampled, so uncertain links are omitted.
Main entry points: db.js MySQL database · server.js Express server · staffRouter.js Staff and HA routes · adminRouter.js Admin routes
Components 25
Role interfaces
- Student interface
frontend/JS/Student/submit-complaint.js - Staff interface
frontend/JS/Staff/submit-complaint.js - Admin interface
frontend/JS/Admin/complaints.js
API and access
- Express server
Backend/server.js - Student routes
Backend/routes/studentRouter.js - Staff and HA routes
Backend/routes/staffRouter.js - Admin routes
Backend/routes/adminRouter.js - Authentication
Backend/middleware/authmiddleware.js
Complaint workflow
- Student accounts
Backend/controller/studentController.js - Staff accounts
Backend/controller/staffController.js - Complaint submission and response
Backend/controller/complaintController.js - HA review and escalation
Backend/controller/haController.js - Admin complaint review
Backend/controller/adminComplaintController.js - Private attachments
Backend/controller/attachmentController.js - Response deadline scheduler
Backend/utils/studentResponseScheduler.js
Administration and services
- Departments and HA management
Backend/controller/adminController.js - Admin promotion
Backend/controller/adminPromotionController.js - Complaint feedback
Backend/controller/feedbackController.js - In-app notifications
Backend/controller/notificationController.js - Notification helper
Backend/utils/notificationHelper.js - Admin reports
Backend/controller/adminReportController.js - MySQL database
Backend/config/db.js
Other components
- Student
- Staff
- Admin
Connections 44
- Student → Student interface: uses
- Staff → Staff interface: uses
- Admin → Admin interface: uses
- Student interface → Express server: calls REST API
- Staff interface → Express server: calls REST API
- Admin interface → Express server: calls REST API
- Express server → Student routes: mounts
Backend/server.js - Express server → Staff and HA routes: mounts
Backend/server.js - Express server → Admin routes: mounts
Backend/server.js - Express server → Response deadline scheduler: starts
Backend/server.js - Student routes → Authentication: checks identity
Backend/routes/studentRouter.js - Staff and HA routes → Authentication: checks identity
Backend/routes/staffRouter.js - Admin routes → Authentication: checks identity
Backend/routes/adminRouter.js - Student routes → Student accounts: routes account actions
Backend/routes/studentRouter.js - Staff and HA routes → Staff accounts: routes account actions
Backend/routes/staffRouter.js - Student routes → Complaint submission and response: routes complaint actions
Backend/routes/studentRouter.js - Staff and HA routes → Complaint submission and response: routes complaint actions
Backend/routes/staffRouter.js - Staff and HA routes → HA review and escalation: routes HA actions
Backend/routes/staffRouter.js - Admin routes → Admin complaint review: routes complaint actions
Backend/routes/adminRouter.js - Admin routes → Departments and HA management: routes management actions
Backend/routes/adminRouter.js - Admin routes → Admin promotion: routes promotion
Backend/routes/adminRouter.js - Student routes → Private attachments: routes downloads
Backend/routes/studentRouter.js - Staff and HA routes → Private attachments: routes downloads
Backend/routes/staffRouter.js - Admin routes → Private attachments: routes downloads
Backend/routes/adminRouter.js - Student routes → Complaint feedback: routes feedback
Backend/routes/studentRouter.js - Staff and HA routes → Complaint feedback: routes feedback
Backend/routes/staffRouter.js - Admin routes → Admin reports: routes reports
Backend/routes/adminRouter.js - Express server → In-app notifications: mounts notification routes
Backend/server.js - Complaint submission and response → Notification helper: creates notifications
Backend/controller/complaintController.js - HA review and escalation → Notification helper: creates notifications
Backend/controller/haController.js - Admin complaint review → Notification helper: creates notifications
Backend/controller/adminComplaintController.js - Departments and HA management → Notification helper: creates notifications
Backend/controller/adminController.js - Complaint submission and response → MySQL database: reads and writes
Backend/controller/complaintController.js - HA review and escalation → MySQL database: reads and writes
Backend/controller/haController.js - Admin complaint review → MySQL database: reads and writes
Backend/controller/adminComplaintController.js - Departments and HA management → MySQL database: reads and writes
Backend/controller/adminController.js - Private attachments → MySQL database: checks permissions
Backend/controller/attachmentController.js - Response deadline scheduler → MySQL database: checks deadlines
Backend/utils/studentResponseScheduler.js - Response deadline scheduler → Notification helper: sends reminders
Backend/utils/studentResponseScheduler.js - Notification helper → MySQL database: persists notifications
Backend/utils/notificationHelper.js - In-app notifications → MySQL database: reads notifications
Backend/controller/notificationController.js - Complaint feedback → MySQL database: reads and writes
Backend/controller/feedbackController.js - Admin reports → MySQL database: queries reports
Backend/controller/adminReportController.js - Admin promotion → MySQL database: updates accounts
Backend/controller/adminPromotionController.js