- Rust 48.2%
- TypeScript 40.7%
- HTML 7.2%
- Shell 2.4%
- Just 0.9%
- Other 0.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
CI / check (push) Successful in 2m48s
Each superset header gets a "+ Add selected" button when standalone lifts are checked, on both Today and the routine editor. The up/down reorder buttons were tiny tap targets on mobile. Give them fixed 32px (group) and 28px (within superset) hit areas while keeping the arrow glyphs small. Co-Authored-By: Claude Opus 5.5 <[email protected]> |
||
| .cargo | ||
| .forgejo/workflows | ||
| .sqlx | ||
| crates | ||
| docs | ||
| fixtures | ||
| migrations | ||
| scripts | ||
| web | ||
| .env.example | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CLAUDE.md | ||
| clippy.toml | ||
| deny.toml | ||
| justfile | ||
| MANUAL-TESTING.md | ||
| README.md | ||
| rust-toolchain.toml | ||
| rustfmt.toml | ||
workout-pwa-rs
A personal workout-tracking PWA: Rust/axum/sqlx backend, a Solid.js frontend, shipped as one binary + a static asset bundle. Rewrite of an older Cloudflare Workers/D1/htmx app, in progress toward tailnet-only staging and then a full production cutover.
docs/ARCHITECTURE.md and docs/IMPLEMENTATION-PLAN.md are the source of
truth for design and build order — read those (and CLAUDE.md) before
making changes. This file is a map to get a checkout running.
Stack
- Backend — Rust, axum,
sqlxagainst SQLite (WAL mode), Argon2id password hashing, cookie sessions + API keys. - Frontend — Solid.js + Vite, installable as a PWA (manifest + service worker), Tailwind for styling.
- Types —
crates/api-typesdefines every wire DTO once, in Rust, and exports matching TypeScript viats-rsintoweb/src/api/generated— there is no hand-maintained duplicate type on either side. - CI — Forgejo Actions, self-hosted runner, aarch64 (matches production's architecture).
Repository layout
crates/
├── api-types/ # wire DTOs: serde + ts-rs, no axum/sqlx dependency
└── server/
├── src/
│ ├── main.rs # subcommands: serve | migrate | admin
│ ├── config.rs # env → Config, fail fast, no defaults
│ ├── domain/ # pure business logic, most of the test surface
│ └── http/ # router, middleware, route handlers
└── tests/ # integration tests (real sqlite pool, not mocks)
web/
├── src/
│ ├── api/ # generated types + a thin fetch client
│ ├── domain/ # mirrors crates/server/src/domain/items.rs
│ ├── components/ routes/ state/
│ └── sw.ts # service worker
└── e2e/ # Playwright specs (not part of `just check`)
migrations/ # sqlx migrations, forward-only
fixtures/ # shared Rust+TS test vectors
scripts/ # data import/export/parity tooling
docs/ # ARCHITECTURE.md, IMPLEMENTATION-PLAN.md
Prerequisites
- Rust, pinned via
rust-toolchain.toml(currently 1.93.0) — a plaincargoinvocation in this directory will fetch/select it automatically if you're using rustup. - Node.js, for the
web/frontend. sqlite3CLI,sqlx-cli(scripts/install-cargo-tools.shhas pinned versions and why they'recargo installrather than a system package).- A C compiler (
cc) — needed transitively bylibsqlite3-sys.
Getting started
just dev # runs the Rust backend and Vite dev server together
This starts workout-server serve against target/sqlx-dev.db and the
Vite dev server on top of it. Stopping the recipe (Ctrl-C) stops both.
serve never creates or migrates the database itself
(ARCHITECTURE.md §6.2) — run migrations once first:
cargo run -p workout-server -- migrate --database target/sqlx-dev.db
cargo run -p workout-server -- admin --database target/sqlx-dev.db create-user <username>
admin subcommands never take a password as an argument — they prompt on
stdin so it never lands in shell history. See admin --help for the full
set (create-user, set-password, verify-login, lift set,
recalc-stats).
The one entry point: just check
just check
This is the whole regression net — clippy (-D warnings), the Rust test
suite, ts-rs/sqlx codegen plus a diff check that generation is
deterministic and committed, TypeScript typechecking, ESLint, and the
Vitest suite. Run it before every commit; don't run cargo test or
eslint standalone "to save time" — that partial-coverage shortcut is
exactly the failure mode the single-command design exists to prevent.
Other just recipes:
| Recipe | What it does |
|---|---|
just gen |
Regenerates ts-rs types + refreshes the sqlx offline query cache |
just dev |
Runs the backend + Vite dev server together |
just build-release |
Cross-compiled release binary (ARCHITECTURE.md §6.1) |
just e2e |
Playwright end-to-end smoke test — deliberately outside just check |
Configuration
The server reads its config from the environment only, and fails fast if
anything required is missing — see crates/server/src/config.rs:
| Variable | Purpose |
|---|---|
DATABASE_PATH |
Path to the SQLite database file |
PUBLIC_ORIGIN |
Exact scheme+host the server is served at; every mutating request's Origin header must match it exactly |
BIND_ADDR |
host:port for the HTTP listener |
There is no secrets configuration — the app does not depend on any shared secret or third-party credential.
Testing
just check covers the full suite (Rust + TypeScript). Separately:
just e2eruns Playwright against a real build; seescripts/e2e.shfor what it stands up.MANUAL-TESTING.mdtracks browser-only checks that don't fit an automated test.
Status
Actively being rewritten phase-by-phase per docs/IMPLEMENTATION-PLAN.md.
Currently deployed tailnet-only as a staging rehearsal ahead of the
production cutover; see that plan for what's done and what's next.