How punypeony/healthwatch works
This is a caregiver-facing food-consumption health monitor: caregivers register, manage dependents and dietary profiles, scan food, review risk alerts and intake/history, and record grams eaten. The Expo client routes authenticated users through dependent tabs and calls a FastAPI API; the backend resolves food, evaluates risk, persists meal and alert records, and serves summaries. The graph preserves documented capabilities whose implementation was not sampled. Some service-to-service links rely on SOURCE INDEX references or README statements rather than full excerpts.
Main entry points: routes.py API routes · scan.py Scan workflow · models.py Domain records · api.ts API client
Components 20
Mobile client
- Expo app
mobile/App.tsx - Session and auth
mobile/src/auth/SessionContext.tsx - App navigation
mobile/src/navigation/RootNavigator.tsx - Care screens
mobile/src/screens - API client
mobile/src/api.ts - Query cache
mobile/src/utils/queryCache.ts
API and access
- API routes
backend/app/routes.py - Authentication
backend/app/auth.py - Dependent management
backend/app/dependents.py
Food assessment
- Scan workflow
backend/app/scan.py - Food lookup and cache
backend/app/food_lookup.py - Risk prediction
backend/app/ml/predict.py - Nutrition targets
backend/app/targets.py - Risk model training
backend/ml/train_risk_model.py
Health records
- Daily intake
backend/app/intake.py - Weekly summary
backend/app/summary.py - Domain records
backend/app/models.py - PostgreSQL access
backend/app/database.py
External services
- Open Food Facts
Other components
- Caregiver
Connections 26
- Caregiver → Expo app: uses
README.md - Expo app → Session and auth: provides session
mobile/App.tsx - Expo app → App navigation: mounts
mobile/App.tsx - Session and auth → API client: authenticates through
mobile/src/auth/SessionContext.tsx - App navigation → Care screens: routes to
mobile/src/navigation/RootNavigator.tsx - Care screens → API client: requests data
- API client → Query cache: uses cache
mobile/src/api.ts - API client → API routes: calls API
README.md - API routes → Authentication: delegates auth
backend/app/routes.py - API routes → Dependent management: delegates ownership
backend/app/routes.py - API routes → Scan workflow: invokes scan
backend/app/routes.py - API routes → Daily intake: requests intake
backend/app/routes.py - API routes → Weekly summary: requests summary
backend/app/routes.py - API routes → Domain records: queries records
backend/app/routes.py - Scan workflow → Food lookup and cache: resolves product
backend/app/scan.py - Scan workflow → Risk prediction: predicts risk
backend/app/scan.py - Scan workflow → Nutrition targets: calculates percentages
backend/app/scan.py - Scan workflow → Domain records: stores meal and alert
backend/app/scan.py - Food lookup and cache → Open Food Facts: looks up barcode
backend/app/food_lookup.py - Food lookup and cache → PostgreSQL access: caches products
backend/app/food_lookup.py - Daily intake → Domain records: reads meal logs
backend/app/intake.py - Daily intake → Nutrition targets: uses targets
backend/app/intake.py - Weekly summary → Domain records: reads records
backend/app/summary.py - Domain records → PostgreSQL access: maps persistence
backend/app/models.py - Risk model training → Risk prediction: produces model artifact
- API routes → Food lookup and cache: resolves dishes
backend/app/routes.py