# nagavakkalagadda/rymec-complaint-desk architecture

> Architecture diagram of the GitHub repository nagavakkalagadda/rymec-complaint-desk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nagavakkalagadda/rymec-complaint-desk
- Repository: https://github.com/nagavakkalagadda/rymec-complaint-desk

## Overview

RYMEC Grievance Desk is a campus complaint-management platform. Students register or submit grievances, receive a tracking ID, follow progress, and can reopen or rate outcomes; staff handle complaint queues, while administrators use analytics and department tools. The backend provides authentication, complaint processing, persistence, audit logging, notifications, and documented SLA escalation. The README also describes duplicate detection, trend alerts, anonymous reporting, and public transparency. Some of those internals are not fully shown in the excerpts, so their links are documented rather than inferred from names.

Main entry points: [`frontend/src/App.tsx`](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/App.tsx) (Application shell), [`backend/server.js`](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/server.js) (API server), [`frontend/src/services/api.ts`](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/services/api.ts) (API client), [`backend/config/db.js`](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/config/db.js) (Database and fallback)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_app["Application shell<br/>[App.tsx]"]
  node_authui["Authentication UI<br/>[RoundGlassAuth.tsx]"]
  node_otp["OTP verification"]
  node_submission["Complaint submission"]
  node_tracking["Complaint tracking"]
  node_studentdash["Student dashboard"]
  node_staffdash["Staff dashboard<br/>[StaffDashboard.tsx]"]
  node_analyticsui["Analytics dashboard"]
  node_publicwall["Transparency wall"]
  node_chatbot["Grievance chatbot"]
  node_apiclient["API client<br/>[api.ts]"]
end

subgraph group_identity["Identity and access"]
  node_authcontext["Auth state<br/>[AuthContext.tsx]"]
  node_authroutes["Authentication routes<br/>[authRoutes.js]"]
  node_authcontroller["Authentication controller<br/>[authController.js]"]
  node_authmiddleware["JWT and role checks<br/>[auth.js]"]
end

subgraph group_grievances["Grievance operations"]
  node_complaintroutes["Complaint routes<br/>[complaintRoutes.js]"]
  node_complaintcontroller["Complaint lifecycle"]
  node_ai["Triage and duplicate checks<br/>[aiService.js]"]
  node_escalation["SLA escalation<br/>[server.js]"]
  node_department["Department management"]
  node_analytics["Analytics service"]
end

subgraph group_platform["Backend platform"]
  node_notification["Notifications"]
  node_email["Email delivery<br/>[emailService.js]"]
  node_audit["Audit logging<br/>[auditService.js]"]
  node_db[("Database and fallback<br/>[db.js]")]
  node_server["API server<br/>[server.js]"]
end

node_student(("Student / complainant"))
node_staff(("College staff"))

node_student -->|"uses"| node_app
node_staff -->|"uses"| node_app
node_app -->|"renders"| node_submission
node_app -->|"renders"| node_tracking
node_app -->|"renders"| node_studentdash
node_app -->|"renders"| node_staffdash
node_app -->|"renders"| node_analyticsui
node_app -->|"renders"| node_publicwall
node_app -->|"renders"| node_chatbot
node_app -->|"renders"| node_authui
node_authui -->|"uses"| node_authcontext
node_authui -->|"renders"| node_otp
node_authcontext -->|"calls"| node_apiclient
node_submission -->|"submits through"| node_apiclient
node_tracking -->|"loads through"| node_apiclient
node_staffdash -->|"loads through"| node_apiclient
node_analyticsui -->|"loads through"| node_apiclient
node_publicwall -->|"loads through"| node_apiclient
node_chatbot -->|"queries through"| node_apiclient
node_apiclient -->|"requests"| node_server
node_server -->|"mounts"| node_authroutes
node_server -->|"mounts"| node_complaintroutes
node_server -->|"mounts routes"| node_analytics
node_server -->|"mounts routes"| node_department
node_server -->|"mounts routes"| node_notification
node_authroutes -->|"routes to"| node_authcontroller
node_complaintroutes -->|"routes to"| node_complaintcontroller
node_complaintroutes -->|"protects routes"| node_authmiddleware
node_authroutes -->|"protects routes"| node_authmiddleware
node_authcontroller -->|"reads and writes"| node_db
node_authcontroller -->|"sends OTP mail"| node_email
node_authcontroller -->|"records events"| node_audit
node_complaintcontroller -->|"reads and writes"| node_db
node_complaintcontroller -->|"uses triage"| node_ai
node_complaintcontroller -->|"masks identities"| node_authmiddleware
node_complaintcontroller -->|"records events"| node_audit
node_server -->|"queries overdue items"| node_db
node_server -->|"runs cycle"| node_escalation
node_department -->|"reads and writes"| node_db
node_analytics -->|"queries metrics"| node_db
node_notification -->|"reads and writes"| node_db
node_notification -->|"sends mail"| node_email
node_audit -->|"persists logs"| node_db
node_email -.->|"delivers notifications"| node_staff

