No description
  • Rust 48.2%
  • TypeScript 40.7%
  • HTML 7.2%
  • Shell 2.4%
  • Just 0.9%
  • Other 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Eric Yager 1d4e373cda
All checks were successful
CI / check (push) Successful in 2m48s
Add selected lifts to an existing superset; enlarge reorder buttons
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]>
2026-11-22 14:15:17 -05:00
.cargo Phase 6: type pipeline, client shell, auth screens 2026-09-12 15:46:35 -04:00
.forgejo/workflows Phase 0: scaffolding and quality gates 2026-09-11 15:13:04 -04:00
.sqlx S5: recompute lift_stats when a workout is deleted 2026-11-16 09:49:47 -05:00
crates Dissolve one-member supersets; add add_to_superset item op 2026-11-22 14:15:17 -05:00
docs Dissolve one-member supersets; add add_to_superset item op 2026-11-22 14:15:17 -05:00
fixtures Dissolve one-member supersets; add add_to_superset item op 2026-11-22 14:15:17 -05:00
migrations S9: index workout_sets by workout_lift_id 2026-11-13 20:30:59 -05:00
scripts Make cargo deny check pass 2026-11-16 09:58:14 -05:00
web Add selected lifts to an existing superset; enlarge reorder buttons 2026-11-22 14:15:17 -05:00
.env.example Phase 2: domain core — items, workouts, stats 2026-09-11 16:23:32 -04:00
.gitignore add old docs to gitignore 2026-11-22 14:13:06 -05:00
Cargo.lock Replace chrono and chrono-tz with jiff 2026-11-22 13:51:21 -05:00
Cargo.toml Phase 0: scaffolding and quality gates 2026-09-11 15:13:04 -04:00
CLAUDE.md T5: gate cargo fmt --check and cargo deny check in just check 2026-11-16 09:58:59 -05:00
clippy.toml Phase 0: scaffolding and quality gates 2026-09-11 15:13:04 -04:00
deny.toml Make cargo deny check pass 2026-11-16 09:58:14 -05:00
justfile T5: gate cargo fmt --check and cargo deny check in just check 2026-11-16 09:58:59 -05:00
MANUAL-TESTING.md Phase 10: PWA — manifest, service worker, plan page, and the e2e spec 2026-09-12 21:15:49 -04:00
README.md Add README 2026-09-13 10:37:47 -04:00
rust-toolchain.toml Phase 0: scaffolding and quality gates 2026-09-11 15:13:04 -04:00
rustfmt.toml Add rustfmt.toml (max_width 150, Max heuristics) and reformat 2026-11-16 09:56:47 -05:00

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, sqlx against 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-types defines every wire DTO once, in Rust, and exports matching TypeScript via ts-rs into web/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 plain cargo invocation in this directory will fetch/select it automatically if you're using rustup.
  • Node.js, for the web/ frontend.
  • sqlite3 CLI, sqlx-cli (scripts/install-cargo-tools.sh has pinned versions and why they're cargo install rather than a system package).
  • A C compiler (cc) — needed transitively by libsqlite3-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 e2e runs Playwright against a real build; see scripts/e2e.sh for what it stands up.
  • MANUAL-TESTING.md tracks 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.