This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Turborepo monorepo with the following structure:
apps/api- NestJS backend application (runs on port 3000)apps/web- Vite + React frontend application (runs on port 5173)packages/@caseai-connect/api-contracts- Shared API contracts and DTOspackages/@repo/jest-config- Shared Jest configurationspackages/@repo/typescript-config- Shared TypeScript configurationspackages/@caseai-connect/ui- Shared React component library
All commands should be run from the root directory using Turbo (via npm scripts):
npx turbo dev- Start all applications in development modenpx turbo dev --filter=api- Start only the API applicationnpx turbo dev --filter=web- Start only the web application
npx turbo build- Build all applications and packagesnpx turbo build --filter=api- Build only the API applicationnpx turbo build --filter=web- Build only the web application
npx turbo test- Run all testsnpx turbo test --filter=api- Run API tests onlynpx turbo test --filter=web- Run web tests only
npx turbo lint- Lint all packages and applications
cd apps/api && npx tsc --noEmit- Check API TypeScript without emitting filescd apps/web && npx tsc --noEmit- Check web TypeScript without emitting files
- Built with NestJS framework
- Entry point:
apps/api/src/main.ts - Main module:
apps/api/src/app.module.ts - Modular structure with feature-based modules under
apps/api/src/domains/ - Uses dependency injection and decorators pattern
- See
apps/api/CLAUDE.mdfor detailed API rules
- Vite + React (SPA) with React Compiler enabled via
babel-plugin-react-compiler - Redux for state management with feature-based slices/thunks/selectors
- Integrates with shared UI component library from
@caseai-connect/ui - Entry point:
apps/web/src/main.tsx - See
apps/web/CLAUDE.mdfor detailed web rules
api-contracts: DTOs and route definitions shared between API and web- All DTOs consolidated per domain:
packages/api-contracts/src/{domain}/{domain}.dto.ts - All routes defined with
defineRoutein*.routes.tsfiles - Everything exported from
packages/api-contracts/src/index.ts
- All DTOs consolidated per domain:
- All packages use TypeScript with strict configuration
- Jest configuration centralized in
@repo/jest-config
- Uses npm workspaces for monorepo management
- Private packages with internal dependencies using
*version specifier - Engines requirement: Node.js >= 18
Rule: NEVER use single-letter variables in loops (for, map, forEach, etc.). Always use descriptive, human-readable variable names based on the type of object being iterated.
// ❌ Wrong
projects.map((p) => p.name)
// ✅ Correct
projects.map((project) => project.name)Before marking any work as completed, run and verify:
npm run biome:check— formatting and linting must passnpm run typecheck— no TypeScript errorsnpm run test— all tests must pass (API work)
Work is NOT complete until all applicable commands pass with exit code 0.