# Project Context

Backend API using:

- Node.js 20
- Express
- TypeScript (strict)
- Sequelize ORM
- Zod for validation

---

## Architecture (Strict)

Layers:

- Routes → Controllers → Services → Repositories

Rules:

- Routes: HTTP wiring only
- Controllers: request/response only
- Services: all business logic
- Repositories: Sequelize queries only

No database access outside repositories.
No business logic in controllers or routes.

---

## Sequelize Rules

- Class-based models only
- Explicit interfaces (no inferAttributes)
- Models must match migrations
- Use transactions for multi-step writes

---

## TypeScript Rules

- No `any`
- No unsafe casting
- Explicit interfaces preferred

---

## Validation & Errors

- Zod validation via middleware
- Services throw domain errors
- Controllers map errors to HTTP responses

---

## Claude Must NOT

- Create fat controllers
- Skip layers
- Use deprecated Express patterns
- Introduce new libraries unless asked
