How congminhvt2003/healthymonitor works
Healthy Monitor is a React Native app for live heart-rate and blood-oxygen monitoring, threshold alerts, emergency contact actions, account access, and health-history review. The principal flow starts the monitor at app launch, receives measurements, updates shared health state, and reacts to critical readings with stored alerts and an SOS sequence. History, reports, authentication, settings, and theming are represented as distinct capabilities. Several screen and service implementations were not sampled, so uncertain wiring—especially report generation and screen-to-service calls—is left out.
Main entry points: HeartMonitorController.ts Monitor controller · AppNavigator.tsx Navigation · App.tsx App entry · alertService.ts Alert service
Components 24
App shell
- App entry
App.tsx - Navigation
src/navigation/AppNavigator.tsx
Live monitoring
- Live dashboard
src/screens/DashboardScreen.tsx - Monitor controller
src/services/HeartMonitorController.ts - Health feed
src/services/healthService.ts - Health state
src/store/useHealthStore.ts - Health analysis
src/utils/healthAnalysis.ts
Health records
- Alert service
src/services/alertService.ts - Alert log
src/components/AlertLog.tsx - History screen
src/screens/HistoryScreen.tsx - History service
src/services/historyService.ts - PDF reports
src/services/reportService.ts - Firebase database
src/config/firebase.ts
Accounts
- Login screen
src/screens/LoginScreen.tsx - Registration screen
src/screens/RegisterScreen.tsx - Authentication
src/services/authService.ts
Preferences
- Settings screen
src/screens/SettingsScreen.tsx - Settings service
src/services/settingsService.ts - Theme context
src/theme/ThemeContext.tsx
Other components
- App user
- Monitor device
- Firebase Auth
- Device location
- Phone messaging
Connections 28
- App user → App entry: opens
- App entry → Monitor controller: starts monitoring
- App entry → Navigation: renders
- App entry → Theme context: provides theme
- App user → Navigation: navigates
- Navigation → Live dashboard: dispatches
- Navigation → History screen: dispatches
- Navigation → Settings screen: dispatches
- Navigation → Login screen: dispatches
- Navigation → Registration screen: dispatches
- Monitor controller → Settings service: loads settings
- Monitor controller → Health feed: subscribes
- Health feed → Monitor device: receives measurements
- Monitor controller → Health state: updates state
- Live dashboard → Health state: reads state
- Monitor controller → Alert service: saves alerts
- Monitor controller → History service: deletes expired records
- Monitor controller → Device location: requests location
- Monitor controller → Phone messaging: opens SMS and dialer
- Alert log → Alert service: subscribes alerts
- Alert service → Firebase database: reads and writes
- History service → Firebase database: reads and writes
- Settings service → Firebase database: accesses settings
- PDF reports → Phone messaging: shares PDF
- Login screen → Authentication: requests sign-in
- Registration screen → Authentication: requests registration
- Authentication → Firebase Auth: authenticates
- Settings screen → Settings service: manages preferences