Skip to content

0023 seed data modules

github-actions[bot] edited this page Nov 18, 2026 · 2 revisions

Seed data is TypeScript modules in packages/data, with permanent ids

Status: accepted · Implementation: done · Date: 2026-11-18

From LibreLifts ADR 0031. Revisit when people other than developers contribute records, or when media arrives. Built 2026-11-18: 22 exercises, 14 counted by reps and 8 by time.

Context

The app needs exercises to log from the first day, long before the open database and its editor exist (0008). The records are few, they are written by developers, and three places will read them: the app today, the API's seeding later, and the website. A data format such as JSON or YAML would need a schema and a loader before the first record could be used.

Decision

  • Seed records are TypeScript modules in packages/data, exported as plain read-only data with their types.
  • Every record has a permanent id, a UUID written into the file. An id is never changed and never reused, including for a record that is withdrawn.
  • The package holds data and its types only. It imports nothing from the workspace and has no logic beyond looking a record up.
  • The first records are a short list of calisthenics exercises, each with an id, a slug, a name and how it is counted: by reps or by time.
  • The list is written for LibreBars. Exercise names are the common names of the movements. Nothing is taken from another app's list, and there are no descriptions or media yet.
  • The records are open data under the ODbL (0009), not under the Apache License that covers the code around them.
  • There are no built-in routines. A person makes their own (0006).

Consequences

  • The app, and later the API and the website, read the same records with the same types, with nothing to parse.
  • Adding a record means editing code, so for now only people who can open a pull request contribute.
  • TypeScript checks the shape of a record but not its sense. A test checks that ids are UUIDs and unique and that slugs are unique.
  • When the format changes, the ids carry over. That is what makes this safe to start with.

LibreBars

Clone this wiki locally