- App code lives in
src.src/app(Next.js routes, API, middleware)src/components(UI; reusable components in PascalCase)src/lib(helpers: auth, db, ai, validations, etc.)src/hooks(React hooks:useX)
- Assets in
public/. End‑to‑end tests intests/. Scripts inscripts/. Docker files indocker/.
pnpm dev— Run the app locally (Next.js dev server).pnpm build/pnpm start— Production build and run.pnpm lint/pnpm lint:fix— ESLint + Biome checks and autofix.pnpm format— Format with Biome.pnpm test/pnpm test:watch— Unit tests (Vitest).pnpm test:e2e— Playwright tests; usesplaywright.config.tswebServer.- DB:
pnpm db:push,pnpm db:studio,pnpm db:migrate(Drizzle Kit). - Docker:
pnpm docker-compose:up/:downto run local stack.
- TypeScript everywhere. Prefer
zodfor validation. - Formatting via Biome: 2 spaces, LF, width 80, double quotes.
- Components:
PascalCase.tsx; hooks/utilities:camelCase.ts. - Co-locate small module tests next to code; larger suites under
tests/. - Keep modules focused; avoid circular deps; use
src/libfor shared logic.
- Unit tests: Vitest, filename
*.test.ts(x). - E2E: Playwright under
tests/, filename*.spec.ts. - Run locally:
pnpm testandpnpm test:e2e(ensure app is running or let Playwright start via config). - Add tests for new features and bug fixes; cover happy path + one failure mode.
- Conventional Commits:
feat:,fix:,chore:,docs:, etc. Example:feat: add image generation tool. - Branch names:
feat/…,fix/…,chore/…. - PRs: clear description, linked issues, screenshots or terminal output when UI/CLI changes; list test coverage and manual steps.
- Before opening PR:
pnpm check(lint+types+tests) should pass.
- Copy
.env.exampleto.env; never commit secrets. For local HTTP useNO_HTTPS=1orpnpm build:local. - If using DB/Redis locally, start services via Docker scripts or your own stack.