How rahulanugula/resq---ai works
ResQ AI is a disaster and emergency response platform for citizens, operators, and incident commanders. Citizens submit incidents, which the backend analyzes, checks for duplicates, identifies nearby response resources and hospitals, and returns dispatch information; operators manage incidents and resources while citizens and operators receive live updates. Separate capabilities cover authentication, analytics and administration, alerts, multilingual and voice assistance, family safety, volunteers, and risk mapping. The graph follows documented routing and source-index references; unsampled features are included where the README or tree supports them, without assuming their internal call paths.
Main entry points: database.py Database and Fallback · main.py FastAPI Application · emergencies.py Incident Reporting · websocket_manager.py WebSocket Manager
Components 26
User Experience
- Web Dashboards
frontend - Frontend API Client
frontend/js/api.js
Incident Response
- Incident Reporting
backend/routes/emergencies.py - Duplicate Detection
backend/services/duplicate_detector.py - Dispatch Routing
backend/ai/routing_service.py - Hospital Finder
backend/routes/hospitals.py - Live Feed Endpoint
backend/routes/websocket_routes.py - OSRM Routing Service
Operations
- Resource Management
backend/routes/resources.py - Administration
backend/routes/admin.py - Incident Analytics
backend/routes/analytics.py - Family Safety
backend/routes/family_safe.py - Volunteer Coordination
backend/routes/volunteers.py - Predictive Risk Map
backend/routes/riskmap.py
AI and Assistance
- Emergency AI Analysis
backend/ai/gemini_service.py - Public Alerts
backend/routes/alerts.py - Multilingual Support
backend/routes/multilingual.py - Voice and Chat
backend/routes/voice.py - Google Gemini
Platform Services
- FastAPI Application
backend/main.py - Authentication
backend/routes/auth.py - JWT and Roles
backend/middleware/auth_middleware.py - WebSocket Manager
backend/services/websocket_manager.py - Database and Fallback
backend/database.py
Other components
- Citizens
- Operators
Connections 38
- Citizens → Web Dashboards: use dashboards
README.md - Operators → Web Dashboards: use dashboards
README.md - Web Dashboards → Frontend API Client: request backend data
- Frontend API Client → FastAPI Application: call API
- FastAPI Application → Authentication: mounts router
backend/main.py - FastAPI Application → Incident Reporting: mounts router
backend/main.py - FastAPI Application → Resource Management: mounts router
backend/main.py - FastAPI Application → Hospital Finder: mounts router
backend/main.py - FastAPI Application → Incident Analytics: mounts router
backend/main.py - FastAPI Application → Administration: mounts router
backend/main.py - FastAPI Application → Live Feed Endpoint: mounts router
backend/main.py - Authentication → Database and Fallback: reads and writes users
backend/routes/auth.py - Authentication → JWT and Roles: uses token functions
backend/routes/auth.py - JWT and Roles → Database and Fallback: loads user
backend/middleware/auth_middleware.py - Incident Reporting → Database and Fallback: reads and writes incidents
backend/routes/emergencies.py - Incident Reporting → Emergency AI Analysis: analyzes reports
backend/routes/emergencies.py - Incident Reporting → Duplicate Detection: checks duplicates
backend/routes/emergencies.py - Incident Reporting → Dispatch Routing: requests route
backend/routes/emergencies.py - Incident Reporting → Hospital Finder: finds nearby hospitals
backend/routes/emergencies.py - Incident Reporting → WebSocket Manager: broadcasts updates
backend/routes/emergencies.py - Dispatch Routing → OSRM Routing Service: requests route
backend/ai/routing_service.py - Hospital Finder → Database and Fallback: reads hospital records
backend/routes/hospitals.py - Hospital Finder → Dispatch Routing: requests route
backend/routes/hospitals.py - Resource Management → Database and Fallback: manages resources
backend/routes/resources.py - Administration → Database and Fallback: manages platform data
backend/routes/admin.py - Incident Analytics → Database and Fallback: queries incident metrics
backend/routes/analytics.py - Public Alerts → Emergency AI Analysis: generates alert text
backend/routes/alerts.py - Public Alerts → WebSocket Manager: broadcasts alerts
backend/routes/alerts.py - Public Alerts → Database and Fallback: reads incident data
backend/routes/alerts.py - Multilingual Support → Database and Fallback: uses application data
- Voice and Chat → Emergency AI Analysis: requests AI responses
backend/routes/voice.py - Family Safety → Database and Fallback: stores safety updates
backend/routes/family_safe.py - Volunteer Coordination → Database and Fallback: manages volunteer records
backend/routes/volunteers.py - Predictive Risk Map → Database and Fallback: reads incident data
backend/routes/riskmap.py - Live Feed Endpoint → WebSocket Manager: connects clients
backend/routes/websocket_routes.py - WebSocket Manager → Operators: pushes live updates
- WebSocket Manager → Citizens: pushes live updates
- Emergency AI Analysis → Google Gemini: generates analysis