tRPC Server

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

Framework
npm
v11.18.0
40,585stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
78/100Good
Development Activity72
Maintenance76
Community64
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
91/100Excellent
Architecture90
Code Quality90
Innovation95
Learning Curve80

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
30
Repo Health
70
Technical
63
Dependency
Built with
TypeScript76%
MDX18%
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
30
Repo Health
70
Technical
63
Dependency
Built with
TypeScript76%
MDX18%
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
30
Repo Health
70
Technical
63
Dependency
Built with
TypeScript76%
MDX18%
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
30
Repo Health
70
Technical
63
Dependency
Built with
TypeScript76%
MDX18%
Updated 1 years ago
TypeScript
88%
MIT

Amical

Note Taking · AI Assistants

1,522

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

View details
81
Repo Health
82
Technical
67
Dependency
Built with
TypeScript88%
Updated 2 days ago
TypeScript
88%
MIT

Amical

Note Taking · AI Assistants

1,522

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

View details
81
Repo Health
82
Technical
67
Dependency
Built with
TypeScript88%
Updated 2 days ago
TypeScript
88%
MIT

Amical

Note Taking · AI Assistants

1,522

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

View details
81
Repo Health
82
Technical
67
Dependency
Built with
TypeScript88%
Updated 2 days ago
TypeScript
92%
GPL 3.0

Blinko

Knowledge Management · Note Taking

10,992

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
80
Repo Health
69
Technical
63
Dependency
Built with
TypeScript92%
Updated 1 weeks ago
TypeScript
92%
GPL 3.0

Blinko

Knowledge Management · Note Taking

10,992

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
80
Repo Health
69
Technical
63
Dependency
Built with
TypeScript92%
Updated 1 weeks 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

Search