tRPC Server
Build end-to-end typesafe APIs in TypeScript with no schemas, no code generation, and zero runtime bloat.
Repository Health
Technical Analysis
tRPC Server is the backend half of tRPC, a framework for building fully typesafe APIs in TypeScript. You define routers of procedures on the server, and their input and output types flow directly to the client through TypeScript inference alone, with no schemas, code generation, or build step in between.
It ships with adapters for Next.js, Express, Fastify, AWS Lambda, the Fetch API, standalone Node HTTP, and WebSockets, plus first-class support for input validation, middleware, context, data transformers, request batching, and subscriptions. The package has zero runtime dependencies and works with any validation library.
What You Get
- A router and procedure API for defining queries, mutations, and subscriptions on the server
- Adapters for Next.js, Express, Fastify, AWS Lambda, Fetch, standalone Node HTTP, and WebSockets
- Composable middleware, request context, and pluggable data transformers
- Input and output validation that works with Zod, Valibot, or any compatible parser
- Automatic request batching and end-to-end type inference with zero runtime dependencies
Common Use Cases
- Powering the API layer of a full-stack Next.js or React application
- Adding a typesafe backend to an existing Node.js server with Express or Fastify
- Building realtime features with typed WebSocket subscriptions
- Deploying serverless API endpoints on AWS Lambda or edge runtimes via the Fetch adapter
Under The Hood
Architecture The core lives in packages/server/src/unstable-core-do-not-import/, where initTRPC.ts builds a runtime config that produces the router, procedure, and middleware factories via procedureBuilder.ts, router.ts, and middleware.ts. Procedures are plain objects describing input/output parsers and a resolver; routers compose them into a nested tree that the HTTP layer (http/) resolves per request. Framework-specific entry points in adapters/ (Next.js, Express, Fastify, AWS Lambda, Fetch, node-http, standalone, ws) adapt each host’s request/response model onto the shared core resolver, while type inference flows from the server’s router type to the client with no serialized schema.
Tech Stack The library is written entirely in TypeScript (84% of the repo), built with tsdown and organized as a pnpm + Turborepo + Lerna monorepo alongside the client, react-query, next, and openapi packages. It publishes dual ESM/CJS output with separate type declarations per entry point and ships zero production dependencies, relying only on the consumer’s chosen validation library.
Code Quality Testing is thorough: the monorepo contains over 100 .test.ts files, with core units like procedureBuilder.test.ts, router.test.ts, and initTRPC.test.ts colocated next to their sources and covered by Vitest with Codecov reporting. The codebase leans heavily on advanced TypeScript generics and inference helpers (types.ts, utils.ts), enforced with ESLint and Prettier.
API Design The public API is the project’s defining strength: a single initTRPC entry point yields a fluent, chainable builder for procedures and middleware, so getting started requires minimal boilerplate. Documentation on trpc.io is extensive, the repo ships dozens of runnable examples across runtimes, and naming (query, mutation, subscription, input, use) maps cleanly to intuitive concepts.
Used by 35 apps in this directory
Abby
Developer Tools · Product Management
Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.
Amical
Note Taking · AI Assistants
Local-first AI dictation that understands your active app — private, offline, and built for speed.
Blinko
Knowledge Management · Note Taking
A self-hosted, AI-powered card note-taking tool that lets you capture fleeting thoughts instantly and retrieve them with natural language search.
Bun
Developer Tools
An all-in-one JavaScript and TypeScript toolkit — one Rust-and-JavaScriptCore binary that replaces Node.js, npm, a bundler, and a test runner with faster equivalents.
Cal.diy
Scheduling
The 100% MIT-licensed, community-driven scheduling platform — self-host your own booking infrastructure with no enterprise strings attached.
Documenso
Digital Signiture
Self-hosted, open-source DocuSign alternative with legally binding PDF signatures, multi-party workflows, and a full REST and tRPC API.
Dokploy
Devops · Hosting Control Panel · Security
Self-hosted PaaS that deploys apps and databases on your own VPS using Docker, Traefik, and multi-build-system orchestration
Formizee
Forms Surveys
An open-source form backend and builder platform — design forms, collect submissions, and get analytics without hosting your own server, positioned as an alternative to Formspree and Typeform.
highlight.io
Developer Tools · Analytics · Monitoring
Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.