tRPC Server

Build end-to-end typesafe APIs in TypeScript with no schemas, no code generation, and zero runtime bloat.

Framework
npm
v11.19.0
40,666 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
90 /100 Excellent
Development Activity 96
Maintenance 100
Community 64
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
91 /100 Excellent
Architecture 90
Code Quality 90
Innovation 95
Learning Curve 80

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 115 apps in this directory

TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

166

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
31
Repo Health
70
Technical
64
Dependency
Built with
TypeScript 76%
MDX 18%
Updated 1 years ago
TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

166

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
31
Repo Health
70
Technical
64
Dependency
Built with
TypeScript 76%
MDX 18%
Updated 1 years ago
TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

166

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
31
Repo Health
70
Technical
64
Dependency
Built with
TypeScript 76%
MDX 18%
Updated 1 years ago
TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

166

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
31
Repo Health
70
Technical
64
Dependency
Built with
TypeScript 76%
MDX 18%
Updated 1 years ago
TypeScript
89%
MIT

Amical

AI Assistants · Note Taking · Voice AI

1,540

Local-first AI dictation that understands your active app — private, offline, and built for speed.

View details
82
Repo Health
82
Technical
68
Dependency
Built with
TypeScript 89%
Updated 1 weeks ago
TypeScript
89%
MIT

Amical

AI Assistants · Note Taking · Voice AI

1,540

Local-first AI dictation that understands your active app — private, offline, and built for speed.

View details
82
Repo Health
82
Technical
68
Dependency
Built with
TypeScript 89%
Updated 1 weeks ago
TypeScript
89%
MIT

Amical

AI Assistants · Note Taking · Voice AI

1,540

Local-first AI dictation that understands your active app — private, offline, and built for speed.

View details
82
Repo Health
82
Technical
68
Dependency
Built with
TypeScript 89%
Updated 1 weeks ago
TypeScript
92%
GPL 3.0

Blinko

Knowledge Management · Note Taking

11,049

A self-hosted, AI-powered card note-taking tool that lets you capture fleeting thoughts instantly and retrieve them with natural language search.

View details
75
Repo Health
69
Technical
63
Dependency
Built with
TypeScript 92%
Updated 1 months ago
TypeScript
92%
GPL 3.0

Blinko

Knowledge Management · Note Taking

11,049

A self-hosted, AI-powered card note-taking tool that lets you capture fleeting thoughts instantly and retrieve them with natural language search.

View details
75
Repo Health
69
Technical
63
Dependency
Built with
TypeScript 92%
Updated 1 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers