app/– Next.js App Router (pages, layouts, andapp/api/*route handlers).components/– Reusable React components styled with Tailwind.lib/– Domain logic and services (e.g.,lib/supabase/services/*including MentorFit and clinical hours).scripts/– Local/CI utilities (lint, security, validation).tests/–unit/(Vitest),integration/ande2e/(Playwright). Test setup intests/setup.ts.- Config:
next.config.ts,tailwind.config.ts,playwright.config.ts,vitest.config.ts.
npm run dev– Start the Next.js dev server.npm run build– Production build; verify before PRs.npm start– Serve the production build locally.npm run lint– ESLint + semantic token check.npm run type-check– TypeScript without emitting.- Tests:
npm run test:unit,test:integration,test:e2e,test:all. - Gate:
npm run validate– lint + type-check + file length check.
- TypeScript + React 19 + Next.js App Router.
- ESLint: extends
next/core-web-vitalsandnext/typescript; warns on unused vars (_-prefixed allowed) andany. - Components: PascalCase files in
components/. Utility modules inlib/use camelCase exports. Route folders inapp/use kebab-case. - Tailwind: prefer semantic color tokens; keep class lists readable.
- Unit (Vitest): place under
tests/unit, name*.test.ts. - Integration/E2E (Playwright):
tests/integrationandtests/e2e, usetest.describesuites. - Run
npm run test:all(or targeted suites) before PRs. For service changes inlib/, add/extend unit tests; usevitest run --coveragewhen touching business logic.
- Use Conventional Commits:
feat|fix|perf|docs|refactor(scope): summary(seegit log). - PRs: focused scope, clear description, linked issues, repro steps; add screenshots for UI changes and note env flags.
- CI expectations:
npm run validate,npm run build, and relevant tests must pass.
- Never commit secrets. Use
.env.local; mirror keys from.env.example. - Helpful checks:
npm run security:scan,npm run security:test,npm run audit:auth,npm run verify:supabase. - Sentry/Clerk/Stripe/Supabase/Netlify require proper env vars; update docs when changing integrations.
- Sub‑agents live in
.codex/agents/*.md. For multi‑domain work, orchestration rules are in.cursorrules(trigger: “high level task: …”).