Skip to content

About

Personal analytics: wearable, logbook and weather data correlated into insights

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Constellation

Constellation is a personal analytics dashboard. It takes the health data your wearable already records, adds what you log yourself (symptoms, meals, caffeine, anything you want to track), and helps you find the patterns between them. Does a hard workout change tonight's heart-rate variability? Does a hot day line up with a worse night? Constellation runs on your own computer and keeps your data there.

Day review: last night's sleep, HRV, heart rate and stress, with the day list on the left

All screenshots in this README use synthetic sample data from prototype/demo_data.py.

What's inside

  • Day review. One day at a time: the night's sleep stages, overnight HRV, resting heart rate, stress, the day's activity, and your logged entries.
  • Signals. Each measure is compared with your own last 28 days, so "low" means low for you.
  • Correlate and FDR scan. Test how one measure moves with another, including time lags, and correct for the fact that you test many pairs at once.
  • Noteworthy findings. Candidate patterns, generated only when you ask.
  • Chart. Overlay any series over hours, weeks or years.
  • Logbook. Record symptoms, meals, hydration, caffeine and your own custom fields.
  • AI analyst (optional). Ask questions about what you're looking at, using a model that runs on your computer.

Try it in five minutes

You don't need a watch to try Constellation. The demo generates a year of made-up data.

You need Python 3.9 or newer. The pages use only Python's standard library.

cd prototype
python3 demo_data.py
CONSTELLATION_GARMIN_DB=../data/demo/garmin_data.db CONSTELLATION_WX_PLACE="Demo Park" python3 refresh.py
python3 serve.py --open

On Windows, use py -3 in place of python3, and set the variables in PowerShell:

cd prototype
py -3 demo_data.py
$env:CONSTELLATION_GARMIN_DB = "../data/demo/garmin_data.db"
$env:CONSTELLATION_WX_PLACE = "Demo Park"
py -3 refresh.py
py -3 serve.py --open
  • The first refresh downloads the chart library once, so it needs internet access.
  • CONSTELLATION_WX_PLACE turns on weather from Open-Meteo, a free service that needs no key. Leave it out to skip weather.
  • Your browser opens the day review at http://127.0.0.1:8765/constellation-review.html. The chart is at constellation-chart.html on the same address.
  • Stop the server with Ctrl+C.

Use your own data

Constellation reads a local SQLite file of your Garmin data (a "warehouse"). This project doesn't include a Garmin download tool, so you need a way to produce that file yourself. The tables it expects are listed in adapters/garmin/registry.py. prototype/demo_data.py shows the smallest set the pages read.

Point Constellation at your file, then refresh:

CONSTELLATION_GARMIN_DB=/path/to/garmin_data.db python3 refresh.py

To get weather, set CONSTELLATION_WX_PLACE to the start of the location name your activities use for where you usually train, such as "Springfield". Constellation averages the start points of those activities to find your weather location.

After new data arrives, click Refresh in the page to rebuild everything.

Reading the screens

Work through them in this order.

Night view: the selected night's sleep in detail

  1. Day review. Start here. The list on the left shows each day with its score. The middle of the page shows the night's hypnogram, overnight HRV, deep and REM sleep, and resting heart rate. Values that stand out are highlighted with a tag.
  2. Night, Day and Full day. The buttons at the top switch the view. Night shows last night in detail. Full day shows the 24 hours, including heart rate, stress, body battery and steps.

Full day view: the 24-hour cycle with daytime lines

  1. Signals. Each row compares a measure with your own 28-day baseline. Its z-score shows how unusual today is. Click a row to open the Inspector, which explains the measure, its baseline and how it's calculated.

Signals panel with z-scores against your own baseline

Inspector: one measure, its value and its baseline

  1. Correlate. Pick an outcome (for example overnight HRV) and an exposure (for example awake stress, or something you logged). The lag coefficients from −3 to +3 days show whether a link is immediate or delayed.
  2. FDR scan. Constellation tests many pairs at once. The scan corrects for that, so the pairs it keeps are more trustworthy leads than a raw list of correlations.

Correlate: lag-aware Spearman coefficients and the FDR scan

  1. Noteworthy findings. Click Generate findings to see candidate patterns. Nothing runs until you click. Treat each result as a question to check, not an answer.

Noteworthy findings, waiting for you to generate them

  1. Chart. Overlay several series on one time axis. Use the range buttons from 4H to ALL, and choose a bucket size for intraday data.

Chart page: multi-month overview

Chart page: seven days at five-minute resolution

Logging

The right-hand panel logs entries for the day you're viewing: symptoms, GI, meals, hydration, caffeine, notes, and any custom fields you add. Set the time, choose the kind and save. Entries are kept in the browser, for the address you use, so entries logged at one address won't appear at another.

A blank field means "unknown". Constellation never fills blanks with zero, so leave a field empty when you don't know, and enter 0 only when the answer is zero.

Getting good insights

  • Log consistently, even when the answer is "none". Gaps make patterns harder to see.
  • Give it time. Baselines use the last 28 days, and most comparisons need several weeks of nights.
  • Look for repeats. A pattern that shows up across several nights is worth checking. One night rarely is.
  • Check the numbers behind a colour. Look at the lag and the sample size before you trust a correlation.
  • Correlation isn't cause. Sleep, weather, training and stress all interact. Change one thing at a time when you test an idea.
  • Bring questions to a clinician. Constellation is not a medical device and doesn't diagnose anything.

Optional: the AI analyst

The Ask panel can answer questions about the page you're looking at, using a model that runs on your own computer (for example through Ollama). It's an advanced setup: the analyst runs in the API service, not in the simple server above, and it needs a model server and a provider config. See docs/analyst.md. Page data is only sent to providers marked as local.

Privacy

  • Everything stays on your computer. There are no accounts and no cloud services, except the optional weather lookup (your coordinates and the dates are sent to Open-Meteo) and the one-time chart library download.
  • The generated pages and JSON files contain your personal health data. They're git-ignored, so keep them out of any repository you publish.
  • The simple server listens on all network interfaces by default. To keep it on your own computer, start it with --host 127.0.0.1:
python3 serve.py --host 127.0.0.1 --open

Troubleshooting

What you see What to do
The page asks you to start the server You opened the HTML file directly. Run serve.py and use the address it prints.
The server says the port is already in use Use another port, for example python3 serve.py --port 8766.
Weather panels are empty Set CONSTELLATION_WX_PLACE and make sure you have internet access.
A refresh step fails The page names the step. The full log is in the terminal.
The charts don't load the first time The chart library downloads once. Connect to the internet and refresh.
A time-zone error on Windows Run py -3 -m pip install tzdata.

For developers

  • prototype/: the pages, the local server and the export scripts. Standard library only.
  • api/, adapters/, store/: the FastAPI service, the Garmin adapter and the MongoDB store.
  • docs/: guide.md explains every panel. analyst.md, api.md, store.md and architecture.md cover the rest. Metric definitions are in prototype/METRICS.md.
  • Tests: python -m pip install -r requirements-dev.txt, then python -m unittest discover -s tests -t .. The browser checks in prototype/ run with Node.
  • Design principles: each source enters through an adapter that maps it to one canonical model, storage is plain SQLite and files until a real need says otherwise, every row records where it came from, and the output is findings people read.

License

To be decided.

About

Personal analytics: wearable, logbook and weather data correlated into insights

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages