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 ?
4.8KMembers
View on DiscordMore Posts
Does tRPC work with Clerk and Vercel Edge functions?So the answer is yes, at least locally, but I when I deploy to Vercel I get nothing. Trying to work TRPCClientError when creating a db entry without `updatedAt` value?Guys, this is my prisma schema:
```
model User {
id Int @id @default(autoincrement())