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.
cd backend
uv synccd frontend
npm installStart 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 devThen open http://localhost:5173 in your browser.
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.
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.
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.
| 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 |
cd backend
uv run pytest tests/ -v- 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
Treatmentstable 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.
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.