A minimal, phone-first workout app for the Twenty-Two morning calisthenics program — push / legs / pull rotating Mon–Sat plus a Sunday core day, runnable anywhere in 22 minutes (the name is the dose).
- React 19 + Vite + TypeScript (static build, no router/state/CSS frameworks)
- Supabase (Postgres + magic-link auth + RLS) for accounts, logs, and friend presence
- ADHD-first product spine: opens on today's workout, one-tap set logging, rolling 7-day consistency (no breakable streaks), friend presence (never reps)
- Node 20+ and npm
- A Supabase project (free tier is fine)
-
Apply the schema. Open the Supabase dashboard → SQL Editor, paste the contents of
supabase/schema.sql, and run it. It is idempotent — safe to re-run. It creates theprofiles,sessions,set_logs, andprogressiontables with full Row Level Security. On an existing deployment, also run anything new insupabase/migrations/(each file is idempotent). -
Configure auth redirect URLs. Dashboard → Authentication → URL Configuration:
- Site URL: your deployed app URL (e.g.
https://example.com/twenty-two/). - Redirect URLs: add every origin+path the app is served from. Include:
http://localhost:5173(local dev)- your production URL, e.g.
https://example.com/twenty-two/
Magic-link sign-in uses
location.origin + location.pathnameas the redirect, so the exact subpath must be allow-listed. - Site URL: your deployed app URL (e.g.
-
Environment variables. Copy
.env.exampleto.env.localand fill in the project URL and anon/publishable key (Project Settings → API). Never put theservice_rolekey here.VITE_SUPABASE_URL=https://YOUR-PROJECT.supabase.co VITE_SUPABASE_ANON_KEY=your-anon-or-publishable-key
npm install
npm run dev # http://localhost:5173
npm run build # typecheck (tsc) + vite build -> dist/
npm run preview # serve the production build locally
npm test # vitest run (pure-logic unit tests)PWA icons are generated by a dependency-free Python script (standard library
only — struct + zlib) that renders a lime "22" mark on the dark background:
python3 scripts/gen_icons.pyOutput lands in public/icons/. An SVG favicon lives at public/favicon.svg.
Production lives at https://shushu.be/twentytwo/ (S3 + CloudFront). Deploys are one command — build, tiered-cache upload, CDN invalidation:
./deploy.shInfra details (CloudFront function, OAC, scoped IAM deploy user, rollback):
docs/infra.md.
Portable by design: Vite base is './' and every asset/manifest/icon path is
relative, so the built dist/ works from any folder on any static host.
Whatever URL serves it must be in the Supabase Redirect URLs list, or
magic-link return will be rejected.
public/ manifest, favicon, generated icons
scripts/ gen_icons.py (PNG generator), render-grid.tsx (illustration grid)
supabase/ schema.sql (idempotent, full RLS) + migrations/
docs/ infra.md, program-view-proposal.md, exercise-guide-grid.png,
legacy-reference-card.html (the original artifact)
deploy.sh one-command production deploy
src/
program.ts the exact program config (rotation, exercises, paths)
types.ts shared TypeScript contracts
lib/logic.ts pure, unit-tested logic (dates, targets, consistency, etc.)
lib/supabase.ts client init from env
lib/db.ts typed data-access wrappers (no UI logic)
screens/ Auth / Today / Week
components/ FormSheet (exercise form-guide sheet)
illustrations/ 2-pose SVG guide per exercise + CONVENTIONS.md
App.tsx two-screen shell + auth gate