How shadowincache/safeher works
SafeHer is a wearable-assisted emergency safety platform. Its primary flow is threat detection on a paired glove or phone, followed by threat fusion and an SOS incident, then independent contact fan-out and status reporting. The backend also provides authentication, journeys, nearby-safety tools, incident evidence and reports, and privacy controls. The README documents mobile and wearable behavior, but Flutter source is absent from the supplied tree; unsampled backend subsystems are shown at their listed paths. Connections are limited to excerpted references or README-documented flows.
Main entry points: mobile Mobile app · alerts.py Alert routes · emergency_dispatch.py Emergency dispatch · main.py FastAPI app
Components 25
Mobile and wearables
- Mobile app
mobile - Smart glove
glove/firmware/SafeHer_Glove_V5_OnDevice/safeher_v5_model.cpp - Smart glasses
glasses/firmware/legacy_noise_alarm/thingProperties.h
Backend API
- FastAPI app
fastapi_app/main.py - Authentication routes
fastapi_app/routers/auth.py - Realtime messaging
fastapi_app/realtime.py
Detection and response
- Alert routes
fastapi_app/routers/alerts.py - Threat fusion
fastapi_app/services/threat_fusion.py - Emergency dispatch
fastapi_app/services/emergency_dispatch.py - Safe journeys
fastapi_app/routers/journeys.py - Nearby safety
fastapi_app/routers/safety.py - Incident reports
fastapi_app/routers/incidents.py - Evidence media
fastapi_app/routers/media.py - Event processor client
fastapi_app/services/processor_client.py
Identity and records
- User records
fastapi_app/repositories/users.py - Emergency contacts
fastapi_app/repositories/emergency_contacts.py - Auth security
fastapi_app/repositories/auth_security.py - Data models
fastapi_app/models.py - Database
fastapi_app/db.py
External services
- Evidence storage
fastapi_app/services/evidence_store.py - Event processor
deployment/docker/safeher_event_processor.py - SMS, email, push
fastapi_app/services/notifications.py
Other components
- SafeHer user
- Emergency contacts
- Maps and providers
Connections 28
- SafeHer user → Mobile app: uses
- Smart glove → Mobile app: sends motion by BLE
- Smart glasses → Mobile app: streams video
- Mobile app → FastAPI app: REST and JWT
- FastAPI app → Mobile app: WebSocket and FCM
- FastAPI app → Authentication routes: routes requests
fastapi_app/main.py - FastAPI app → Alert routes: routes requests
fastapi_app/main.py - SafeHer user → Alert routes: triggers SOS
- Alert routes → Threat fusion: evaluates signals
fastapi_app/routers/alerts.py - Alert routes → Event processor client: submits threat
fastapi_app/routers/alerts.py - Event processor client → Event processor: posts threat
fastapi_app/services/processor_client.py - Alert routes → Emergency dispatch: dispatches alert
fastapi_app/routers/alerts.py - Emergency dispatch → Emergency contacts: loads recipients
fastapi_app/services/emergency_dispatch.py - Emergency dispatch → SMS, email, push: sends notifications
fastapi_app/services/emergency_dispatch.py - SMS, email, push → Emergency contacts: fans out SMS, email, push
- Emergency dispatch → Realtime messaging: publishes updates
fastapi_app/services/emergency_dispatch.py - Mobile app → Safe journeys: manages journeys
- Mobile app → Nearby safety: finds nearby safety
- Mobile app → Incident reports: views incident history
- Mobile app → Evidence media: captures evidence
- Evidence media → Evidence storage: stores evidence
- Authentication routes → User records: reads and creates users
fastapi_app/routers/auth.py - Authentication routes → Auth security: manages security state
fastapi_app/routers/auth.py - Alert routes → Database: persists incidents
fastapi_app/routers/alerts.py - Emergency dispatch → Database: updates dispatch state
fastapi_app/services/emergency_dispatch.py - Database → Data models: maps records
fastapi_app/db.py - Safe journeys → Maps and providers: uses location services
- Nearby safety → Maps and providers: queries nearby places