# byteb4rb1e.homeostat

Personal health data pipeline for [tiararodney.com](https://tiararodney.com).
Fetches vitals, sleep, nutrition, activity, and body measurements from external
providers, stores them in a structured warehouse, and projects them into JSON
files for the site's status dashboard.

## Sources

- **Fitbit** — heart rate, steps, calories, active minutes, sleep, activity,
  weight, body fat
- **fddb.info** — food diary (calories, macros, per-meal breakdown)
- **Manual input** — body measurements not tracked by wearables (muscle mass,
  circumferences)

## Architecture

The pipeline follows a four-phase ETL design:

```
source adapters → raw warehouse → canonical warehouse → projections
```

JSONL partitions are the durable storage. SQLite is the query layer,
rebuilt from flat files at any time. See [ARCHITECTURE.md](ARCHITECTURE.md) for
the full design.

## Quick start

See [DEVELOPMENT.md](DEVELOPMENT.md) for setup instructions and tooling.

See [CONTRIBUTING.md](CONTRIBUTING.md) for the development workflow, commit
conventions, and issue lifecycle.

## Output

### Canonical warehouse

```
data/
├──vitals/
│  └── <iso 8601: YYYY-MM-DD>.jsonl # infraday data
├──sleep/
│  └── <iso 8601: YYYY-MM-DD>.jsonl # infraday data
├──nutrition/
│  └── <iso 8601: YYYY-MM-DD>.jsonl # infraday data
├──measurements/
│  └── <iso 8601: YYYY-MM-DD>.jsonl # infraday data
└──activity/
   └── <iso 8601: YYYY-MM-DD>.jsonl # infraday data
```

### Projections

```
build/projection/<iso 8601: YYYY-MM-DD-HHMMSS>/
├── status.json              # live dashboard snapshot
└── history/
    ├── vitals.json           # rolling heart rate, steps, calories
    ├── sleep.json            # rolling sleep duration, score, stages
    ├── nutrition.json        # rolling calories, macros, meals
    ├── measurements.json     # rolling weight, body fat, measurements
    └── activity.json         # rolling exercises, distance, floors
```

symlink the latest projection directory to current.
