Skip to content

dustinsurwill/glychart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Glychart

CI codecov

A local web app for analyzing CGM (continuous glucose monitor) data and reviewing insulin pump settings against clinical rules.

Upload an xDrip+ database export and get:

  • Time in range, GMI, std dev, and hourly/weekly glucose patterns
  • Postprandial excursion analysis with bolus timing breakdown
  • A settings advisor that checks your ISF, ICR, DIA, and basal against evidence-based rules

All data stays local — nothing leaves your machine.


Requirements

  • Python 3.11+ and uv
  • Node.js 18+ and npm (via nvm recommended)

Setup

Backend

cd backend
uv sync

Frontend

cd frontend
npm install

Running

Start both servers in separate terminals:

# Terminal 1 — API server (port 8000)
cd backend
uv run uvicorn main:app --reload --port 8000

# Terminal 2 — Dev server (port 5173)
cd frontend
npm run dev

Then open http://localhost:5173 in your browser.


Usage

1. Upload

Go to the Upload tab. Drag and drop your xDrip+ export ZIP file (from xDrip+ → Hamburger menu → Import/Export database → Export database).

Enter your pump settings in the form below the upload area. These are saved to localStorage and persist across sessions.

2. Dashboard

After uploading, the dashboard shows:

Section What it shows
Metric cards Mean BG, GMI (est. A1c), Std Dev, TIR, TAR, TBR
Time in Range bar Distribution across 5 glucose zones
Hourly pattern Median BG by hour of day with 25th–75th percentile band
Weekly/Daily trend TIR/TAR/TBR by week (or by day for short periods)
Meals tab Excursion analysis and bolus timing breakdown
Glossary tab Definitions for all clinical acronyms

Use the period selector (7d, 14d, 30d, 90d, 6mo, 1y) to zoom in on recent changes.

3. Settings Advisor

Click Check my settings from any page to run the rules engine. The Advisor shows:

  • Action flags — settings that are likely to cause measurable problems
  • Warning flags — patterns worth watching
  • Info flags — locked settings or informational notes

Use the analysis period selector on the advisor page to focus data-driven rules (basal drift, bolus timing) on a shorter window when you've recently made changes.

Below the flags, the Situational guidance section has static reference cards for edge cases that can't be derived from data.


Pump Settings

Field Description
Basal rate Background insulin (U/hr)
ISF (1:X) How many mg/dL one unit drops BG. Checked against the 1700 rule
ICR (1:X) Grams of carbs per unit. Checked against the 500 rule
TDD Total daily dose reported by your pump (U/day)
DIA Duration of insulin action configured in pump (hrs)
Target BG Pump algorithm target (mg/dL)
Insulin type Affects DIA comparison and bolus timing interpretation
Pump model Determines which settings are locked
APS toggle Whether you use an automated pump system (Control-IQ, AAPS, etc.)
Carb logging Whether you log carbs at the end of a meal or the start

Running tests

cd backend
uv run pytest tests/ -v

Data and privacy

  • No data is sent to any server. Everything runs locally.
  • The uploaded export is held in memory for the session and discarded on backend restart.
  • xDrip's Treatments table only contains manually entered boluses. Pump auto-corrections (Control-IQ, etc.) are not logged there — TDD from the pump will always exceed what xDrip records.

Architecture

backend/          Python / FastAPI
  core/           Parser, metrics engine, meal analysis, settings checker
  routers/        REST endpoints (/api/upload, /metrics, /meals, /settings/check)
  tests/          pytest suite

frontend/         React / Vite / Recharts / SWR
  src/
    components/   Dashboard, SettingsForm, SettingsAdvisor, charts
    hooks/        useMetrics, useMeals, useSettings
    types/        TypeScript types matching backend Pydantic models

See docs/architecture.md for the full design.

About

Local web app for analyzing xDrip+ CGM exports — time in range, meal excursions, and insulin pump settings advisor. All data stays on your machine.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors