schema0-api-router
Installation
SKILL.md
API Router
STOP before writing any router.
- New routers MUST use
createDb()against a Drizzle table. users.tsandfiles.tsare NOT templates. They call platform endpoints purpose-built for theusersandfilesplatform features — there is no Drizzle table behind them. Your application's entities are application data and go through your own tables; do not copyusers.ts/files.tsfor any new entity.- If your entity has no Drizzle table yet, invoke
schema0-db-schemafirst to define one.
File Location
packages/api/src/
├── index.ts # Base procedures (publicProcedure, protectedProcedure)
├── context.ts # Request context type
└── routers/
├── index.ts # App router (register all routers here)
└── [entity].ts # Entity-specific CRUD routers
Related skills
More from schema0/skills
schema0-dev
>-
23schema0-mobile
Mobile platform patterns — React Native / Expo, worker architecture, ORPC client, and navigation
17schema0-rls
Row-level security setup — RLS policies, authenticated database connections, and user-scoped data access
17schema0-ai
AI SDK integration with ORPC — chat streaming, prompt-response, tool calling, and provider configuration
17schema0-testing
Testing guide for web and mobile platforms — bun:test, Jest, PGlite, 3-layer validation, and test templates
17schema0-web-crud
Web frontend CRUD features — query collections, table columns, dialogs, forms, views, sidebar, and orchestration
17