Getting started with Convex and MonoRepo
I am looking at building a project that has the following:
- Mobile Expo App
- Multiple Next JS applications
In the past I always do this in a monorepo, is there anything special I have to do to make the apps use the same generated code? Is there any best practices?
8 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
Or is there a way to reference a convex project form multiple repos so the types stay updated?
<@35h6nwr87agxv93r3r7a5v5a9fxnw28>: Have you checked out https://www.convex.dev/templates/monorepo ?
Convex
Monorepo with Next.js and Expo
Fullstack monorepo template feat. Expo, Turbo, Next.js, Convex, Clerk This is a modern TypeScript monorepo template with...
@erquhart I saw your comment then it went away, I did see the multiple repos, curious if more people tend to do that with convex, seems like a good fit. I feel like I lean into mono repos to share the types and such from the api but it a huge pain to get right with stuff like TRPC.
Convex's approach seems like it could help remove some of the headache by keeping multiple repos and just reference it like the article you referenced
I don't know if it's the most common approach, but enough people have asked about it that it's an intentionally supported model. I commented because I thought convex bot was just ai giving the wrong suggestion, but I think it's actually a comment from a team member, and it's correct in that a monorepo is probably the way you want to go for your project. But for those that truly need (or want) to use multiple repos instead the support is there.
yeah this is a fairly greenfield project so it is in the early stages of just me overthinking and trying to rule out assumptions I have done in the past to solve old problems.
Gotcha. If the multiple nextjs apps are just different clients working with the same data, a monorepo approach should work really nicely for you.
Thanks
I am sure I will have a lot more questions, I am just kind of hovering on the outside to decide where to jump in on a few projects