> Markdown version of [/videos/796-trpc-api-schemas-are-pure-overhead](https://www.wearedevelopers.com/videos/796-trpc-api-schemas-are-pure-overhead). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # tRPC: API schemas are pure overhead API schemas and code-generation pipelines are pure overhead. Discover how tRPC uses native TypeScript inference to deliver instant, end-to-end type safety from your database to your UI. - **Speakers:** Giorgio Boa - **Event:** World Congress 2023 - **Published:** October 23, 2023 - **Duration:** 27:00 - **URL:** https://www.wearedevelopers.com/videos/796-trpc-api-schemas-are-pure-overhead ## Summary Modern full-stack development often suffers from "schema fatigue," where tools like OpenAPI and GraphQL require learning domain-specific languages and relying on tedious code-generation pipelines just to ensure type safety. tRPC eliminates this pure overhead by leveraging TypeScript's native `typeof` inference to share data boundaries seamlessly. By defining an application router on the backend, developers can instantly share request and response types with the client without maintaining intermediate schemas or compilation steps. In practical Next.js implementations, tRPC pairs heavily with Zod for stringent payload validation and Prisma for database modeling, creating an unbroken chain of type safety from the UI down to the database. When a backend developer alters an endpoint name or parameter, the frontend immediately flags a compilation error, resolving traditional collaboration bottlenecks. Despite operating like local function calls, tRPC executes as standard HTTP fetch requests under the hood, meaning developers can still utilize browser network tabs and breakpoint debugging to trace operations across the client-server divide. Adopting tRPC requires architectural trade-offs, most notably strict lock-in to a full-stack TypeScript ecosystem, making it unsuitable for polyglot environments without publishing types via external NPM packages. Furthermore, unlike GraphQL, versioning or distinct data parsing requires custom endpoint logic. However, for continuous single-language codebases—such as those bootstrapped with create-t3-app—teams can vastly accelerate builds by implementing tRPC middlewares for tasks like role-based access control, a pattern observable in large-scale open-source repositories like cal.com. **Keywords:** trpc routing, api schema fatigue, openapi code generation, graphql type generation, full-stack typescript integration, next.js api handlers, prisma database modeling, zod payload validation, typescript type inference, trpc middlewares, client-server type sharing, http network debugging, create-t3-app bootstrapping, npm package type publishing, role-based access control ## Chapters 1. **Schema fatigue in OpenAPI and GraphQL specifications** (00:16) — Working with strict schemas requires learning new declarative languages and running extra code generation steps. 1. **Introduction to tRPC and TypeScript type inference** (03:23) — Extracting object shapes using TypeScript typeof enables sharing data between client and server without explicit schemas. 1. **Live coding a Next.js application with tRPC** (05:40) — Configuring a shared app router allows backend method changes to instantly surface as frontend build errors. 1. **Debugging tRPC network requests and server execution** (12:24) — Inspecting HTTP payloads and placing breakpoints uncovers how client browser fetches execute server-side business logic. 1. **Evaluating tRPC tradeoffs and real-world implementation** (18:38) — While tRPC provides seamless integration for full-stack TypeScript codebases, sharing public APIs requires custom middleware integrations. 1. **Handling multi-repository setups and heterogeneous ecosystems** (23:56) — Sharing type definitions across separate repositories involves compiling an npm package to maintain strict API contracts. ## Related Moments - [Introduction to the GraphQL, Apollo, and Next.js stack](https://www.wearedevelopers.com/videos/311-graphql-apollo-next-js-a-lovely-trio) (from "GraphQL + Apollo + Next.js: A Lovely Trio") - [Questions on architecture typing and team organization](https://www.wearedevelopers.com/videos/318-destructuring-frontend-monoliths-with-microfrontends) (from "Destructuring Frontend monoliths with MicroFrontends") - [Evaluating architectural trade-offs between REST and gRPC](https://www.wearedevelopers.com/videos/1935-boosting-opensearch-performance-grpc-search-in-action) (from "Boosting OpenSearch Performance: gRPC Search in Action") - [Choosing TypeScript for complex backend applications](https://www.wearedevelopers.com/videos/1033-nest-js-typescript-in-the-backend-can-also-be-clean) (from "Nest.js - TypeScript in the backend can also be clean") - [Understanding the architectural drivers of gRPC performance gains](https://www.wearedevelopers.com/videos/1964-boosting-opensearch-performance-grpc-search-in-action) (from "Boosting OpenSearch Performance: gRPC Search in Action") - [Developing robust backend applications with the Nest framework](https://www.wearedevelopers.com/videos/421-next-nest-nuxt-nust) (from "Next, Nest, Nuxt… Nust?") ## Related Articles - [Exploring TypeScript: Benefits for Large-Scale JavaScript Projects](https://www.wearedevelopers.com/magazine/554-exploring-typescript-benefits-for-large-scale-javascript-projects) - [Next.js App Router: Explained](https://www.wearedevelopers.com/magazine/387-next-js-app-router-explained) - [Dev Digest 136 - No JS(on) of mine](https://www.wearedevelopers.com/magazine/482-dev-digest-136-no-js-on-of-mine) - [Web Development Best Practices: What The Data Tells us](https://www.wearedevelopers.com/magazine/84-web-development-best-practices-what-the-data-tells-us) ## Related Jobs - [Senior Full Stack Engineer](https://www.wearedevelopers.com/jobs/48289-senior-full-stack-engineer) at **Sensory-Minds GmbH** - [React Engineer for Next.js UI - Hybrid, Impactful FinTech](https://www.wearedevelopers.com/jobs/ext/1444505-react-engineer-for-next-js-ui-hybrid-impactful-fintech) at **Bitpanda** - [Software Engineer, React & Angular (Broker Web Platform](https://www.wearedevelopers.com/jobs/ext/1558399-software-engineer-react-angular-broker-web-platform) at **Bitpanda** - [Senior Fullstack Engineer, Angular & Nestjs (Defi Wallet)](https://www.wearedevelopers.com/jobs/ext/1983681-senior-fullstack-engineer-angular-nestjs-defi-wallet) at **Bitpanda** - [React Engineer For Next.Js Ui - Hybrid, Impactful Fintech](https://www.wearedevelopers.com/jobs/ext/1934580-react-engineer-for-next-js-ui-hybrid-impactful-fintech) at **Bitpanda** - [Senior Software Engineer, Client Apps Platform](https://www.wearedevelopers.com/jobs/ext/1773893-senior-software-engineer-client-apps-platform) at **GitHub**