Help to deploy my TRPC proj from a monorepo (turborepo) at Vercel
I'm trying to learn monorepo with TRPC, both are new for me and Im kind struggling to deploy it because Im super newbie in deployments.
I have a turborepo with two apps, one is my react app and other one is my node server in express + TRPC.
I dont know if I did correctly but I went to vercel and Ive choose the FE project; for the build options I left what had there already, seems Vercel knows what to do when its turbo repo and it went all good!!
In my head I had to make a separate new deploy from the same repo but choose the server (express + trpc), and then with my new service up and running set the env variable with the server url on the FE proj and all done.
the thing is, I didnt found the node/express option on Vercel, and somehow I think I shouldnt deploy them separately.
I dont know well how turborepo works and it sounds a bad place to ask help but thats what I got.
Thanks all!
6 Replies
up ;-;
I just asked a similar question from a different point of view, maybe help will come from there. Will be watching here as well.
The question is how should a monorepo trpc api be deployed.
should answer mine too!
maybe understanding how turbo build and runs should solve, I notice when we run turbo run dev for example it didn't initialize automatically like the build which is detected
Look at this example:
https://github.com/lukevella/rallly
They are using tRPC in a monorepo, and they’ve deployed the tRPC in a backend server via nextjs. (See packages/backend)
Then in the FE its easy to use it again (See apps/web/src/pages/api/trpc)
GitHub
GitHub - lukevella/rallly: Rallly is an open-source scheduling and ...
Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier. - GitHub - lukevella/rallly: Rallly is an open-source scheduling and collaboration...
what Im looking for is deploy an server separately using trpc. Im not using next in my case
did you found anything @Mendy ?
Sort of? But not really answering your question.
Take a look here:
https://www.reddit.com/r/nextjs/comments/134ge5q/best_practice_on_running_trpc_in_a_monorepo/?utm_source=share&utm_medium=ios_app&utm_name=ioscss&utm_content=2&utm_term=1
reddit
r/nextjs - Best practice on running tRPC in a monorepo.
5 votes and 18 comments so far on Reddit