Repository navigation
Development
How to set up LibreBars and run what there is of it. This file grows with the repository: each app gets its section in the pull request that adds it.
- Node 26 (see
.nvmrc) and pnpm 12.
Later, for the parts that are planned: Xcode with an iOS simulator and CocoaPods, the Android SDK with an emulator and Java 17, and Docker for the API's database.
pnpm installThe workspace holds back packages that were published very recently. If an install refuses a package for that reason, wait or pick an older version; don't switch the hold off.
pnpm check # everything CI runs
pnpm test # unit tests, in every package
pnpm typecheck # TypeScript, in every package
pnpm lint # Biome
pnpm format # Biome, fixing what it canpnpm check is the one command to run before saying a change is done. It is a script in the
root package.json, and a step is added to it when the thing it checks exists.
Biome does not check Markdown. It is left out because the formatter breaks the front matter of the decision records.
Four packages hold what more than one app needs. Each is plain TypeScript source with no build step, and none imports another.
| Package | What to know |
|---|---|
packages/engine |
One function per file with its test beside it. No dependencies, nothing impure. |
packages/ui |
src/theme.css is the only place a colour is defined. |
packages/data |
The exercises. An id is permanent: never change or reuse one. |
packages/contracts |
The API's shapes, and the synced tables: their order, columns and version. |
To run one package's tests: pnpm --filter @librebars/engine test.
Docs are plain Markdown in docs/. Links between them are relative paths to the .md file,
so they work on GitHub and can be rewritten for the wiki.
The wiki is built from docs/ by scripts/wiki.ts. To see what will be published:
pnpm wiki # writes the wiki pages to dist/wikiIt fails if a link between docs doesn't resolve, and it is a step of pnpm check.
Generated from docs/ on dev. Edit the docs there; changes made on the wiki are overwritten.
- Development
- Workflow
-
Decisions
- 0001 Decisions are recorded
- 0002 Apache License 2.0
- 0003 Changes land on dev by fast-forward; main is the last release
- 0004 Conventional Commits, Keep a Changelog and Semantic Versioning
- 0005 docs/ is for developers and is mirrored to the wiki
- 0006 LibreBars is a free workout log for calisthenics
- 0007 The tracker is an iOS and Android app; its web build stays until the store release
- 0008 LibreBars is an app and a crowd-sourced open database
- 0009 The database is ODbL, media is CC BY-SA, and neither can be closed later
- 0010 A hosted API with a free tier is the paid product
- 0011 The workspace is app, web and api, with engine, ui, data and contracts
- 0012 The engine is small pure functions, in the style of date-fns
- 0013 Web and app share a Tailwind theme, not components
- 0014 Postgres is the source of truth for all data
- 0015 The API is Fastify, and it owns LibreBars accounts
- 0016 Every install is a guest account, made in the background
- 0017 Accounts use Better Auth
- 0018 The on-device database is SQLite with Drizzle, on every platform
- 0019 Sync is our own push and pull
- 0020 The app says it backs up, and backup can be turned off
- 0021 Postgres 18, run with Docker Compose and tested on two databases
- 0022 expo-sqlite is patched so the web build reuses one buffer
- 0023 Seed data is TypeScript modules in packages/data, with permanent ids
- 0024 The first tables
- 0025 One TanStack Start app is the website, on GitHub Pages
- 0026 The catalog reaches the app as a snapshot plus updates, and the website through the API
- 0027 The app's first components are its own