How dakshin10/roadsaftey_harrington_iitm works
RoadSOS combines a rider mobile app, a Flask emergency backend, and a command-center dashboard. The documented rider workflow is sensor-driven crash detection, a cancellable countdown, and an alert carrying location into incident tracking and response; the dashboard monitors incidents, dispatches resources, and reviews history and response analytics. The supplied mobile tree exposes only platform launch scaffolding, so its detection and SMS implementation cannot be mapped. Backend excerpts establish incident, dispatch, helper, and Firestore behavior; other documented capabilities are retained with cautious, unverified links.
Main entry points: App.js Dashboard shell · app.py HTTP API · firestore_service.py Firestore adapter · dispatch_service.py Resource dispatch
Components 28
Rider app
- Mobile client
app - Crash detection
app - Safety countdown
app - SMS alerts
app
Emergency backend
- HTTP API
backend/app.py - Incident routes
backend/routes/incident_routes.py - Severity scoring
backend/services/severity_service.py - Demo incidents
backend/routes/demo_routes.py - Incident lifecycle
backend/services/incident_service.py - Dispatch routes
backend/routes/dispatch_routes.py - Resource dispatch
backend/services/dispatch_service.py - Helper routes
backend/routes/helper_routes.py - Volunteer network
backend/services/helper_service.py - Socket events
backend/extensions.py
Command dashboard
- Dashboard shell
frontend_dashboard/src/App.js - Live alerts
frontend_dashboard/src/components/screens/LiveAlertsScreen.jsx - Map display
frontend_dashboard/src/components/MapView.js - Incident detail
frontend_dashboard/src/components/IncidentDetail.jsx - Alert history
frontend_dashboard/src/components/screens/AlertHistoryScreen.jsx - Nearby units
frontend_dashboard/src/components/screens/NearbyUnitsScreen.jsx - Statistics
frontend_dashboard/src/components/screens/StatisticsScreen.jsx - Settings
frontend_dashboard/src/components/screens/SettingsScreen.jsx - Dashboard API
frontend_dashboard/src/services/api.js - Dashboard sockets
frontend_dashboard/src/services/socket.js
Incident storage
- Firestore adapter
backend/services/firestore_service.py - Firestore
Other components
- Rider
- Command staff
Connections 36
- Rider → Mobile client: uses
- Mobile client → Crash detection: monitors sensors
- Crash detection → Safety countdown: starts
- Safety countdown → SMS alerts: escalates
- Safety countdown → HTTP API: sends alert
- Mobile client → HTTP API: updates location
- HTTP API → Incident routes: registers routes
backend/app.py - HTTP API → Resource dispatch: handles dispatch event
backend/app.py - HTTP API → Volunteer network: handles helper event
backend/app.py - Incident routes → Incident lifecycle: delegates
backend/routes/incident_routes.py - Incident routes → Firestore adapter: updates location
backend/routes/incident_routes.py - Incident lifecycle → Firestore adapter: reads and writes
backend/services/incident_service.py - Dispatch routes → Resource dispatch: delegates
backend/routes/dispatch_routes.py - Resource dispatch → Incident lifecycle: reads incident
backend/services/dispatch_service.py - Resource dispatch → Firestore adapter: records dispatch
backend/services/dispatch_service.py - Helper routes → Volunteer network: delegates
backend/routes/helper_routes.py - Helper routes → Socket events: emits acceptance
backend/routes/helper_routes.py - Volunteer network → Firestore adapter: reads and writes
backend/services/helper_service.py - Firestore adapter → Firestore: accesses
backend/services/firestore_service.py - Demo incidents → Severity scoring: computes score
backend/routes/demo_routes.py - Demo incidents → Firestore adapter: stores incident
backend/routes/demo_routes.py - Demo incidents → Socket events: emits demo event
backend/routes/demo_routes.py - Command staff → Dashboard shell: monitors
- Dashboard shell → Dashboard API: fetches incidents
frontend_dashboard/src/App.js - Dashboard shell → Dashboard sockets: subscribes
frontend_dashboard/src/App.js - Dashboard shell → Live alerts: renders
frontend_dashboard/src/App.js - Dashboard shell → Alert history: renders
frontend_dashboard/src/App.js - Dashboard shell → Nearby units: renders
frontend_dashboard/src/App.js - Dashboard shell → Statistics: renders
frontend_dashboard/src/App.js - Dashboard shell → Settings: renders
frontend_dashboard/src/App.js - Live alerts → Map display: renders
frontend_dashboard/src/components/screens/LiveAlertsScreen.jsx - Live alerts → Incident detail: renders
frontend_dashboard/src/components/screens/LiveAlertsScreen.jsx - Dashboard API → HTTP API: requests data
- Dashboard sockets → Socket events: receives events
- Alert history → Dashboard API: loads records
- Statistics → Dashboard API: loads metrics