Investigated the "only ~4 days of treatments" report via direct MongoDB access (issue #13): the collection has 123k+ documents, no capping, no TTL index — the full year of history is in the database. The actual cause: /api/v1/treatments.json filters/sorts on the string field `created_at`, not the numeric `date` field /api/v1/entries uses. Paginating with find[date][$lte] (or no filter at all) silently caps treatments to an internal ~4-day window even though every document has a valid `date` field; find[created_at][$lte] correctly walks back through the full history. _paginated_get() now takes an explicit cursor_field per endpoint and always sends the cursor from the first request (never omitted), so that hidden default window can't trigger. Verified against the real instance: a 92-day treatments fetch now returns 39,403 rows (was ~700).
glucose-dashboard
Dashboard van glucosedata, live opgehaald uit een Nightscout-instantie.
Meerdere pagina's (zie zijbalk): een rollend live-overzicht en een set
klinische rapportagepagina's (zie docs/requirements-reporting.md en
docs/design-reporting.md).
Instellen
-
Zorg voor een draaiende Nightscout-instantie en een API-token (Admin Tools
Manage Tokens in Nightscout — geef het token minimaal
readable-rechten) of het klassieke API secret. -
Kopieer
.env.examplenaar.enven vulNIGHTSCOUT_URL, één van de twee auth-opties, enDASHBOARD_PASSWORD_HASHin (zie het voorbeeldbestand voor hoe je die hash genereert — de dashboard-URL wordt gedeeld met het diabetesteam, dus elke pagina zit achter een wachtwoord).app.pylaadt.envzelf in (viapython-dotenv), dus dit werkt hetzelfde onder PowerShell, cmd of bash — je hoeft de variabelen niet zelf in je shell te zetten. -
Lokaal draaien:
uv venv uv pip install -r requirements.txt --python .venv .venv\Scripts\streamlit run app.py -
Met Docker Compose:
docker compose up -ddocker-compose.ymlleest.envviaenv_file— dat bestand wordt niet meegecommit (zie.gitignore).
Tests en lint
pytest tests/ -v
ruff check .