Repository Guidelines
Project Structure & Module Organization
- Root CRA app: source in
src/, static assets inpublic/, build output inbuild/. - Next.js site: lives in
portfolio-nextjs/with its ownsrc/,content/, and config (next.config.mjs). Exports static files for GitHub Pages. - Docs and assets: see
README.md,src/SRC_OVERVIEW.md, andsrc/images/.
Build, Test, and Development Commands
- Root (CRA):
npm start: run dev server athttp://localhost:3000.npm test: run Jest + Testing Library in watch mode.npm run build: production build tobuild/.npm run deploy: build and publish to GitHub Pages (viagh-pages).
- Next.js (
cd portfolio-nextjs):npm run dev: local Next.js dev server.GITHUB_PAGES=true npm run build: static export with sitemap.npm run deploy: export toout/and push togh-pages(adds.nojekyll).npm run lint/npm run typecheck: ESLint and TypeScript checks.
Coding Style & Naming Conventions
- Indentation: 2 spaces; prefer semicolons and ES modules.
- React components: PascalCase (
MyComponent.jsx/tsx). Hooks: camelCase withuseprefix. - Files: CRA uses
.js/.jsx; Next.js uses.ts/.tsxand MDX (.mdx). - Lint/format: CRA extends
react-appESLint; Next.js useseslint-config-nextand Prettier (portfolio-nextjs/.prettierrc). Runnpm run lintwhere available.
Testing Guidelines
- Frameworks: Jest + React Testing Library (CRA). No required tests in Next.js unless touching logic.
- Location/patterns:
**/*.test.js(x)near sources or under__tests__/. - Expectations: write focused unit tests for components and utils; prefer queries by role/label.
- Run:
npm test(root). Consider adding smoke tests for critical pages.
Commit & Pull Request Guidelines
- Commits: imperative mood, concise subject, optional scope (e.g.,
feat(home): add hero CTA). - PRs: clear description, linked issue, screenshots/GIFs for UI, steps to verify, and notes on accessibility/perf where relevant.
- Keep diffs focused; include updates to docs and tests.
Security & Configuration Tips
- Do not commit secrets. Use environment vars locally; avoid adding
.envto VCS. - GitHub Pages: root uses
homepageinpackage.json; Next.js requiresGITHUB_PAGES=truefor properbasePath/assetPrefix.