# Annas Rechnungsmanager Agent Guidance ## Development Commands - Install: `npm install` - Dev server: `npm run dev` (Vite on http://localhost:5173) - Dev with DB: `npm run devfull` (starts docker-compose DB first) - Typecheck: `npm run typecheck` (react-router typegen + tsc) - Lint: `npm run lint` (eslint) - Test: `npm run test` (vitest run) - DB migrate: `npm run db:migrate` (prisma migrate dev) - DB seed: `npm run db:seed` (loads demo data) - DB studio: `npm run db:studio` (Prisma GUI) - Admin setup: `npm run setup-admin` (sets ADMIN_PASSWORD env var or prompts) - Reset password: `npm run reset-password -- --username --password ` - Build: `npm run build` - Start prod: `npm run start` ## Environment - `.env` required: DATABASE_URL and AUTH_SECRET - Dev: http://localhost:5173 - Docker: http://localhost:3000 (first start requires ADMIN_PASSWORD) ## Docker Deployment - First start: `docker build -t annasrechnungsmanager:latest .` then `docker compose up -d` with ADMIN_PASSWORD set - Subsequent: `docker build -t annasrechnungsmanager:latest .` then `docker compose up -d --no-deps app` - Admin user created/updated on first start with ADMIN_PASSWORD ## Code Structure - `app/routes/` - file-based routing (React Router v7) - `app/routes/api.*` - REST API endpoints (loader/action) - `app/lib/` - data access, Prisma, tax, utils - `prisma/schema.prisma` - database schema - `scripts/` - setup-admin, reset-password ## Conventions - TypeScript strict; use unknown/guard checks for external data - UI: Tailwind v4 + shadcn/ui - Error handling: Remix redirect, json, badRequest - API contracts in `app/routes/api.*` must remain backward compatible - Document business logic for complex changes (taxes, invoice codes, UStG ยง14) ## Testing - Vitest: `npm run test` (run), `npm run test:watch` (watch) - No additional services required for unit tests ## graphify This project has a graphify knowledge graph at graphify-out/. Rules: - Before answering architecture or codebase questions, read graphify-out/GRAPH_REPORT.md for god nodes and community structure - If graphify-out/wiki/index.md exists, navigate it instead of reading raw files - After modifying code files in this session, run `python3 -c "from graphify.watch import _rebuild_code; from pathlib import Path; _rebuild_code(Path('.'))"` to keep the graph current