Demo project: React + NestJS (TypeORM) monorepo. Coding challenge.
backend/— NestJS + TypeORM + PostgreSQL (port 3000)frontend/— React + Vite + Redux Toolkit + shadcn/ui (port 5173)docker-compose.yml— Postgres 17 (port 5432, db: demo, user: postgres/postgres)
- Start: read relevant
docs/*.mdbefore coding. - Follow
read_whenhints; update docs when behavior/API changes.
- Commits: Conventional Commits (
feat|fix|refactor|build|ci|chore|docs|style|perf|test). - Files < 500 LOC; split when approaching limit.
- Fix root cause, not band-aid.
- Before handoff: run
npm run verify(full lint + typecheck + test).
- Before editing: run
git pull --rebase && git status && git diffto see other agents' changes. - After editing: commit immediately (small, atomic). Do not batch unrelated changes.
- Unrecognized changes in the working tree: assume another agent made them. Do not revert or undo -- keep going and focus on your task. If they cause a conflict, stop and ask the user.
- Destructive git ops (
reset --hard,clean,push --force) are forbidden unless explicitly requested. - No
git stash-- if you need to context-switch, commit to a WIP branch. - Before handoff: run
npm run verify(full lint + typecheck + test). - Read the relevant
docs/*.mdbefore touching backend or frontend code. Followread_whenhints. - Update docs when you change behavior or APIs. Do not ship without updating docs.
- Files must stay under 500 LOC. Split proactively.
- Read
docs/backend.mdwhen working on API/entities/services. - Entities go in
backend/src/<module>/entities/. - DTOs go in
backend/src/<module>/dto/. - One module per domain concept; each module owns its controller, service, entities.
- Use
ConfigServicefor all env vars; never hardcode. synchronize: trueis fine for this demo; never in prod.
- Read
docs/frontend.mdwhen working on UI/state/components. - Components:
frontend/src/components/(shared),frontend/src/features/<name>/(feature-scoped). - State: Redux Toolkit slices in
frontend/src/features/<name>/. - UI: shadcn/ui components in
frontend/src/components/ui/. - API calls: RTK Query or async thunks; keep fetch logic out of components.
- Path alias:
@/maps tofrontend/src/.
- Node 20+, TypeScript, PostgreSQL 17.
- Backend: NestJS 11, TypeORM, @nestjs/config.
- Frontend: React 19, Vite 6, Redux Toolkit, shadcn/ui, Tailwind CSS.
- Postgres:
docker compose up -d - Backend:
cd backend && npm run start:dev - Frontend:
cd frontend && npm run dev - Backend tests:
cd backend && npm test - Frontend lint:
cd frontend && npm run lint - Full gate:
npm run verify(run before every commit/handoff) - Docs overview:
sh scripts/docs-list.sh— run at session start.