ScientificMuscle is a local-first PWA for advanced bodybuilders who track fractional volume (e.g., "1 set Dip = 1.0 Chest + 0.7 Triceps"). It prioritizes data ownership (IndexedDB) and precision.
- Stack: Vite + React (SPA) + TypeScript.
- Data: IndexedDB (via Dexie.js).
- State: TanStack Query (managing async DB state).
- Styles: Tailwind CSS + shadcn/ui.
- Deployment: Static Web Host (e.g., Vercel/Netlify).
- Database First: The UI Agent MUST NOT mock data. It must connect to the real IndexedDB. If the DB isn't ready, the UI Agent waits for the Database Agent.
- Strict TDD (Logic Only):
- Step 1: Write a
.test.tsfile asserting the desired behavior. - Step 2: Run the test (It MUST fail).
- Step 3: Write the minimum
.tsimplementation to pass the test. - Step 4: Refactor.
- Step 1: Write a
- Migration Strategy: For MVP, schema changes = "Nuke & Rebuild" (Delete DB).
- Scope:
src/core/ - Key Types:
ScientificMuscle,FunctionalGroup. - Math: Fractional set aggregation (summing
0.7sets across weeks). - Parsers: Hevy CSV parser, Strong CSV parser.
- Scope:
src/db/ - Schema:
workouts,exercises,profiles. - Hooks:
useWorkouts(),useStats().
- Scope:
src/ui/ - Pages: Dashboard (Weekly Volume), Analysis (Muscle Heatmap), Settings.
- Components: Charts (Recharts), Forms (shadcn/ui).
- Tool: Playwright (E2E).
- Workflow: Agent launches app -> clicks flows -> verifies charts render.