Fastify
tRPC is a TypeScript-first RPC framework that enables end-to-end type-safe API communication between client and server without code generation or schemas. This monorepo contains the core server and client libraries, framework integrations (React Query, Next.js, Express, Fastify, Lambda, etc.), transport layers (HTTP, WebSocket, SSE streaming), a documentation website built with Docusaurus, example applications, and a codemod-based upgrade tool for version migrations.
Tech Stack
FastifyReactGraphQLPrismatRPCNext.jsDrizzle ORMExpress.jsZodTailwind CSS
Key Features
- Type-safe procedure builder
- Transport links system
- HTTP batch streaming
- WebSocket subscriptions
- Platform adapters
- React Query integration
- Next.js integration
- Observable-based subscriptions
- Version upgrade codemods
- Error handling and formatting
- Documentation website
Coding Conventions
Standards and patterns used in this codebase
file-organization
Monorepo structure: apps/ contains deployable applications, packages/ contains shared libraries
Packages: packages/client, packages/next, packages/react-querypackages/clientpackages/next
code-style
TypeScript is the primary language
All new files should be .ts or .tsxvitest.config.tsscripts/entrypoints.tswww/docusaurus.config.ts
configuration
Configuration is centralized in config files
Config files: eslint.config.js, prettier.config.jseslint.config.jsprettier.config.jsvitest.config.ts
data-layer
Database operations are in data layer
Data files: examples/next-prisma-starter/eslint.config.mjs, examples/next-prisma-starter/next.config.tsexamples/next-prisma-starter/eslint.config.mjsexamples/next-prisma-starter/next.config.tsexamples/next-prisma-starter/tailwind.config.ts