How yuchirozen/safehub works
SAFEHUB is an emergency shelter and disaster-response platform spanning an ESP32 sensor node, an API gateway, Firebase services, and a role-based web app. The main user flow is: sign in, view live emergency conditions, find a suitable shelter or evacuation window, and request help; staff, helpers, medical volunteers, rescue teams, and administrators coordinate response through separate dashboards. The graph preserves major documented capabilities, including shelter management, alerts, hardware simulation, and facility discovery. Several page and backend implementations were not sampled, so those feature relationships rely on README documentation rather than inspected implementation.
Main entry points: App.tsx App Router & Live State · index.ts Ingestion Gateway · EmergencyHome.tsx Emergency Dashboard · SheltersPage.tsx Shelter Discovery
Components 26
Field Devices
- ESP32 Node
firmware/SafeHub_ESP32_Node.ino - Hardware Simulator
src/components/HardwareSimulator.tsx
Cloud Services
- Ingestion Gateway
server/index.ts - Firebase Auth & Firestore
Evacuation & Aid
- Emergency Dashboard
src/pages/EmergencyHome.tsx - Shelter Discovery
src/pages/SheltersPage.tsx - Shelter Details
src/pages/ShelterDetailsPage.tsx - Shelter Suitability
src/utils/suitability.ts - Evacuation Guidance
src/pages/EvacuationGuidancePage.tsx - Departure Window Engine
src/utils/evacuation.ts - Assistance Requests
src/pages/RequestAssistancePage.tsx - Emergency SOS
src/components/SosModal.tsx
Response Operations
- Live Alerts
src/pages/LiveAlerts.tsx - Notifications
src/pages/NotificationsPage.tsx - Helper Dispatch
src/pages/HelpersPage.tsx - Medical Help
src/pages/MedicalHelpPage.tsx - Shelter Operations
src/pages/ShelterManagementPage.tsx - Rescue Command
src/pages/RescueDashboard.tsx - Administration
src/pages/AdminDashboard.tsx
Web Platform
- Authentication
src/services/auth.ts - Realtime Data Access
src/services/db.ts - App Router & Live State
src/App.tsx - Sign-in & Registration
src/pages/AuthPage.tsx - User Profile
src/pages/ProfilePage.tsx
Other components
- Residents & Responders
- SerpAPI Places
Connections 28
- ESP32 Node → Ingestion Gateway: sends telemetry
README.md - Hardware Simulator → App Router & Live State: provides controls
src/App.tsx - Ingestion Gateway → Firebase Auth & Firestore: ingests data
README.md - Ingestion Gateway → SerpAPI Places: queries places
README.md - App Router & Live State → Authentication: wraps auth
src/App.tsx - Authentication → Firebase Auth & Firestore: authenticates and stores profiles
src/services/auth.ts - App Router & Live State → Realtime Data Access: subscribes to live data
src/App.tsx - Realtime Data Access → Firebase Auth & Firestore: reads and writes
- App Router & Live State → Emergency Dashboard: routes to
src/App.tsx - App Router & Live State → Shelter Discovery: routes to
src/App.tsx - App Router & Live State → Shelter Details: routes to
src/App.tsx - App Router & Live State → Evacuation Guidance: routes to
src/App.tsx - App Router & Live State → Assistance Requests: routes to
src/App.tsx - App Router & Live State → Emergency SOS: renders
src/App.tsx - App Router & Live State → Live Alerts: routes to
src/App.tsx - App Router & Live State → Notifications: routes to
src/App.tsx - App Router & Live State → Helper Dispatch: routes to
src/App.tsx - App Router & Live State → Medical Help: routes to
src/App.tsx - App Router & Live State → Shelter Operations: routes to
src/App.tsx - App Router & Live State → Rescue Command: routes to
src/App.tsx - App Router & Live State → Administration: routes to
src/App.tsx - App Router & Live State → Sign-in & Registration: routes to
src/App.tsx - App Router & Live State → User Profile: routes to
src/App.tsx - Residents & Responders → App Router & Live State: uses web app
- Emergency Dashboard → Shelter Suitability: recommends shelters
- Shelter Discovery → Shelter Suitability: ranks options
- Evacuation Guidance → Departure Window Engine: computes departure window
- SerpAPI Places → Ingestion Gateway: returns place results