Dexcom Archive
Intent
A self-running archive of continuous glucose monitoring data, with clinical-grade reports computed offline in the browser.
Why
Vendor platforms decide how long data is kept and where reports run. I wanted years of data in open formats, and reports that run anywhere, without a server.
Three repositories form one product, joined by a single contract: the SQLite schema.
- Collector (Python, GitHub Actions). A daily job pulls every record from the Dexcom API v3. Each run re-reads the last two days, so a missed run heals itself. Writes are idempotent, the rotating OAuth token is stored encrypted (AES-256-GCM), and a failure or stale data opens an issue on its own.
- Archive (SQLite). One file per year, append-only, with a schema that only grows. SQLite, DuckDB or Datasette read it as is.
- Dashboard (Next.js, DuckDB-WASM). The archive becomes Parquet and SQL runs in a browser worker: time in range, AGP percentiles, a daily calendar, episodes, a weekday by hour heatmap. Charts are hand-written SVG, and every metric is checked against a Python reference implementation.
Extensible by construction: a new data source is one endpoint and one table on the collector side. The dashboard reads the schema, never the collector, and tests lock the contract on both sides.
Health data stays private: the repositories are private and the dashboard only listens on localhost. The film and the screens on this page show six months of simulated type 1 data, generated for the demo.




