How ishan-debugg/lok-seva-ai works
Lok Seva AI is a civic grievance intake, classification, routing, and resolution-tracking platform. Citizens submit complaints through the Streamlit portal; the Node/Express API checks for duplicates, requests department classification from the Flask service, assigns priority and a deadline, then stores the complaint in PostgreSQL. Users can track complaints, while officials manage status and review operational and SLA views. The repository also exposes feedback and language-detection capabilities. The README documents the ML pipeline; unsampled frontend pages are represented by their exact tree paths, with only documented capabilities and sampled wiring linked.
Main entry points: frontend/app.py Streamlit Router · server.js Express Server · complaintController.js Complaint Controller · ml-service/app.py Prediction API
Components 24
Citizen and Official Portal
- Streamlit Router
frontend/app.py - Portal Home
frontend/pages/home.py - Complaint Portal
frontend/pages/user_portal.py - Complaint Tracking
frontend/pages/track_complaint.py - Official Login
frontend/pages/login.py - Session Auth
frontend/utils/auth.py - Department Dashboard
frontend/pages/official_dashboard.py - Admin Dashboard
frontend/pages/admin_dashboard.py - Manager Dashboard
frontend/pages/manager_dashboard.py - SLA Dashboard
frontend/pages/sla_dashboard.py
Complaint API
- Express Server
backend/server.js - Complaint Routes
backend/routes/complaintRoutes.js - Complaint Controller
backend/controllers/complaintController.js
Classification Service
- Prediction API
ml-service/app.py - Text Preprocessing
ml-service/preprocess.py - Category Prediction
ml-service/predict.py - Model Training
ml-service/train.py - Language Detection
ml-service/app.py
Persistence and SLA
- SLA Monitoring
backend/services/slaService.js - Database Client
backend/config/db.js - PostgreSQL
database/schema.sql - Evidence Uploads
backend/uploads
Other components
- Citizen
- Municipal Official
Connections 32
- Citizen → Portal Home: opens portal
- Portal Home → Streamlit Router: selects service
- Municipal Official → Official Login: signs in
- Official Login → Session Auth: checks credentials
- Streamlit Router → Complaint Portal: dispatches page
- Streamlit Router → Complaint Tracking: dispatches page
- Streamlit Router → Official Login: dispatches page
- Streamlit Router → Department Dashboard: dispatches page
- Streamlit Router → Admin Dashboard: dispatches page
- Streamlit Router → Manager Dashboard: dispatches page
- Streamlit Router → SLA Dashboard: dispatches page
- Complaint Portal → Express Server: submits complaint
- Complaint Tracking → Express Server: requests status
- Department Dashboard → Express Server: manages complaints
- Admin Dashboard → Express Server: uses API
- Manager Dashboard → Express Server: lists and updates
- SLA Dashboard → Express Server: requests SLA views
- Express Server → Complaint Routes: mounts routes
- Complaint Routes → Complaint Controller: dispatches requests
- Complaint Controller → Database Client: queries complaints
- Database Client → PostgreSQL: reads and writes
- Complaint Controller → Prediction API: requests category
- Prediction API → Text Preprocessing: preprocesses text
- Prediction API → Category Prediction: predicts category
- Express Server → SLA Monitoring: schedules checks
- Complaint Controller → SLA Monitoring: requests SLA data
- SLA Monitoring → Database Client: queries and updates
- Complaint Routes → Evidence Uploads: stores evidence
- Complaint Controller → Evidence Uploads: records image path
- Model Training → Category Prediction: trains model
- Complaint Controller → PostgreSQL: stores feedback
- Prediction API → Language Detection: offers language endpoint