How swayam-was-here/chitragupta-ai works
Chitragupta AI monitors MPLADS-funded works: users upload CSV records, the backend validates and stores the file, requests row-level ML scoring, and returns risk results for dashboard triage and reporting. The dashboard also provides role-scoped overview, alerts, works, reports, and locally persisted compliance settings. The README documents both Isolation Forest and LOF signals; the sampled ML service implements Isolation Forest, so LOF is represented only as a documented capability. Dashboard-to-backend and backend-to-service links follow the README and shown calls; unsampled page internals are not inferred.
Main entry points: App.tsx Dashboard routes · analysis.py CSV validation and scoring orchestration · ChitraGupta_Ai_api/app.py ML inference API · backend/app.py Flask API
Components 21
Dashboard
- Dashboard routes
apps/dashboard/src/App.tsx - Public home
apps/dashboard/src/pages/Home.tsx - Login
apps/dashboard/src/pages/Login.tsx - Dashboard shell
apps/dashboard/src/components/dashboard/DashboardLayout.tsx
Upload and API
- Works and upload
apps/dashboard/src/pages/dashboard/Works.tsx - Flask API
apps/backend/app.py - CSV validation and scoring orchestration
apps/backend/routes/analysis.py - Supabase Storage
- Supabase records
Anomaly scoring
- ML inference API
ChitraGupta_Ai_api/app.py - Feature engineering
ChitraGupta_Ai_api/app.py - Isolation Forest
ChitraGupta_Ai_api/app.py - LOF signal
Review and reporting
- Overview
apps/dashboard/src/pages/dashboard/Overview.tsx - Alerts triage
apps/dashboard/src/pages/dashboard/Alerts.tsx - Reports
apps/dashboard/src/pages/dashboard/Reports.tsx
Role and settings
- Compliance settings
apps/dashboard/src/pages/dashboard/Settings.tsx - Role scoping
apps/dashboard/src/lib/roleFilter.ts - Active role
apps/dashboard/src/stores/useRoleStore.ts - Persisted thresholds
apps/dashboard/src/stores/useSettingsStore.ts
Other components
- MP / DM / Auditor
Connections 26
- MP / DM / Auditor → Dashboard routes: uses
README.md - Dashboard routes → Public home: routes to
apps/dashboard/src/App.tsx - Dashboard routes → Login: routes to
apps/dashboard/src/App.tsx - Dashboard routes → Dashboard shell: protects and routes
apps/dashboard/src/App.tsx - Dashboard routes → Overview: routes to
apps/dashboard/src/App.tsx - Dashboard routes → Alerts triage: routes to
apps/dashboard/src/App.tsx - Dashboard routes → Works and upload: routes to
apps/dashboard/src/App.tsx - Dashboard routes → Reports: routes to
apps/dashboard/src/App.tsx - Dashboard routes → Compliance settings: routes to
apps/dashboard/src/App.tsx - Works and upload → Flask API: POSTs CSV
README.md - Flask API → CSV validation and scoring orchestration: registers routes
apps/backend/app.py - CSV validation and scoring orchestration → Supabase Storage: uploads file
apps/backend/routes/analysis.py - CSV validation and scoring orchestration → ML inference API: requests row scores
apps/backend/routes/analysis.py - ML inference API → Feature engineering: engineers features
ChitraGupta_Ai_api/app.py - ML inference API → Isolation Forest: predicts anomaly
ChitraGupta_Ai_api/app.py - CSV validation and scoring orchestration → Works and upload: returns scores
README.md - MP / DM / Auditor → Overview: reviews metrics
README.md - MP / DM / Auditor → Alerts triage: triages alerts
README.md - MP / DM / Auditor → Reports: reviews reports
README.md - Active role → Role scoping: selects scope
README.md - Role scoping → Overview: filters data
README.md - Role scoping → Reports: filters data
README.md - Compliance settings → Persisted thresholds: updates thresholds
README.md - MP / DM / Auditor → Compliance settings: configures thresholds
README.md - ML inference API → LOF signal: pairs with
README.md - Flask API → Supabase records: tests connection
apps/backend/app.py