|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +Expense Pet is a personal expense tracking app with gamification (virtual pet companion, points, streaks). Full-stack TypeScript monorepo, early stage — shared schemas exist but apps/api and apps/web are not yet implemented. Documentation is in Russian. |
| 8 | + |
| 9 | +## Monorepo Structure |
| 10 | + |
| 11 | +- **Turborepo** with npm workspaces |
| 12 | +- `apps/api/` — Fastify backend (planned, not yet built) |
| 13 | +- `apps/web/` — Vite + React frontend (planned, not yet built) |
| 14 | +- `packages/shared/` — Zod validation schemas shared between frontend and backend (`@expense-pet/shared`) |
| 15 | + |
| 16 | +## Commands |
| 17 | + |
| 18 | +```bash |
| 19 | +npm run dev # Start all apps in dev mode (turbo) |
| 20 | +npm run build # Build all packages/apps (turbo) |
| 21 | +npm run test # Run tests across workspaces (turbo) |
| 22 | +npm run lint # Biome check (linting + formatting) |
| 23 | +npm run lint:fix # Biome auto-fix |
| 24 | +npm run format # Biome format --write |
| 25 | +npm run typecheck # TypeScript type checking (turbo) |
| 26 | +npm run clean # Remove dist/, .turbo, node_modules |
| 27 | +``` |
| 28 | + |
| 29 | +## Tech Stack |
| 30 | + |
| 31 | +- **Linting/Formatting:** Biome.js (not ESLint/Prettier) — single quotes, semicolons, 2-space indent, 100 char width |
| 32 | +- **Node version:** 25 (see `.nvmrc`) |
| 33 | +- **Validation:** Zod v4 schemas in `packages/shared` |
| 34 | +- **Planned backend:** Fastify, Prisma, PostgreSQL, JWT auth (argon2) |
| 35 | +- **Planned frontend:** React 19, React Router v7, TanStack Query, React Hook Form |
| 36 | + |
| 37 | +## Architecture (from docs/) |
| 38 | + |
| 39 | +- **3-layer pattern:** Routes (HTTP) → Services (business logic) → Repository (data access via Prisma) |
| 40 | +- Shared Zod schemas are the single source of truth for validation between frontend and backend |
| 41 | +- Conventional commits: `feat:`, `fix:`, `chore:`, `test:`, `docs:` |
| 42 | +- Feature-based folder organization (not by file type) |
| 43 | +- Detailed implementation roadmap in `docs/expense-pet-roadmap.md` (10 stages, Stage 0 = foundation CRUD + auth) |
| 44 | + |
| 45 | +## Biome Configuration Notes |
| 46 | + |
| 47 | +- `noConsole`: warn (allows `console.warn`, `console.error`, `console.info`) |
| 48 | +- `noExplicitAny`: warn (disabled in test files) |
| 49 | +- `noUnusedVariables`: warn |
| 50 | +- Ignored paths: `node_modules`, `dist`, `.turbo`, `coverage`, Prisma migrations, `*.gen.ts` |
0 commit comments