# @repo/api — tRPC Router Definitions tRPC routers that call controllers from `@repo/core`. Each procedure validates input and delegates to a controller. ## Rules - NEVER put business logic in routers — delegate to controllers - Input validation uses Zod schemas - Each domain gets its own router file ## Adding a New tRPC Router 1. Create `src/router/{domain}.router.ts` 2. Import `router` and `publicProcedure` from `../trpc.js` 3. Define procedures (`.query()` for reads, `.mutation()` for writes) 4. Each procedure calls a controller from `@repo/core` 5. Add router to root `appRouter` in `src/router/index.ts`