How sudhanshuxmaurya119-eng/raksha_x works
RakshaX combines an Android personal-safety app with a FastAPI backend. The user workflow spans BLE emergency-button detection, location capture, SOS escalation to trusted contacts, and backend notification delivery; the app also exposes account, safety-map, incident, and safe-routing capabilities. Backend safety intelligence combines incident data with weather and other feeds. The graph uses README and SOURCE INDEX relationships where available; several implementations are unsampled, so their internal calls are not expanded.
Main entry points: main.py FastAPI application · MainActivity.kt Android entry · AuroraSafeRepository.kt Backend client · BleSosListenerService.kt BLE listener
Components 33
Android app
- Android entry
Frontend/app/src/main/java/com/rakshax/app/MainActivity.kt - App navigation
Frontend/app/src/main/java/com/rakshax/app/ui/navigation/RakshaXNavGraph.kt - Safety screens
Frontend/app/src/main/java/com/rakshax/app/ui/screens - BLE connection
Frontend/app/src/main/java/com/rakshax/app/data/ble/BleRepository.kt - BLE listener
Frontend/app/src/main/java/com/rakshax/app/service/BleSosListenerService.kt - Location capture
Frontend/app/src/main/java/com/rakshax/app/data/location/LocationRepository.kt - App safety state
Frontend/app/src/main/java/com/rakshax/app/data/repository/MockDataRepository.kt - SOS escalation
Frontend/app/src/main/java/com/rakshax/app/service/SosEscalationService.kt - Push handling
Frontend/app/src/main/java/com/rakshax/app/notification/RakshaFirebaseMessagingService.kt - Backend client
Frontend/app/src/main/java/com/rakshax/app/data/remote/AuroraSafeRepository.kt
Backend API
- FastAPI application
Backend/main.py - Authentication
Backend/routers/auth.py - SOS endpoints
Backend/routers/sos.py - Incident endpoints
Backend/routers/incidents.py - Safe routing
Backend/routers/routes.py - Safety endpoints
Backend/routers/safety.py - Dashboard endpoints
Backend/routers/dashboard.py - Notification endpoints
Backend/routers/notifications.py - FCM delivery
Backend/services/fcm.py
Safety intelligence
- Risk model
Backend/ml/risk_model.py - Incident classifier
Backend/ml/classifier.py - Map data service
Backend/services/osm_service.py - Weather service
Backend/services/weather_service.py
Data ingestion
- Refresh scheduler
Backend/services/scheduler.py - News ingestion
Backend/services/news_fetcher.py
Persistence
- Database session
Backend/database.py - Incident records
Backend/models/incident.py - User records
Backend/models/user.py - SOS records
Backend/models/sos_event.py - Contact and route records
Backend/models/sos_contact.py
Other components
- App user
- ESP32 button
- External data and push services
Connections 41
- App user → Android entry: uses
README.md - ESP32 button → BLE connection: signals over BLE
README.md - Android entry → App navigation: starts
Frontend/app/src/main/java/com/rakshax/app/MainActivity.kt - App navigation → Safety screens: routes to
Frontend/app/src/main/java/com/rakshax/app/ui/navigation/RakshaXNavGraph.kt - Android entry → BLE connection: initializes
Frontend/app/src/main/java/com/rakshax/app/MainActivity.kt - Android entry → BLE listener: starts
Frontend/app/src/main/java/com/rakshax/app/MainActivity.kt - BLE listener → BLE connection: uses
Frontend/app/src/main/java/com/rakshax/app/service/BleSosListenerService.kt - BLE listener → Location capture: captures location
Frontend/app/src/main/java/com/rakshax/app/service/BleSosListenerService.kt - BLE listener → Backend client: triggers SOS
Frontend/app/src/main/java/com/rakshax/app/service/BleSosListenerService.kt - BLE listener → SOS escalation: starts
Frontend/app/src/main/java/com/rakshax/app/service/BleSosListenerService.kt - Android entry → Location capture: creates
Frontend/app/src/main/java/com/rakshax/app/MainActivity.kt - Android entry → Backend client: creates
Frontend/app/src/main/java/com/rakshax/app/MainActivity.kt - Android entry → App safety state: reads contacts
Frontend/app/src/main/java/com/rakshax/app/MainActivity.kt - Android entry → Backend client: flushes queued actions
Frontend/app/src/main/java/com/rakshax/app/MainActivity.kt - Backend client → FastAPI application: calls API
README.md - Backend client → External data and push services: registers push device
- FastAPI application → Database session: initializes
Backend/main.py - FastAPI application → Authentication: registers router
Backend/main.py - FastAPI application → SOS endpoints: registers router
Backend/main.py - FastAPI application → Incident endpoints: registers router
Backend/main.py - FastAPI application → Safe routing: registers router
Backend/main.py - FastAPI application → Safety endpoints: registers router
Backend/main.py - FastAPI application → Dashboard endpoints: registers router
Backend/main.py - FastAPI application → Notification endpoints: registers router
Backend/main.py - FastAPI application → Refresh scheduler: starts
Backend/main.py - Incident endpoints → Incident classifier: classifies reports
Backend/routers/incidents.py - Incident endpoints → Risk model: scores risk
Backend/routers/incidents.py - Safe routing → Incident records: loads red zones
Backend/routers/routes.py - Safe routing → External data and push services: requests road routes
Backend/routers/routes.py - Refresh scheduler → News ingestion: schedules fetches
Backend/services/scheduler.py - Refresh scheduler → Weather service: schedules refresh
Backend/services/scheduler.py - News ingestion → Map data service: uses map service
Backend/services/news_fetcher.py - SOS endpoints → FCM delivery: sends alerts
Backend/routers/sos.py - FCM delivery → External data and push services: delivers push
- SOS endpoints → SOS records: records SOS
Backend/routers/sos.py - SOS endpoints → Contact and route records: uses contact records
Backend/routers/sos.py - Authentication → User records: authenticates
Backend/routers/auth.py - Incident endpoints → Incident records: uses incidents
Backend/routers/incidents.py - Database session → Incident records: registers model
Backend/database.py - Database session → User records: registers model
Backend/database.py - Push handling → Backend client: uses API
Frontend/app/src/main/java/com/rakshax/app/notification/RakshaFirebaseMessagingService.kt