Back to Roadmap

Seed Data Pipeline

Create packages/seed-data/ with JSON source-of-truth files and a bun run db:seed command that upserts into Postgres. JSON files are the source of truth; the database is the runtime query layer. Self-hosters get the full dataset on first deploy.

Phases

Phase 1 (with schema migration):

  • activity-types.json — canonical activity type catalog (slug, name, category, icon). ~100 types from SYNTHESIS §8.

Phase 2 (with strength training):

  • exercises.json — exercise templates (slug, name, category, exercise_type, primary/secondary muscles, equipment). 500+ exercises.

Phase 3 (with equipment tracking):

  • equipment-catalog.json — shared product database (shoes, bikes, climbing shoes, etc. with brands and images).

Seed script requirements

  • Idempotent: upserts match on stable slug field, safe to run multiple times
  • Each file validated against a Zod schema before insert
  • bun run db:seed command in apps/backend
  • Also runs automatically on first deploy or when seed data version changes

Reference

See docs/api-research/SYNTHESIS.md §7 (Seed Data Pattern).

Status
Backlog
Priority
Normal
Platform
API
Date
1 month ago