app/hosts the React Router front end;app/routes/keeps loaders and screens,app/components/shares UI, andapp/lib/stores client helpers plus the internal tool registry.workers/contains the Hono worker; place REST handlers inworkers/routes/and cross-cutting logic inworkers/middleware/.lib/exposes shared database accessors and types used by both app loaders and worker routes.db/keeps schema and seed SQL,public/serves static assets, and root configs (react-router.config.ts,wrangler.jsonc,tsconfig*.json) define build targets.
pnpm installto sync dependencies; stay on pnpm to maintain thepnpm-lock.yaml.pnpm devlaunches the full-stack dev server with hot reload.pnpm lint/pnpm lint:fixrun Biome; execute before every commit.pnpm typecheckgenerates Cloudflare bindings, React Router matchers, and project-wide type checks.pnpm buildcompiles production assets,pnpm previewserves them locally,pnpm deployships the bundle through Wrangler.pnpm cf-typegenrefreshes Worker types after changing environment bindings.
- TypeScript everywhere, ES modules only, and keep exports typed.
- Follow Biome defaults: tab indentation, double quotes, sorted imports; rely on
pnpm lint:fixfor formatting. - React components export PascalCase symbols while files stay in
kebab-case.tsx; hooks begin withuseand live underapp/hooks/. - Tailwind utilities should remain purposeful; factor repeated stacks into shared components.
- No automated tests yet; guard regressions with
pnpm typecheck, targeted manual QA viapnpm dev, and review console output. - When introducing tests, colocate
.test.ts(x)files or use__tests__folders and wire the runner intopackage.jsonso CI can discover it. - For worker code, prefer request-response tests that stub the Cloudflare context and load seed data from
db/seed.sql.
- Use Conventional Commit prefixes (
feat,feat(scope),docs, etc.) with imperative subjects under 72 characters. - PRs must describe intent, link tracking issues, list manual checks (
pnpm dev,pnpm lint,pnpm typecheck), and include UI screenshots for visible changes. - Route reviews to the owning area (
frontend,workers,db) and wait for approval before merging.
- Keep secrets out of git; configure D1 and OAuth credentials via Wrangler or ignored
.envfiles. - After editing bindings, run
pnpm cf-typegenand confirm updates inworker-configuration.d.ts.