# System map — trpc/trpc

> Canonical page: https://codevetter.com/unpack/trpc/system-map

# System map — trpc/trpc

Scanned commit 8b649ad874a8fe97c73962d4617912231b975736 (2026-09-17). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

The publishable libraries live under packages/ and are wired as a pnpm workspace (packages/*, examples/*, www) driven by Turborepo. @trpc/server is the runtime and type core; adapters are thin wrappers around resolveResponse or, for WebSockets, applyWSSHandler. The client is a link chain terminated by HTTP or WS. There is no database inside the library — persistence shows up only in examples (Prisma, Drizzle). Release is Lerna at 11.19.0, with @trpc/openapi published separately as 11.19.0-alpha. Docs are a Docusaurus app deployed with a large Vercel redirect map.
- Root package.json names the workspace root, requires Node ^24.0.0 and pnpm ^12 (packageManager pnpm@12.4.1), and exposes build (turbo --filter=./packages/* build), dev, test (vitest), typecheck-packages, lint, and Lerna canary/prerelease scripts. — [package.json#L1-L37](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/package.json#L1-L37) [pnpm-workspace.yaml#L1-L20](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/pnpm-workspace.yaml#L1-L20)
- pnpm-workspace.yaml includes packages/*, examples/*, examples/.* /*, examples/minimal*, and www plus www/og-image. The default catalog pins vitest ^5, vite ^8, turbo ^2.10, next ^15.5, fastify ^5, and typescript ^7.0.2, while catalog ts-api pins typescript ^6.0.3 and the root package depends on catalog:ts-api. — [pnpm-workspace.yaml#L1-L76](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/pnpm-workspace.yaml#L1-L76) [package.json#L71-L72](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/package.json#L71-L72)
- Published library versions in this tree are @trpc/server, @trpc/client, @trpc/react-query, @trpc/next, and @trpc/tanstack-react-query at 11.19.0. lerna.json version is 11.19.0 with npmClient pnpm. @trpc/openapi is 11.19.0-alpha and is not on the same stable version line. — [packages/server/package.json#L2-L5](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/server/package.json#L2-L5) [packages/client/package.json#L2-L5](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/client/package.json#L2-L5) [packages/react-query/package.json#L2-L5](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/react-query/package.json#L2-L5) [packages/next/package.json#L3-L5](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/next/package.json#L3-L5) [packages/openapi/package.json#L2-L5](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/openapi/package.json#L2-L5) [lerna.json#L1-L6](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/lerna.json#L1-L6)
- Server public API is packages/server/src/@trpc/server/index.ts, re-exported by packages/server/src/index.ts. It exports initTRPC, TRPCError, lazy, tracked, callProcedure as callTRPCProcedure, and inference helpers. Implementation lives under packages/server/src/unstable-core-do-not-import/, which is also a package export named ./unstable-core-do-not-import. — [packages/server/src/@trpc/server/index.ts#L1-L86](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/server/src/%40trpc/server/index.ts#L1-L86) [packages/server/src/index.ts#L1](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/server/src/index.ts#L1) [packages/server/package.json#L167-L176](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/server/package.json#L167-L176)
- initTRPC is a single TRPCBuilder instance. context() and meta() only change generics; create() builds RootConfig (transformer, isDev from NODE_ENV, allowOutsideOfServer, errorFormatter, isServer) and returns procedure, middleware, router, mergeRouters, and createCallerFactory. It throws if isServer is false unless allowOutsideOfServer is true. — [packages/server/src/unstable-core-do-not-import/initTRPC.ts#L117-L221](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/server/src/unstable-core-do-not-import/initTRPC.ts#L117-L221) [packages/server/src/unstable-core-do-not-import/rootConfig.ts#L20-L66](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/server/src/unstable-core-do-not-import/rootConfig.ts#L20-L66)
- HTTP handling is resolveResponse in unstable-core-do-not-import/http/resolveResponse.ts. Official adapters that call it or nodeHTTPRequestHandler include fetchRequestHandler, createNextApiHandler, createExpressMiddleware, fastifyTRPCPlugin, awsLambdaRequestHandler, and createHTTPServer/createHTTPHandler. WebSockets use applyWSSHandler instead. — [packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts#L213-L215](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts#L213-L215) [packages/server/src/adapters/fetch/fetchRequestHandler.ts#L24-L47](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/server/src/adapters/fetch/fetchRequestHandler.ts#L24-L47) [packages/server/src/adapters/next.ts#L33-L59](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/server/src/adapters/next.ts#L33-L59) [packages/server/src/adapters/express.ts#L25-L38](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/server/src/adapters/express.ts#L25-L38) [packages/server/src/adapters/fastify/fastifyTRPCPlugin.ts#L36-L39](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/server/src/adapters/fastify/fastifyTRPCPlugin.ts#L36-L39) [packages/server/src/adapters/standalone.ts#L94-L100](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/server/src/adapters/standalone.ts#L94-L100) [CONTRIBUTING.md#L71-L87](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/CONTRIBUTING.md#L71-L87)
- @trpc/client exports createTRPCClient plus subpath links httpBatchLink, httpLink, loggerLink, splitLink, and wsLink, and an ./unstable-internals export. Peer dependency is @trpc/server 11.19.0. Each library package builds with tsdown (build / dev --watch) rather than tsc emit. — [packages/client/package.json#L25-L119](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/client/package.json#L25-L119) [packages/client/src/createTRPCClient.ts#L160-L166](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/client/src/createTRPCClient.ts#L160-L166) [packages/server/package.json#L18-L20](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/packages/server/package.json#L18-L20)
- turbo.json caches build outputs dist, .next, and build, makes dev persistent and uncached, and declares global env CI, NODE_ENV, DATABASE_URL, NEXTAUTH_SECRET, AUTH_GITHUB_ID, and AUTH_GITHUB_SECRET. Lint and typecheck depend on ^build. — [turbo.json#L1-L55](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/turbo.json#L1-L55)
- CI workflow .github/workflows/main.yml runs on pull_request and on push to main, next, and canary. PR jobs build, typecheck packages, typecheck www, unit tests with coverage, and an examples e2e matrix that includes Postgres. Release is .github/workflows/release-manual.yml (workflow_dispatch patch/minor with dist-tag latest or canary, plus push to main touching packages). NPM_CONFIG_PROVENANCE is true. — [.github/workflows/main.yml#L1-L159](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/.github/workflows/main.yml#L1-L159) [.github/workflows/release-manual.yml#L1-L39](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/.github/workflows/release-manual.yml#L1-L39)
- www/package.json is a private Docusaurus 3 site (docusaurus start/build) that depends on the workspace tRPC packages. www/vercel.json is a large permanent-redirect table from old /docs paths onto the current docs IA, plus /discord, /sponsor, and /drift. — [www/package.json#L1-L28](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/www/package.json#L1-L28) [www/vercel.json#L1-L20](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/www/vercel.json#L1-L20)
- The library has no storage layer. examples/next-prisma-starter persists posts with Prisma. examples/next-sse-chat persists Channel and Post with Drizzle (pgTableCreator prefix sse-chat_) and Postgres. examples/cloudflare-workers is a WorkerEntrypoint whose fetch() calls fetchRequestHandler with an empty context and no database. — [examples/next-prisma-starter/src/server/routers/post.ts#L1-L10](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/examples/next-prisma-starter/src/server/routers/post.ts#L1-L10) [examples/next-sse-chat/src/server/db/schema.ts#L1-L58](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/examples/next-sse-chat/src/server/db/schema.ts#L1-L58) [examples/cloudflare-workers/src/index.ts#L11-L23](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/examples/cloudflare-workers/src/index.ts#L11-L23)
- Vitest resolves @trpc/<pkg> imports to each package src/ via aliases built by reading package.json exports, so unit tests execute TypeScript source rather than dist. Root vitest.config.ts merges that shared config and sets test.projects to ./packages/*. — [vitest.shared.ts#L9-L70](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/vitest.shared.ts#L9-L70) [vitest.config.ts#L1-L10](https://github.com/trpc/trpc/blob/8b649ad874a8fe97c73962d4617912231b975736/vitest.config.ts#L1-L10)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
