How allan-kipkemei/paramedic-triage-intake-offline-first-mobile-app works
This is an offline-first paramedic triage intake app. A responder enters patient details, priority and transport status; the app saves the record locally before updating the UI, then attempts upload. Pending records are retried on connectivity restoration or app foregrounding, and the record list and banner expose sync state. The excerpts show the store coordinating persistence and synchronization, plus a simulated API. Other documented behavior is retained where supported; unsampled details are not expanded.
Main entry points: sync.ts Sync coordinator · TriageForm.tsx Triage form · useTriageStore.ts Triage store · App.tsx App shell
Components 13
Triage capture
- App shell
App.tsx - Triage form
components/TriageForm.tsx - Priority badge
components/PriorityBadge.tsx
State and persistence
- Triage record
services/types.ts - Triage store
store/useTriageStore.ts - Local persistence
services/storage.ts
Synchronization
- Sync coordinator
services/sync.ts - Network monitor
services/sync.ts - App lifecycle
services/sync.ts - Mock triage API
services/api.ts
Status presentation
- Record list
components/RecordList.tsx
Other components
- Paramedic
- Simulated server
Connections 18
- Paramedic → Triage form: enters details
components/TriageForm.tsx - App shell → Triage form: renders
App.tsx - App shell → Record list: renders
App.tsx - Triage form → Triage store: submits record
components/TriageForm.tsx - Triage form → Priority badge: renders choices
components/TriageForm.tsx - Triage store → Local persistence: saves and loads
store/useTriageStore.ts - Triage store → Sync coordinator: requests sync
store/useTriageStore.ts - App shell → Sync coordinator: registers listeners
App.tsx - App shell → Triage store: loads records
App.tsx - Record list → Triage store: reads records
components/RecordList.tsx - Record list → Priority badge: renders badge
components/RecordList.tsx - Sync coordinator → Network monitor: checks connectivity
services/sync.ts - Sync coordinator → App lifecycle: listens for foreground
services/sync.ts - Sync coordinator → Local persistence: loads pending; marks synced
services/sync.ts - Sync coordinator → Mock triage API: posts records
services/sync.ts - Mock triage API → Simulated server: simulates upload
services/api.ts - Local persistence → Triage record: persists records
services/storage.ts - Triage form → Triage record: collects fields
components/TriageForm.tsx