How bretthoffman/glucose_guardian works
Glucose Guardian is a diabetes-monitoring and care-coordination product: patients use the mobile app to review glucose, log food and insulin, connect CGMs, and access predictions and messaging; clinicians have doctor-portal API routes. The API routes requests, while Convex provides backend functions and persisted state. CGM ingestion is a distinct unattended workflow with provider adapters and pure scheduling policy. The README is empty, so capabilities and connections here rely on the supplied source excerpts and SOURCE INDEX; unsampled route behavior is represented only at the route-module level.
Main entry points: index.ts API route registry · providers.ts Dexcom and Libre · doctor.ts Doctor portal · cgmIngest.ts Sync orchestration
Components 25
Patient mobile app
- Mobile screens
artifacts/mobile/app/(tabs)/dashboard.tsx - Mobile authentication
artifacts/mobile/context/AuthContext.tsx - Glucose state
artifacts/mobile/context/GlucoseContext.tsx
HTTP API
- Express app
artifacts/api-server/internal/app.ts - API route registry
artifacts/api-server/internal/routes/index.ts - CGM endpoints
artifacts/api-server/internal/routes/cgm.ts - Chat endpoints
artifacts/api-server/internal/routes/chat.ts - Doctor portal
artifacts/api-server/internal/routes/doctor.ts - Food endpoints
artifacts/api-server/internal/routes/food.ts - Insulin endpoints
artifacts/api-server/internal/routes/insulin.ts - Prediction endpoints
artifacts/api-server/internal/routes/predict.ts - Doctor assistant
artifacts/api-server/internal/doctor-assistant.ts - Doctor authentication
artifacts/api-server/internal/doctor-auth.ts - Doctor account client
artifacts/api-server/internal/convex-doctor-accounts.ts
Convex backend
- Convex functions
convex - Convex database
convex/schema.ts - Care coordination
convex/careCircle.ts - Patient glucose
convex/patientGlucose.ts
CGM ingestion
- Sync orchestration
convex/cgmIngest.ts - Sync policy
convex/cgm/core.ts - Dexcom and Libre
convex/cgm/providers.ts - Sync diagnostics
convex/cgm/diagnostics.ts
Other components
- Patient or clinician
- Dexcom Share
- LibreLink Up
Connections 22
- Patient or clinician → Mobile screens: uses
- Patient or clinician → Express app: requests
artifacts/api-server/internal/app.ts - Express app → API route registry: mounts
artifacts/api-server/internal/app.ts - API route registry → CGM endpoints: registers
artifacts/api-server/internal/routes/index.ts - API route registry → Chat endpoints: registers
artifacts/api-server/internal/routes/index.ts - API route registry → Doctor portal: registers
artifacts/api-server/internal/routes/index.ts - API route registry → Food endpoints: registers
artifacts/api-server/internal/routes/index.ts - API route registry → Insulin endpoints: registers
artifacts/api-server/internal/routes/index.ts - API route registry → Prediction endpoints: registers
artifacts/api-server/internal/routes/index.ts - Doctor portal → Doctor account client: queries accounts
artifacts/api-server/internal/routes/doctor.ts - Doctor portal → Doctor authentication: uses auth
artifacts/api-server/internal/routes/doctor.ts - Doctor portal → Doctor assistant: uses assistant
artifacts/api-server/internal/routes/doctor.ts - Mobile authentication → Care coordination: references schedule
artifacts/mobile/context/AuthContext.tsx - Sync orchestration → Sync policy: plans sync
convex/cgmIngest.ts - Sync orchestration → Dexcom and Libre: runs provider sync
convex/cgmIngest.ts - Sync orchestration → Convex database: reads and writes
convex/cgmIngest.ts - Dexcom and Libre → Sync policy: uses anomaly policy
convex/cgm/providers.ts - Dexcom and Libre → Sync diagnostics: classifies failures
convex/cgm/providers.ts - Dexcom and Libre → Dexcom Share: calls provider
convex/cgm/providers.ts - Dexcom and Libre → LibreLink Up: calls provider
convex/cgm/providers.ts - Patient glucose → Convex database: persists readings
- Care coordination → Convex database: persists care data