What problem does it solve?
Provides a consistent, type-safe pattern for building backend API endpoints that reduces runtime errors, prevents resource enumeration, and enforces authorization and tenant scoping across CRUD operations.
Core Features & Use Cases
- Procedure templates for read, create, update, delete, and list operations with pagination and search.
- Middleware composition patterns for authentication, authorization, tenant context validation, and input normalization.
- Robust validation and error handling using Zod schemas, standard error codes (NOT_FOUND, CONFLICT, BAD_REQUEST, FORBIDDEN, INTERNAL_SERVER_ERROR), and defensive tenant-scoped queries.
- Use Case: Implement a multi-tenant project service that enforces per-tenant access, validates inputs, returns inserted/updated records, and prevents resource enumeration.
Quick Start
Implement an authenticated create procedure for your entity using authProcedure, Zod input validation, tenant context checks, consistent ID/timestamp generation, and .returning() to return the created record.