How ifaz07/shomadhan works
Shomadhan is a role-based civic issue reporting and resolution platform. Citizens submit and track geolocated complaints; the API triages reports, scores priority, checks duplicates, and stores tickets for officers and city authorities to manage through resolution. Escalation, notifications, analytics, identity review, emergency alerts, and volunteer events form distinct supporting workflows. The diagram combines documented capabilities with relationships visible in sampled files and the source index; unsampled internals are represented at their documented subsystem paths.
Main entry points: complaint.controller.js Complaint handling · Complaint.model.js Complaint records · User.model.js User accounts · server.js Express API
Components 27
Web application
- React application
frontend/src/App.jsx - Auth context
frontend/src/context/AuthContext.jsx - API client
frontend/src/services/api.js
API and access
- Express API
backend/server.js - Auth routes
backend/routes/auth.routes.js - Authentication
backend/controllers/auth.controller.js - JWT access control
backend/middleware/auth.middleware.js - Complaint routes
backend/routes/complaint.routes.js
Complaint lifecycle
- Complaint handling
backend/controllers/complaint.controller.js - AI classification
backend/services/nlpService.js - Priority scoring
backend/services/priorityService.js - Duplicate detection
backend/services/spamDetectionService.js - SLA escalation
backend/services/escalationService.js
Civic operations
- Officer workflows
backend/controllers/servant.controller.js - Mayor workflows
backend/controllers/mayor.controller.js - Admin workflows
backend/controllers/admin.controller.js - Emergency broadcasts
backend/controllers/emergencyBroadcast.controller.js - Analytics and reports
backend/controllers/report.controller.js - Volunteer program
backend/controllers/volunteer.controller.js
Persistence and integrations
- Complaint records
backend/models/Complaint.model.js - User accounts
backend/models/User.model.js - Notification delivery
backend/services/notificationService.js - Notification records
backend/models/Notification.model.js - Email delivery
backend/services/emailService.js
Other components
- Civic users
- MongoDB
- AI services
Connections 31
- Civic users → React application: use
- React application → Auth context: uses
frontend/src/App.jsx - Auth context → API client: calls
frontend/src/context/AuthContext.jsx - React application → API client: requests
- API client → Express API: REST requests
- Express API → Auth routes: mounts
backend/server.js - Express API → Complaint routes: mounts
backend/server.js - Auth routes → JWT access control: protects
backend/routes/auth.routes.js - Auth routes → Authentication: dispatches
backend/routes/auth.routes.js - Authentication → User accounts: reads and writes
backend/controllers/auth.controller.js - Complaint routes → JWT access control: protects
backend/routes/complaint.routes.js - Complaint routes → Complaint handling: dispatches
backend/routes/complaint.routes.js - Complaint handling → AI classification: classifies
backend/controllers/complaint.controller.js - Complaint handling → Priority scoring: scores priority
backend/controllers/complaint.controller.js - Complaint handling → Duplicate detection: checks duplicates
backend/controllers/complaint.controller.js - Complaint handling → Complaint records: reads and writes
backend/controllers/complaint.controller.js - Complaint handling → User accounts: reads and updates
backend/controllers/complaint.controller.js - AI classification → AI services: classifies via
- Express API → SLA escalation: starts job
backend/server.js - SLA escalation → Complaint records: scans and updates
backend/services/escalationService.js - Officer workflows → Complaint records: manages tickets
backend/controllers/servant.controller.js - Mayor workflows → Complaint records: uses complaint data
- Admin workflows → User accounts: reviews accounts
backend/controllers/admin.controller.js - Emergency broadcasts → Notification delivery: delivers alerts
- Analytics and reports → Complaint records: reads
backend/controllers/report.controller.js - Volunteer program → User accounts: serves citizens
- Notification delivery → Notification records: creates
backend/services/notificationService.js - Notification delivery → User accounts: looks up recipients
backend/services/notificationService.js - Notification delivery → Email delivery: sends email
backend/services/notificationService.js - Complaint records → MongoDB: persisted in
- User accounts → MongoDB: persisted in