How radityawsgtg/pulihgo works
PulihGo is a gyroscope-based home stroke-rehabilitation product: therapists prescribe exercise targets, patients practise on a phone that measures movement and records sessions, and therapists review synced results. The phone app and dashboard communicate through Supabase, not directly. The sampled source confirms app navigation, calibrated sensor input, local session storage, and dashboard database calls; README documents the wider reporting and offline-first loop. Some screen and sync implementations were not sampled, so uncertain internal wiring is omitted.
Main entry points: ExerciseScreen.tsx Exercise session · App.tsx App navigation · sessionStore.ts Session history · supabaseClient.ts Phone Supabase client
Components 23
Patient app
- App navigation
pulihgo-app/App.tsx - Onboarding
pulihgo-app/src/screens/OnboardingScreen.tsx - Exercise selection
pulihgo-app/src/screens/ExerciseListScreen.tsx - Exercise session
pulihgo-app/src/screens/ExerciseScreen.tsx - Progress view
pulihgo-app/src/screens/ProgressScreen.tsx - Session summary
pulihgo-app/src/screens/SummaryScreen.tsx
Exercise measurement
- Angle calibration
pulihgo-app/src/sensors/useCalibratedAngle.ts - Device motion input
pulihgo-app/src/sensors/useDeviceAngle.ts - Rep detection
pulihgo-app/src/metrics/repDetector.ts - ROM metrics
pulihgo-app/src/metrics/rom.ts - Movement smoothness
pulihgo-app/src/metrics/smoothness.ts - Safety checks
pulihgo-app/src/safety/safety.ts
Sync and storage
- Prescription loading
pulihgo-app/src/sync/usePrescription.ts - Prescription resolver
pulihgo-app/src/sync/fetchPrescription.ts - Session history
pulihgo-app/src/storage/sessionStore.ts - Device storage
- Session upload
pulihgo-app/src/sync/uploadSession.ts - Phone Supabase client
pulihgo-app/src/sync/supabaseClient.ts
Therapist dashboard
- Therapist dashboard
therapist-dashboard/src/App.tsx - Dashboard data access
therapist-dashboard/src/lib/supabase.ts
Other components
- Patient
- Supabase
- Therapist
Connections 29
- Patient → App navigation: uses
- App navigation → Onboarding: shows first-run
- App navigation → Exercise selection: opens exercise
- App navigation → Progress view: opens progress
- App navigation → Session summary: opens summary
- Exercise selection → Exercise session: selects exercise
- Exercise session → Prescription loading: loads plan
- Prescription loading → Prescription resolver: resolves plan
- Prescription resolver → Phone Supabase client: queries
- Phone Supabase client → Supabase: reads plan
- Exercise session → Angle calibration: reads angle
- Angle calibration → Device motion input: calibrates
- Device motion input → Exercise session: supplies samples
- Exercise session → Rep detection: counts reps
- Exercise session → Safety checks: checks range
- Exercise session → ROM metrics: measures ROM
- Exercise session → Movement smoothness: scores movement
- Exercise session → Session history: saves session
- App navigation → Session history: hydrates history
- Session history → Device storage: persists locally
- Session history → Session upload: uploads best-effort
- Session upload → Phone Supabase client: sends session
- Phone Supabase client → Supabase: writes session
- Therapist → Therapist dashboard: uses
- Therapist dashboard → Dashboard data access: loads and saves data
- Dashboard data access → Supabase: reads sessions; writes plan
- Supabase → Dashboard data access: returns records
- Session history → Progress view: provides history
- Session history → Session summary: provides sessions