click node_app "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/App.tsx"
click node_authui "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/components/auth/RoundGlassAuth.tsx"
click node_otp "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/components/auth/OtpOrbitVerification.tsx"
click node_submission "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/components/student/ComplaintSubmissionForm.tsx"
click node_tracking "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/components/student/ComplaintTrackingView.tsx"
click node_studentdash "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/components/student/StudentDashboard.tsx"
click node_staffdash "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/components/staff/StaffDashboard.tsx"
click node_analyticsui "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/components/analytics/AnalyticsDashboard.tsx"
click node_publicwall "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/components/public/TransparencyWall.tsx"
click node_chatbot "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/components/chatbot/GrievanceChatbot.tsx"
click node_apiclient "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/services/api.ts"
click node_authcontext "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/context/AuthContext.tsx"
click node_authroutes "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/routes/authRoutes.js"
click node_authcontroller "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/controllers/authController.js"
click node_authmiddleware "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/middleware/auth.js"
click node_complaintroutes "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/routes/complaintRoutes.js"
click node_complaintcontroller "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/controllers/complaintController.js"
click node_ai "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/services/aiService.js"
click node_escalation "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/server.js"
click node_department "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/controllers/departmentController.js"
click node_analytics "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/controllers/analyticsController.js"
click node_notification "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/controllers/notificationController.js"
click node_email "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/services/emailService.js"
click node_audit "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/services/auditService.js"
click node_db "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/config/db.js"
click node_server "https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/server.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_otp,node_submission,node_tracking,node_studentdash,node_staffdash,node_analyticsui,node_publicwall,node_chatbot,node_apiclient toneBlue
class node_authcontext,node_authroutes,node_authcontroller,node_authmiddleware toneAmber
class node_complaintroutes,node_complaintcontroller,node_ai,node_escalation,node_department,node_analytics toneMint
class node_notification,node_email,node_audit,node_db,node_server toneRose
class node_student,node_staff toneIndigo
```

## Components

### User experience

- [Application shell](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Authentication UI](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/components/auth/RoundGlassAuth.tsx): `frontend/src/components/auth/RoundGlassAuth.tsx`
- [OTP verification](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/components/auth/OtpOrbitVerification.tsx): `frontend/src/components/auth/OtpOrbitVerification.tsx`
- [Complaint submission](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/components/student/ComplaintSubmissionForm.tsx): `frontend/src/components/student/ComplaintSubmissionForm.tsx`
- [Complaint tracking](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/components/student/ComplaintTrackingView.tsx): `frontend/src/components/student/ComplaintTrackingView.tsx`
- [Student dashboard](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/components/student/StudentDashboard.tsx): `frontend/src/components/student/StudentDashboard.tsx`
- [Staff dashboard](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/components/staff/StaffDashboard.tsx): `frontend/src/components/staff/StaffDashboard.tsx`
- [Analytics dashboard](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/components/analytics/AnalyticsDashboard.tsx): `frontend/src/components/analytics/AnalyticsDashboard.tsx`
- [Transparency wall](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/components/public/TransparencyWall.tsx): `frontend/src/components/public/TransparencyWall.tsx`
- [Grievance chatbot](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/components/chatbot/GrievanceChatbot.tsx): `frontend/src/components/chatbot/GrievanceChatbot.tsx`
- [API client](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### Identity and access

- [Auth state](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [Authentication routes](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Authentication controller](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [JWT and role checks](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`

### Grievance operations

