tRPCttRPC
Powered by
amandineperichonA
tRPC•3y ago
amandineperichon

Code structure for a large monorepo using nx + tRPC

We have a large monorepo with a single tRPC API that will be used by several web clients and other consumers. We use nx for our build system.

We want a way to share the API contract between client and api, but we don’t want implementation changes that do not change the API contract to trigger a rebuild of all the clients and consumers.

Ideally we’d also want to have our api split into several routers and have some applications only rely on a subset of the routers.

We don’t want to use codegen to generate shared types. We’re after a structure that will let us separate the contract from the implementation, similar to ts-rest (https://ts-rest.com/docs/comparisons/rpc-comparison)

Does anyone else have a similar use case, and can share how they structured their code/ app/ libs ?
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

NextJS + TRPC + NX
CaptainCCaptain / ❓-help
4y ago
Right way to structure your code when using tRPC?
StivoSStivo / ❓-help
4y ago