Cosmo · architecture audit

Health Estate Map

Every health component, where it lives, and what it talks to. Two systems, two servers, one database — Healthyst is the backend; everything else is a front door or a consumer.

Snapshot · Fri 22 May 2026
2 systems 2 servers + 1 cloud DB 3 active repos 3 archived today 6 tangles to fix
The map — how it all connects

Data flows top to bottom. Box colour shows which machine it runs on. Strava is the one true API; everything else arrives as screenshots.

DATA SOURCES FRONT DOORS — HOW DATA GETS IN BACKEND DATABASE screenshots Strava API persists Screenshot apps Withings · Renpho · Sleep Cycle Strava API · OAuth2 Cosmo Health Ingest service + PWA Hetzner cosmo-cloud box health.cosmokit.earthlingzero.com Health CLI Logging + queries local Mac Healthyst The hub — every front door reads & writes here REST API · AI coach · web · MCP server DigitalOcean prod box · healthyst.hecklerapps.com MongoDB Atlas database: healthyst · 12 collections
Hetzner cosmo-cloud DigitalOcean prod box MongoDB Atlas Local Mac Third-party
Components — in detail
1Data sources
Stravathird-party
API · OAuth2
The only real API integration. Wired in inside Healthyst.
Withings · Renpho · Sleep Cyclethird-party
body + sleep apps
No usable API path — data arrives by screenshot through Cosmo Health.
Historical exportsarchive
plans/health-journey/raw-data/
One-off dumps: Apple Health, Nike Run Club, parkrun, old MongoDB collections. Reference only, not a live feed.
↓  screenshots & the Strava API
2Front doors — how data gets in
Cosmo HealthHetzner
choujar/cosmo · services/health-ingest/
Screenshot-ingest service + the Vue PWA. Share a screenshot → Claude parses it → you confirm → it writes to Healthyst.
health.cosmokit.earthlingzero.com · systemd cosmo-health · :9210
Health CLIlocal Mac
choujar/cosmo · src/integrations/health/cli.js
Command-line logging & queries — the second front door. Also proxies the Strava commands.
↓  both read & write the same API
3Backend — the hub
HealthystDigitalOcean prod box
choujar/healthyst · /var/www/labs/healthyst
The brain. A REST API + AI coach (agent/) + web UI + an MCP server. Every front door reads and writes through here.
healthyst.hecklerapps.com · pm2 healthyst-api · Strava integration lives inside (api/services/strava.js)
↓  persists to
4Data store
MongoDB Atlascloud
database: healthyst
12 collections — sleep, activities, biometrics, meals, nutrition, notes, reflections, phases, plans, daily-activities, food-items, 75soft. The single source of truth for health data.
Coaching & knowledge — bundled inside choujar/cosmo
Health coaching skill
.claude/skills/health/
Coach identity, phase context, workflows, reference docs. A duplicate also sits at ~/.claude/skills/health/.
PB ledger
…/health/reference/progressive-overload.md
Canonical strength record. Copied into the ingest service at deploy time so /api/pbs can read it.
Health journey
plans/health-journey/
ADHD analysis + the raw-data archive (Apple Health, MongoDB dumps, Strava, NRC, parkrun).
Workouts
workouts/
30 historical workout markdown files.
Repositories
choujar/cosmoactivehealth-ingest service, health skill, health CLI, health-journey
choujar/healthystactivethe backend — API, AI coach, web, MCP
choujar/cosmo-memoryactivea few health topic drafts
choujar/Fitness-projectarchiveddormant since Apr 2025 — archived 22 May 2026
choujar/HealthTrackProarchiveddormant since Mar 2025 — archived 22 May 2026
choujar/healthpal-iosarchiveddormant since Feb 2025 — archived 22 May 2026
Drift & debt — what to untangle
1
Training phase tracked in three places
Healthyst's coach docs say Phase 8 (75 Soft). The cosmo health skill says Phase 9 (Comeback 5K). You're actually in Phase 10. Three sources, three answers.
2
Stale goals
Healthyst's CLAUDE.md still targets the Adelaide Half Marathon, sub-1:45, May 2026 — a cancelled race.
3
Two coaching brains
Healthyst has an /agent/ coach (phases, injuries, identity). The cosmo health skill also has coach identity, phases, workflows. Overlapping, separately maintained.
4
Two health skill folders
Both ~/cosmo/.claude/skills/health/ and ~/.claude/skills/health/ exist. The cosmo one is active; the global one is unexplained — likely a stale copy.
5
Hardcoded API key
The Healthyst API key is hardcoded in both server.mjs and cli.js instead of living in an env var.
6
Healthyst on the work production box
The Healthyst API runs on the KMZero DigitalOcean production server — a personal project sharing the work prod box. A deliberate early choice, now worth moving.
Planned moves
Archive the 3 dormant repos
Done 22 May 2026 — Fitness-project, HealthTrackPro, healthpal-ios archived on GitHub.
Extract the ingest service into its own repo
services/health-ingest/ → choujar/cosmokit-health. The PB ledger stays in cosmo; cosmokit-health symlinks to it.
Move Healthyst off the work prod box
Migrate the Healthyst API onto the Hetzner cosmo-cloud box.
One source of truth for the training phase
Resolve the Phase 8 / 9 / 10 drift; pick one home for current-phase context.
API key to an env var
Pull the hardcoded Healthyst key out of server.mjs and cli.js.
Dedupe the health skill folder
Confirm the active skill location, remove the stale copy.
Cosmo health architecture audit · generated Fri 22 May 2026