How triyanshag777/jalmarg works
JalMarg combines a municipal operations dashboard with a FastAPI service for citizen flood reports, hotspot risk assessment, flood-aware routing, and human-reviewed dispatch plans. The main path is a citizen submitting an image report, the report orchestrator coordinating verification and analysis, and resulting data informing hotspot risk and authority decisions. Separate dashboard functions expose map, weather, routing, and approval workflows. The graph reflects documented endpoints and the sampled backend relationships; frontend-to-API calls and several unsampled integrations are not asserted where their wiring is not shown.
Main entry points: agent_tools.py Agent tools · crud.py Persistence operations · main.py API application · route_service.py Route exposure scoring
Components 28
Operations dashboard
- Report submission
frontend/src/app/report/page.tsx - Flood map
frontend/src/components/map/FloodMap.tsx - Hotspot details
frontend/src/components/HotspotDetailPanel.tsx - Route comparison
frontend/src/app/routes/page.tsx - Authority console
frontend/src/app/authority/page.tsx
Backend API
- API application
backend/app/main.py - Report endpoints
backend/app/api/reports.py - Hotspot endpoints
backend/app/api/hotspots.py - Weather and risk API
backend/app/api/weather.py - Routing endpoint
backend/app/api/routing.py - Dispatch approval API
backend/app/api/admin.py
Report and risk analysis
- Report orchestrator
backend/app/services/orchestrator.py - Report workflow
backend/app/services/workflow.py - Image verification
backend/app/services/image_verification.py - Vision analysis
backend/app/services/gemini_vision.py - Agent tools
backend/app/services/agent_tools.py - Weather retrieval
backend/app/services/weather_service.py - Risk scoring
backend/app/services/risk_service.py
Routing and dispatch
- Route exposure scoring
backend/app/services/route_service.py - Civic information retrieval
backend/app/services/tinyfish_service.py
Data persistence
- SQLite database
backend/app/db/models.py - Persistence operations
backend/app/db/crud.py - Demo data initialization
backend/app/seed/seed_data.py
Other components
- Citizen
- Authority operator
- OSRM routing
- Open-Meteo
- Gemini
Connections 31
- Citizen → Report submission: submits report
- Authority operator → Authority console: reviews plans
- API application → Report endpoints: mounts routes
backend/app/main.py - API application → Hotspot endpoints: mounts routes
backend/app/main.py - API application → Weather and risk API: mounts routes
backend/app/main.py - API application → Routing endpoint: mounts routes
backend/app/main.py - API application → Dispatch approval API: mounts routes
backend/app/main.py - Report endpoints → Report orchestrator: invokes
backend/app/api/reports.py - Report orchestrator → Agent tools: uses tools
backend/app/services/orchestrator.py - Report workflow → Image verification: uses
backend/app/services/workflow.py - Report workflow → Vision analysis: uses
backend/app/services/workflow.py - Agent tools → Image verification: uses
backend/app/services/agent_tools.py - Agent tools → Vision analysis: uses
backend/app/services/agent_tools.py - Agent tools → Weather retrieval: uses
backend/app/services/agent_tools.py - Agent tools → Risk scoring: uses
backend/app/services/agent_tools.py - Agent tools → Route exposure scoring: uses
backend/app/services/agent_tools.py - Agent tools → Civic information retrieval: uses
backend/app/services/agent_tools.py - Vision analysis → Gemini: analyzes images
- Weather retrieval → Open-Meteo: fetches forecast
backend/app/services/weather_service.py - Weather and risk API → Weather retrieval: refreshes weather
backend/app/api/weather.py - Weather and risk API → Risk scoring: recalculates risk
backend/app/api/weather.py - Risk scoring → Persistence operations: reads reports
backend/app/services/risk_service.py - Routing endpoint → Route exposure scoring: requests candidates
backend/app/api/routing.py - Route exposure scoring → OSRM routing: fetches routes
backend/app/services/route_service.py - Route exposure scoring → Persistence operations: loads hotspots
backend/app/services/route_service.py - Report endpoints → Persistence operations: persists reports
backend/app/api/reports.py - Hotspot endpoints → Persistence operations: queries hotspots
backend/app/api/hotspots.py - Dispatch approval API → Persistence operations: updates plans
backend/app/api/admin.py - Persistence operations → SQLite database: reads and writes
backend/app/db/crud.py - Demo data initialization → SQLite database: seeds records
backend/app/seed/seed_data.py - Demo data initialization → Risk scoring: calculates initial risk
backend/app/seed/seed_data.py