tRPC Full-Stack API

•
38k
•

Accelerates the development of end-to-end type-safe APIs using tRPC to eliminate schema overhead and enable seamless TypeScript integration.

This skill provides a comprehensive framework for building type-safe full-stack applications where server-side logic and client-side calls share the same TypeScript definitions. It guides users through creating routers, procedures, and middleware, specifically addressing the nuances of Next.js App Router vs. Pages Router. By leveraging Zod for validation and React Query for data fetching, it ensures that every API call is autocompleted and validated at compile-time, significantly reducing runtime errors and refactoring friction in monorepos.

주요 기능

0137,717 GitHub stars
02Advanced procedure types including queries, mutations, and real-time subscriptions
03Dual-context factory patterns for Next.js App Router and Server Components
04Middleware implementation for authentication, logging, and request enrichment
05Automatic Zod-based input validation and custom error formatting
06End-to-end type safety without schema generation or REST/GraphQL boilerplate

사용 사례

01Implementing real-time features like notifications using tRPC subscriptions and WebSockets
02Migrating existing REST or GraphQL APIs to a type-safe tRPC architecture
03Building a TypeScript monorepo with Next.js where client and server share a codebase