Spaces:
Sleeping
Sleeping
Repository Guidelines
Project Structure & Module Organization
app/hosts Next.js routes, layouts, and server actions for the web UI.components/,hooks/,store/, andutils/group reusable UI pieces, custom hooks, Zustand stores, and shared helpers.services/,api-client/, andserver/encapsulate API integrations, background jobs, and Hono handlers; keep external calls here.public/stores static assets, whiledocs/andschema/capture product and API documentation.- Tests and fixtures live under
test/; mirror the runtime folder structure when adding coverage.
Build, Test, and Development Commands
npm run devboots the local Next.js app on port 3200; usenpm run dev:restartwhen you need a clean background process.npm run buildcompiles the production bundle, andnpm startserves the build output.npm run lintruns ESLint with the Next.js config;npm run lintfixchains Prettier and ESLint for autofixes.npm test,npm run test:watch, andnpm run test:uiexecute Vitest in batch, watch, or UI mode.- Use
npm run generate:dummy-screenshotsornpm run prepare:dummy-imagesto refresh design placeholders referenced in demos.
Coding Style & Naming Conventions
- TypeScript and modern React patterns are expected; default to server components unless client interactivity is required.
- Formatting is enforced by Prettier (2-space indentation, single quotes, trailing commas) and ESLint; run lint before committing.
- Name React components and Zustand stores in PascalCase, hooks with the
useprefix, and internal helpers in camelCase. - Keep import paths absolute via the
@alias rather than deep relative chains, and group CSS or Tailwind utilities near their components.
Testing Guidelines
- Write unit and integration specs with Vitest; locate files beside the code (
*.test.ts[x]) or undertest/mirroring the module path. - Mock external services through helpers in
services/to avoid real network calls, and assert both success and error flows. - Run
npm testplusnpm run lintbefore pushing; add snapshots only when the UI surface is stable.
Commit & Pull Request Guidelines
- Follow Conventional Commits (
feat:,fix:,chore:) as in the git log; include localization context when touching Japanese copy. - Each pull request should link the relevant issue, describe behavior changes, note required environment updates, and attach UI screenshots or recordings.
- Confirm CI passes locally (
npm run lint,npm test,npm run build) and mention any skipped checks or follow-up tasks in the description.
Configuration Tips
- Secrets live in
.env.local; never commit credentials or API tokens—consultapi-config.jsonfor expected keys. - Update documentation in
docs/when endpoints or flows change, and surface breaking environment changes in the pull request summary.