How arunachalam-2006/safe-her works
Safe-Her is a cross-platform personal-safety app backed by a FastAPI engine. The main journey is: a person checks nearby safety or plans a destination, the app requests safety data and route analysis, and the engine combines map, weather, and scoring services to return assessments. Other documented workflows include SOS alerts and live location, community reports and journey monitoring, plus government review of reports and SOS. The README documents several engine integrations not shown in source excerpts; those relationships are identified as documented rather than inferred from unsampled code.
Main entry points: main.py FastAPI engine · safety.py Route analysis API · SOSActiveScreen.jsx Active SOS screen · safetyApi.js Safety API client
Components 28
Safety app
- Safety home
app/(tabs)/index.jsx - Route planning
app/(tabs)/routes.jsx - Journey monitoring
app/(tabs)/journey.jsx - Safety API client
lib/safetyApi.js - Location services
lib/location.js
Emergency response
- SOS workflow
lib/sos.js - Active SOS screen
components/SOSActiveScreen.jsx - Emergency contacts
lib/emergencyContacts.js - Background tracking
lib/backgroundLocationTask.js - Alert sharing
lib/alertSharing.js
Safety engine
- FastAPI engine
safety-engine/main.py - Spot safety route
safety-engine/routes/spot_safety.py - Route analysis API
safety-engine/routes/safety.py - Safety scoring
safety-engine/engine/ruleBasedScoring.py - Feature extraction
safety-engine/services/feature_service.py - Route provider
safety-engine/services/osrm_service.py - OSM data service
safety-engine/services/overpass_service.py - Weather service
safety-engine/services/weather_service.py
Community and civic
- Hazard reports
safety-engine/routes/reports.py - Journey records
safety-engine/routes/journeys.py - Government dashboard
app/(gov)/index.jsx - Government API client
lib/government/govApi.js - Government endpoints
safety-engine/routes/government.py - Engine persistence
safety-engine/db.py
Other components
- App user
- OSRM
- OpenStreetMap
- Open-Meteo
Connections 35
- App user → Safety home: checks safety
README.md - App user → Route planning: plans route
README.md - Safety home → Safety API client: requests spot data
app/(tabs)/index.jsx - Safety home → SOS workflow: requests SOS
app/(tabs)/index.jsx - Route planning → Location services: searches and routes
app/(tabs)/routes.jsx - Route planning → Safety API client: analyzes route
app/(tabs)/routes.jsx - Safety API client → FastAPI engine: sends API requests
- Safety API client → Location services: gets location
lib/safetyApi.js - FastAPI engine → Spot safety route: registers route
safety-engine/main.py - FastAPI engine → Route analysis API: registers route
safety-engine/main.py - Spot safety route → OSM data service: queries nearby places
safety-engine/routes/spot_safety.py - Spot safety route → Weather service: fetches conditions
safety-engine/routes/spot_safety.py - Route analysis API → Route provider: requests route options
README.md - Route analysis API → OSM data service: gets map features
README.md - Route analysis API → Weather service: gets weather factors
README.md - Route analysis API → Feature extraction: normalizes features
README.md - Route analysis API → Safety scoring: scores routes
README.md - Route provider → OSRM: queries routes
README.md - OSM data service → OpenStreetMap: queries map data
safety-engine/services/overpass_service.py - Weather service → Open-Meteo: fetches weather
README.md - App user → Active SOS screen: confirms alert
README.md - Active SOS screen → SOS workflow: activates SOS
components/SOSActiveScreen.jsx - SOS workflow → Emergency contacts: loads contacts
lib/sos.js - SOS workflow → Background tracking: starts tracking
lib/sos.js - Active SOS screen → Background tracking: reads latest location
components/SOSActiveScreen.jsx - Active SOS screen → Alert sharing: shares alert
components/SOSActiveScreen.jsx - App user → Journey monitoring: monitors journey
README.md - App user → Hazard reports: submits hazard
README.md - App user → Government dashboard: reviews incidents
README.md - Government dashboard → Government API client: loads reports and SOS
app/(gov)/index.jsx - Government API client → Government endpoints: calls endpoints
lib/government/govApi.js - FastAPI engine → Hazard reports: registers route
safety-engine/main.py - FastAPI engine → Journey records: registers route
safety-engine/main.py - FastAPI engine → Government endpoints: registers route
safety-engine/main.py - Government endpoints → Engine persistence: uses persistence
safety-engine/routes/government.py