# AGENTS.md
## Setup
- `pnpm install` to install dependencies
- `pnpm dev` to start the dev server on port 3000
- `pnpm test` to run the test suite (Jest)
## Architecture
- `src/api/` — Express route handlers, one file per resource
- `src/services/` — business logic, no direct database access
- `src/db/` — Prisma schema and migrations
- `src/workers/` — background job processors (BullMQ)
## Conventions
- Use named exports, not default exports
- Error responses use `src/lib/errors.ts` helpers, never raw status codes
- All new API endpoints need an integration test in `tests/api/`
## Testing
- Unit tests live next to the file they test (`foo.test.ts`)
- Integration tests go in `tests/api/` and run against a real Postgres instance
- Run `pnpm test:integration` separately — these require Docker
## Deployment
- Main branch auto-deploys to staging
- Production deploys go through the `release` branch and require a passing CI check
- Database migrations run automatically on deploy — never run them manually