How karthikbhatanthara-stack/civic-app works
CivicAI is a civic-issue reporting and municipal-workflow application: residents report and track local problems, while staff verify, route, and manage complaints. A report can be captured with location and an image, checked for authenticity and analyzed by a pluggable detector, then followed through verification and resolution; dashboards expose citizen and administrative views. The backend is Flask over PostgreSQL, served through an ASGI adapter, with a React frontend. Some frontend pages and backend subsystems are indexed but unsampled, so their internal links are omitted; the frontend-to-backend link is shown as unverified.
Main entry points: App.tsx Route shell · app.py Flask application · issues.py Issue lifecycle · db.py PostgreSQL access
Components 28
Web experience
- Route shell
frontend/src/App.tsx - Home
frontend/src/pages/Home.tsx - Login and register
frontend/src/pages/Login.tsx - Citizen dashboard
frontend/src/pages/CitizenDashboard.tsx - Report issue
frontend/src/pages/ReportIssue.tsx - Track issue
frontend/src/pages/TrackIssue.tsx - Issue details
frontend/src/pages/IssueDetails.tsx - Admin dashboard
frontend/src/pages/AdminDashboard.tsx - App shell
frontend/src/components/layout/AppShell.tsx - Live capture
frontend/src/components/common/LiveCameraCapture.tsx - Issue maps
frontend/src/components/maps/LeafletIssueMap.tsx - Status timeline
frontend/src/components/common/StatusTimeline.tsx - Typed API client
frontend/src/lib/api.ts
Identity
- Auth endpoints
backend/civicai/api/auth.py - Session and guards
backend/civicai/auth.py
Reporting and AI
- Flask application
backend/civicai/app.py - Issue lifecycle
backend/civicai/api/issues.py - Capture authenticity
backend/civicai/detection/authenticity.py - Detection engine
backend/civicai/detection/engine.py - Heuristic detector
backend/civicai/detection/heuristics.py - YOLO detector
backend/civicai/detection/yolo.py - Severity and routing
backend/civicai/detection/routing.py
Municipal operations
- Metadata endpoints
backend/civicai/api/meta.py - Statistics endpoints
backend/civicai/api/stats.py - Email notifications
backend/civicai/emailer.py
Persistence
- PostgreSQL access
backend/civicai/db.py
Other components
- Resident / staff
- Municipal staff
Connections 34
- Resident / staff → Route shell: uses
- Route shell → App shell: renders
frontend/src/App.tsx - Route shell → Home: routes
frontend/src/App.tsx - Route shell → Login and register: routes
frontend/src/App.tsx - Route shell → Citizen dashboard: routes
frontend/src/App.tsx - Route shell → Report issue: routes
frontend/src/App.tsx - Route shell → Track issue: routes
frontend/src/App.tsx - Route shell → Issue details: routes
frontend/src/App.tsx - Route shell → Admin dashboard: routes
frontend/src/App.tsx - Report issue → Live capture: uses
- Citizen dashboard → Issue maps: uses
- Admin dashboard → Issue maps: uses
- Issue details → Status timeline: uses
- Route shell → Typed API client: requests through
- Typed API client → Flask application: calls API
- Flask application → Auth endpoints: registers
backend/civicai/app.py - Flask application → Issue lifecycle: registers
backend/civicai/app.py - Flask application → Metadata endpoints: registers
backend/civicai/app.py - Flask application → Statistics endpoints: registers
backend/civicai/app.py - Flask application → PostgreSQL access: initializes
backend/civicai/app.py - Auth endpoints → Session and guards: uses
backend/civicai/api/auth.py - Auth endpoints → PostgreSQL access: queries and writes
backend/civicai/api/auth.py - Issue lifecycle → Session and guards: guards routes
backend/civicai/api/issues.py - Issue lifecycle → Capture authenticity: checks capture
backend/civicai/api/issues.py - Issue lifecycle → Detection engine: analyzes image
backend/civicai/api/issues.py - Issue lifecycle → PostgreSQL access: reads and writes
backend/civicai/api/issues.py - Issue lifecycle → Email notifications: notifies
backend/civicai/api/issues.py - Detection engine → Heuristic detector: falls back to
backend/civicai/detection/engine.py - Detection engine → YOLO detector: selects
backend/civicai/detection/engine.py - Heuristic detector → Severity and routing: uses
backend/civicai/detection/heuristics.py - YOLO detector → Severity and routing: uses
backend/civicai/detection/yolo.py - Metadata endpoints → PostgreSQL access: queries
backend/civicai/api/meta.py - Statistics endpoints → PostgreSQL access: queries
backend/civicai/api/stats.py - Municipal staff → Route shell: uses