How letask/jansetu_ai works
JanSetu AI is a civic grievance platform: citizens submit complaints with text, location, and photo evidence; the backend analyzes and routes them, while workers and officials manage resolution and the public can track progress. The graph includes the documented AI, assignment, escalation, role-dashboard, notification, and governance capabilities. Some feature implementations were not excerpted, so their internal links are omitted or marked unverified rather than inferred from names alone.
Main entry points: complaint_service.py Complaint Workflow · app.py Flask API · App.jsx Web App Router · api.js API Client
Components 32
Citizen and Staff UI
- Web App Router
frontend/src/App.jsx - Complaint Submission
frontend/src/pages/RegisterComplaint.jsx - Citizen Dashboard
frontend/src/pages/UserDashboard.jsx - Public Tracking
frontend/src/pages/PublicTracking.jsx - Worker Dashboard
frontend/src/pages/WorkerDashboard.jsx - Officer Dashboard
frontend/src/pages/DeptOfficerDashboard.jsx - Admin Dashboard
frontend/src/pages/AdminDashboard.jsx - Governance Dashboard
frontend/src/pages/GovernanceDashboard.jsx - API Client
frontend/src/services/api.js
API and Identity
- Flask API
backend/app.py - Authentication
backend/routes/auth_routes.py - Complaint Endpoints
backend/routes/complaint_routes.py
Complaint Triage
- Complaint Workflow
backend/services/complaint_service.py - Language Normalization
backend/services/normalization_service.py - Text Classification
backend/services/text_ai_service.py - Sentiment Analysis
backend/services/sentiment_service.py - Image Verification
backend/services/image_ai_service.py - Priority Engine
backend/services/priority_engine.py - Department Mapping
backend/services/department_mapper.py
Resolution Operations
- Smart Assignment
backend/services/smart_assignment.py - Worker Endpoints
backend/routes/worker_routes.py - Officer Endpoints
backend/routes/dept_officer_routes.py - Admin Oversight
backend/routes/admin_routes.py - Governance Data
backend/routes/governance_routes.py - Escalation Scanner
backend/services/escalation_service.py - Resolution Verification
backend/services/verification_service.py
Persistence and Alerts
- MongoDB
backend/database/mongo.py - In-app Notifications
backend/services/notification_service.py - Email Alerts
backend/services/email_service.py
Other components
- Citizen / Public
- Municipal Staff
- SMTP Service
Connections 46
- Citizen / Public → Web App Router: uses
- Municipal Staff → Web App Router: uses
- Web App Router → Complaint Submission: routes to
frontend/src/App.jsx - Web App Router → Citizen Dashboard: routes to
frontend/src/App.jsx - Web App Router → Public Tracking: routes to
frontend/src/App.jsx - Web App Router → Worker Dashboard: routes to
frontend/src/App.jsx - Web App Router → Admin Dashboard: routes to
frontend/src/App.jsx - Web App Router → Governance Dashboard: routes to
frontend/src/App.jsx - Complaint Submission → API Client: submits through
- Citizen Dashboard → API Client: requests data
- Public Tracking → API Client: requests status
- Worker Dashboard → API Client: requests tasks
frontend/src/pages/WorkerDashboard.jsx - Officer Dashboard → API Client: requests data
- Admin Dashboard → API Client: requests data
- Governance Dashboard → API Client: requests data
- API Client → Flask API: calls API
- Flask API → Authentication: registers
backend/app.py - Flask API → Complaint Endpoints: registers
backend/app.py - Flask API → Worker Endpoints: registers
backend/app.py - Flask API → Admin Oversight: registers
backend/app.py - Flask API → Officer Endpoints: registers
backend/app.py - Flask API → Governance Data: registers
backend/app.py - Flask API → Escalation Scanner: starts scanner
backend/app.py - Complaint Endpoints → Complaint Workflow: submits complaint
backend/routes/complaint_routes.py - Complaint Workflow → Language Normalization: normalizes text
backend/services/complaint_service.py - Complaint Workflow → Text Classification: classifies text
backend/services/complaint_service.py - Complaint Workflow → Sentiment Analysis: analyzes sentiment
backend/services/complaint_service.py - Complaint Workflow → Image Verification: verifies image
backend/services/complaint_service.py - Complaint Workflow → Priority Engine: calculates priority
backend/services/complaint_service.py - Complaint Workflow → Department Mapping: maps category
backend/services/complaint_service.py - Complaint Workflow → Smart Assignment: auto-assigns
backend/services/complaint_service.py - Complaint Workflow → MongoDB: stores complaint
backend/services/complaint_service.py - Worker Endpoints → Resolution Verification: checks resolution
backend/routes/worker_routes.py - Officer Endpoints → Smart Assignment: assigns worker
backend/routes/dept_officer_routes.py - Officer Endpoints → In-app Notifications: notifies worker
backend/routes/dept_officer_routes.py - Officer Endpoints → Email Alerts: emails updates
backend/routes/dept_officer_routes.py - Admin Oversight → MongoDB: reads and updates
backend/routes/admin_routes.py - Governance Data → MongoDB: reads statistics
backend/routes/governance_routes.py - Smart Assignment → MongoDB: reads and updates
backend/services/smart_assignment.py - Smart Assignment → In-app Notifications: notifies assignees
backend/services/smart_assignment.py - Smart Assignment → Email Alerts: sends assignment mail
backend/services/smart_assignment.py - Escalation Scanner → Smart Assignment: reassigns overdue
backend/services/escalation_service.py - Escalation Scanner → MongoDB: scans and updates
backend/services/escalation_service.py - Escalation Scanner → Email Alerts: alerts officers
backend/services/escalation_service.py - In-app Notifications → MongoDB: stores notifications
backend/services/notification_service.py - Email Alerts → SMTP Service: sends mail
backend/services/email_service.py