Modern NiceGUI dashboard for personal Continuous Glucose Monitoring data powered by the Nightscout API. The project runs exclusively as a NiceGUI app and is designed to be deployed via Docker (compose or standalone).
git clone https://github.com/AlFontal/sugarboard.git
cd sugarboard
docker-compose up -d --buildThe NiceGUI server will be exposed on http://localhost:8080. Logs can be tailed with docker-compose logs -f sugarboard, and docker-compose down stops the stack. The compose file also mounts a named volume to persist cached CGM data between restarts.
When the dashboard loads, fill in the Nightscout Connection card with your base URL plus either:
- Read token (recommended): create a read-only API token inside your Nightscout instance (
Settings → API → Add Token). This grants GET access without exposing the master secret. - API secret: the classic admin secret string (we hash it and send it via the
api-secretheader). Only use this if you have tokens disabled.
Credentials stay on the server and are never rendered back to the browser. If you set the optional CGM_SITE environment variable, it simply pre-fills the base URL field for convenience.
- Runtime credentials: provided through the UI card described above.
STORAGE_SECRET: required for NiceGUI's secure server-side storage (set to any long random string).RECENT_REQUEST_TIMEOUT: Nightscout API timeout in seconds (defaults to 60). Increase if your server responds slowly.TZ: optional timezone for the container.- Cache persistence: by default a Docker volume named
sugarboard-cachestores.cache/. - Credential persistence: another volume
sugarboard-storagestores.nicegui/so saved Nightscout credentials survive rebuilds.
Set the non-interactive settings in docker-compose.yml (see DOCKER.md for other deployment targets). The Nightscout token/secret should always be entered via the UI.
To keep secrets out of version control, place them in a local .env file (already git-ignored) and let Docker Compose load it:
python - <<'PY' > .env
from secrets import token_hex
print(f"STORAGE_SECRET={token_hex(32)}")
PYIf you still want to run it locally without containers, use the lightweight requirements file:
python -m venv venv
./venv/bin/pip install -r requirements.dev.txt
make runThe NiceGUI app binds to 0.0.0.0:8080. To use a different port, set PORT=9090 make run. Hot reload is enabled by default via the NICEGUI_RELOAD env var in the Makefile.
make lint # black, isort, flake8
make test # pytest + coverage (non-e2e)
make test-e2e # e2e suite (requires running app)
make coverage # serve coverage HTML reportThe codebase no longer ships the historical Streamlit implementation. Check out an older branch/tag if you need it.