How montasim2003/smart-sos-system works
Smart SOS is a citizen emergency-response system with user and provider portals, real-time SOS handling, and Android background location and crash detection. The main flow is citizen authentication, SOS creation with location/media, provider dispatch and tracking, and status updates. The graph also includes provider authentication, user-profile/device synchronization, and the native crash-detection path. Source excerpts show the app routing, some API calls, model use, and Android service interactions; several UI-to-backend and socket details are not visible, so those links are marked unverified or omitted.
Main entry points: index.js HTTP and socket API · App.jsx Portal router · ProviderDashboard.jsx Provider dashboard · UserApp.jsx Citizen SOS portal
Components 16
Web client
- Portal router
client/src/App.jsx - User authentication
client/src/components/UserLogin.jsx - Citizen SOS portal
client/src/components/UserApp.jsx - Crash detection UI
client/src/components/AutoCrashDetector.jsx - Provider authentication
client/src/components/ProviderLogin.jsx - Provider dashboard
client/src/components/ProviderDashboard.jsx
SOS backend
- HTTP and socket API
server/index.js
Android runtime
- Native activity bridge
client/android/app/src/main/java/com/smartsos/app/MainActivity.java - Location and crash service
client/android/app/src/main/java/LocationService.java
Domain data
- User records
server/models/User.js - Provider records
server/models/Provider.js - Emergency records
server/models/Emergency.js
Other components
- Citizen
- Emergency provider
- MongoDB
- Socket.IO clients
Connections 24
- Citizen → Portal router: opens portal
client/src/App.jsx - Portal router → User authentication: routes to
client/src/App.jsx - Portal router → Citizen SOS portal: routes to
client/src/App.jsx - Portal router → Provider authentication: routes to
client/src/App.jsx - Portal router → Provider dashboard: routes to
client/src/App.jsx - User authentication → HTTP and socket API: sends auth request
client/src/components/UserLogin.jsx - Provider authentication → HTTP and socket API: authenticates
- Citizen SOS portal → HTTP and socket API: SOS and profile requests
- Citizen SOS portal → Crash detection UI: uses detector
client/src/components/UserApp.jsx - Provider dashboard → Emergency provider: presents incidents
client/src/components/ProviderDashboard.jsx - Emergency provider → Provider dashboard: reviews and responds
client/src/components/ProviderDashboard.jsx - Provider dashboard → HTTP and socket API: socket and API requests
- HTTP and socket API → User records: reads and updates
server/index.js - HTTP and socket API → Provider records: reads and updates
server/index.js - HTTP and socket API → Emergency records: creates and updates
server/index.js - User records → MongoDB: persists records
- Provider records → MongoDB: persists records
- Emergency records → MongoDB: persists records
- HTTP and socket API → Socket.IO clients: dispatches events
- Socket.IO clients → Provider dashboard: delivers updates
- Portal router → Native activity bridge: runs on native
- Native activity bridge → Location and crash service: starts service
client/android/app/src/main/java/com/smartsos/app/MainActivity.java - Location and crash service → Native activity bridge: launches crash intent
client/android/app/src/main/java/LocationService.java - Location and crash service → HTTP and socket API: syncs device location
client/android/app/src/main/java/LocationService.java