How brieantruss/health_stats works
Health Stats is a personal health-data platform: it ingests wearable, GPS, and workout data, enriches and stores it, syncs it to BigQuery for analytics, and supports dashboards and coaching reports. The primary user workflow is logging an exercise or diet entry in the Streamlit app, sending it to the Flask API, and persisting it in MySQL for later warehouse and dashboard use. The repository also includes scheduled ingestion, health agents, and pipeline operations monitoring. Some subsystem links are documented in the README; unsampled implementation details are not assumed.
Main entry points: App.tsx Operations dashboard · common.py Workout and diet UI · etl Health ETL stages · agents Health coaching agents
Components 27
Health Logging
- Workout and diet UI
fitness_streamlit_app/common.py - Exercise page
fitness_streamlit_app/pages/1_Exercise.py - Diet page
fitness_streamlit_app/pages/2_Diet.py - Fitness API
fitness_api/api_app.py
Ingestion & Storage
- MySQL health store
- GPS logger
gps_logger_app/app.py - Scheduled ingestion
scripts/dags - Health ETL stages
scripts/etl - Warehouse sync
scripts/mysql_to_bigquery.py
Analytics & Coaching
- BigQuery warehouse
- Dataform views
- Agent scheduler
scripts/agents/orchestrate_agents.py - Health coaching agents
scripts/agents - Report uploader
scripts/agents/gdrive_uploader.py
Pipeline Operations
- Pipeline API and events
fitness_api/api_app.py - Event stream
scripts/event_stream.py - Pipeline telemetry
scripts/pipeline_telemetry.py - Operations dashboard
ops_dashboard/src/App.tsx - Telemetry stream client
ops_dashboard/src/hooks/usePipelineStream.ts - Category telemetry grid
ops_dashboard/src/components/CategoryGrid.tsx - Metrics overview
ops_dashboard/src/components/MetricsOverview.tsx - Live event feed
ops_dashboard/src/components/LiveEventFeed.tsx - Event simulator
ops_dashboard/src/components/DevEventSimulator.tsx
Other components
- Health data user
- Google Drive and storage
- Weather and geocoding APIs
- Looker Studio dashboards
Connections 28
- Health data user → Workout and diet UI: logs activity
- Workout and diet UI → Exercise page: renders
fitness_streamlit_app/pages/1_Exercise.py - Workout and diet UI → Diet page: renders
fitness_streamlit_app/pages/2_Diet.py - Exercise page → Fitness API: sends exercise requests
- Diet page → Fitness API: sends diet requests
- Fitness API → MySQL health store: writes records
- Health data user → GPS logger: records location
- Google Drive and storage → Scheduled ingestion: provides raw files
- Scheduled ingestion → Health ETL stages: schedules ingestion
- Health ETL stages → MySQL health store: loads health data
- Health ETL stages → Weather and geocoding APIs: enriches GPS data
- MySQL health store → Warehouse sync: source tables
- Warehouse sync → BigQuery warehouse: syncs tables
- BigQuery warehouse → Dataform views: transforms warehouse data
- Dataform views → Looker Studio dashboards: feeds dashboards
- Agent scheduler → Health coaching agents: runs agents
scripts/agents/orchestrate_agents.py - Health coaching agents → BigQuery warehouse: analyze health trends
- Health coaching agents → Report uploader: uploads reports
scripts/agents/health_trend_analyst.py - Report uploader → Google Drive and storage: stores reports
- Operations dashboard → Telemetry stream client: uses stream client
ops_dashboard/src/App.tsx - Telemetry stream client → Pipeline API and events: fetches and publishes
ops_dashboard/src/hooks/usePipelineStream.ts - Pipeline API and events → Event stream: reads and publishes events
fitness_api/api_app.py - Pipeline API and events → Pipeline telemetry: serves pipeline telemetry
fitness_api/api_app.py - Operations dashboard → Category telemetry grid: renders categories
ops_dashboard/src/App.tsx - Operations dashboard → Metrics overview: renders metrics
ops_dashboard/src/App.tsx - Operations dashboard → Live event feed: renders events
ops_dashboard/src/App.tsx - Operations dashboard → Event simulator: offers event simulation
ops_dashboard/src/App.tsx - Event simulator → Telemetry stream client: publishes events
ops_dashboard/src/App.tsx