- [Complaint routes](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/routes/complaintRoutes.js): `backend/routes/complaintRoutes.js`
- [Complaint lifecycle](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/controllers/complaintController.js): `backend/controllers/complaintController.js`
- [Triage and duplicate checks](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/services/aiService.js): `backend/services/aiService.js`
- [SLA escalation](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/server.js): `backend/server.js`
- [Department management](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/controllers/departmentController.js): `backend/controllers/departmentController.js`
- [Analytics service](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/controllers/analyticsController.js): `backend/controllers/analyticsController.js`

### Backend platform

- [Notifications](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/controllers/notificationController.js): `backend/controllers/notificationController.js`
- [Email delivery](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/services/emailService.js): `backend/services/emailService.js`
- [Audit logging](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/services/auditService.js): `backend/services/auditService.js`
- [Database and fallback](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/config/db.js): `backend/config/db.js`
- [API server](https://github.com/nagavakkalagadda/rymec-complaint-desk/blob/main/backend/server.js): `backend/server.js`

### Other components

- **Student / complainant**
- **College staff**

## Connections

- Student / complainant → Application shell: uses
- College staff → Application shell: uses
- Application shell → Complaint submission: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Complaint tracking: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Student dashboard: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Staff dashboard: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Analytics dashboard: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Transparency wall: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Grievance chatbot: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Authentication UI: renders (evidence: `frontend/src/App.tsx`)
- Authentication UI → Auth state: uses (evidence: `frontend/src/components/auth/RoundGlassAuth.tsx`)
- Authentication UI → OTP verification: renders (evidence: `frontend/src/components/auth/RoundGlassAuth.tsx`)
- Auth state → API client: calls (evidence: `frontend/src/context/AuthContext.tsx`)
- Complaint submission → API client: submits through (evidence: `frontend/src/components/student/ComplaintSubmissionForm.tsx`)
- Complaint tracking → API client: loads through
- Staff dashboard → API client: loads through (evidence: `frontend/src/components/staff/StaffDashboard.tsx`)
- Analytics dashboard → API client: loads through (evidence: `frontend/src/components/analytics/AnalyticsDashboard.tsx`)
- Transparency wall → API client: loads through (evidence: `frontend/src/components/public/TransparencyWall.tsx`)
- Grievance chatbot → API client: queries through (evidence: `frontend/src/components/chatbot/GrievanceChatbot.tsx`)
- API client → API server: requests
- API server → Authentication routes: mounts (evidence: `backend/server.js`)
- API server → Complaint routes: mounts (evidence: `backend/server.js`)
- API server → Analytics service: mounts routes (evidence: `backend/server.js`)
- API server → Department management: mounts routes (evidence: `backend/server.js`)
- API server → Notifications: mounts routes (evidence: `backend/server.js`)
- Authentication routes → Authentication controller: routes to (evidence: `backend/routes/authRoutes.js`)
- Complaint routes → Complaint lifecycle: routes to (evidence: `backend/routes/complaintRoutes.js`)
- Complaint routes → JWT and role checks: protects routes (evidence: `backend/routes/complaintRoutes.js`)
- Authentication routes → JWT and role checks: protects routes (evidence: `backend/routes/authRoutes.js`)
- Authentication controller → Database and fallback: reads and writes (evidence: `backend/controllers/authController.js`)
- Authentication controller → Email delivery: sends OTP mail (evidence: `backend/controllers/authController.js`)
- Authentication controller → Audit logging: records events (evidence: `backend/controllers/authController.js`)
- Complaint lifecycle → Database and fallback: reads and writes (evidence: `backend/controllers/complaintController.js`)
- Complaint lifecycle → Triage and duplicate checks: uses triage (evidence: `backend/controllers/complaintController.js`)
- Complaint lifecycle → JWT and role checks: masks identities (evidence: `backend/controllers/complaintController.js`)
- Complaint lifecycle → Audit logging: records events (evidence: `backend/controllers/complaintController.js`)
- API server → Database and fallback: queries overdue items (evidence: `backend/server.js`)
- API server → SLA escalation: runs cycle (evidence: `backend/server.js`)
- Department management → Database and fallback: reads and writes (evidence: `backend/controllers/departmentController.js`)
- Analytics service → Database and fallback: queries metrics
- Notifications → Database and fallback: reads and writes (evidence: `backend/controllers/notificationController.js`)
- Notifications → Email delivery: sends mail (evidence: `backend/controllers/notificationController.js`)
- Audit logging → Database and fallback: persists logs (evidence: `backend/services/auditService.js`)
- Email delivery → College staff: delivers notifications
