Repository Guidelines
Project Structure & Module Organization
- Next.js Pages Router lives in
pages/(e.g.,pages/index.js,pages/_app.js). Dynamic routes under folders likepages/creator/[id].js. - Reusable UI in
components/(e.g.,components/layout/Header.jsx,components/public/Hero.jsx). - Global styles in
styles/globals.css(Tailwind entry). Static assets inpublic/(e.g.,/favicon.ico,/manifest.json). - Legacy CRA/Vite artifacts in
src/andlegacy/; not used at runtime. Avoid edits unless migrating. - Root config:
next.config.js,tailwind.config.js,postcss.config.js. Legacy:vite.config.js,index.html.
Build, Test, and Development Commands
npm install— install dependencies (Node 18+).npm run dev— start Next dev server at http://localhost:3000.npm run build— production build vianext build.npm start— serve built app withnext start.npm run lint— run ESLint witheslint-config-next.
Coding Style & Naming Conventions
- Language: JavaScript/JSX with 2‑space indentation.
- Components use
PascalCase.jsx(e.g.,CreatorProfile.jsx). Utilities/hooks usecamelCase.js. - Use clear relative imports (no path aliases). Keep components small and composable.
- Fix ESLint warnings before commit; prefer simple, focused diffs.
Testing Guidelines
- No test runner is currently wired. Legacy Jest files may exist under
src/. - If adding tests, use Jest + React Testing Library; name files
*.test.jscolocated or under__tests__/. Keep tests deterministic and offline.
Commit & Pull Request Guidelines
- Commits follow Conventional Commits, e.g.,
feat(dashboard): add analytics card. - PRs include: concise description, linked issues, and screenshots/GIFs for UI changes.
- Gate:
npm run lintmust pass andnpm run buildshould succeed locally before review.
Security & Configuration Tips
- Never commit secrets. Use
.env.local; see.env.examplefor required vars. Rotate exposed keys immediately and redeploy.
Migration Notes (Legacy CRA/Vite)
- Move any remaining UI from
src/intopages//components/and serve assets frompublic/. - Replace Vite/CRA-specific imports with Next-compatible ones; update relative paths. Validate with
npm run dev, thennpm run build.
Agent-Specific Instructions
- Prefer surgical changes aligned to the Pages Router. Avoid editing
src/or Vite artifacts unless migrating. Reference exact paths and npm scripts in explanations.