- App code lives in
src/withcomponents/,design-system/,screens/,hooks/, andstores/as the primary layers; shared styles instyles/and data indata/. - Entry points:
main.jsx(bootstrap) andApp.jsx(routes/layout). Global styles inindex.css. - Assets are in
public/andsrc/assets/. Capacitor config sits incapacitor.config.jsonand the Android build underandroid/. - Tests are split by type in
tests/(unit/,integration/,e2e/,a11y/); Playwright reports land inplaywright-report/and screenshots undertests/screenshots/. - Reference docs live in
docs/plusCLAUDE.md,PRD.md, andREFACTORING_SUMMARY.mdfor architecture and decision context.
npm run dev— start Vite dev server athttp://localhost:5173.npm run build— production bundle;npm run previewto serve the built app.npm run lint— ESLint with React, hooks, and Tailwind plugins.npm run format— Prettier with Tailwind sorting.npm test— Vitest unit/integration suite (jsdom).npm run test:coveragefor coverage,npm run test:uifor the Vitest UI.npm run test:e2e— Playwright E2E;test:a11yfor the accessibility subset;test:e2e:reportto open the HTML report.
- JavaScript/JSX with ES modules; prefer functional components and hooks.
- Prettier enforces formatting (2-space indent, single quotes where possible, trailing commas). Run
npm run formatbefore committing. - ESLint is zero-warning; fix or justify lint errors. Tailwind classes should be ordered by the plugin.
- Components/hooks:
PascalCasefiles incomponents/andhooks/(useSomething). Utility modules:camelCase. Tests mirror source names with.test.js|.test.jsx.
- Default to Vitest for unit/integration (jsdom). Co-locate mocks in
tests/helpers/. - Name tests after the unit under test (
ComponentName.test.jsx,useHook.test.js) and keep them deterministic (avoid timers without fake clocks). - E2E: keep stable selectors via
data-testid; screenshots stored intests/screenshots/. - Coverage: use
npm run test:coveragebefore merging features that touch core flows (auth, sessions, timers).
- Commit messages follow the existing short, imperative style (
Fix …,Redesign …,Skip flaky …); keep them scoped to one change. - PRs should include: concise summary, linked issue (if any), screenshots for UI changes (mobile + desktop), and test evidence (
npm test,npm run test:e2eor rationale for skipping). - Avoid noisy diffs: run
lintandformat, and remove stray console logs. Update relevant docs when altering architecture or APIs.
- Keep environment secrets out of the repo; use local
.envfiles and never commit them. - When touching PWA/Capacitor config, confirm
npm run build+npm run test:e2epass and assets remain offline-ready.