how to share a convex database between multiple repos?
I would like to share a convex database within two different projects. Each project in its own repo.
How can I do this?
11 Replies
I believe convex allows you to init a project in another git repo and import it however you dont get all the type benefits of it being local (unless you use git submodules maybe.
i'm thinking about putting the projects ni the same repo and use pnpm workspaces to share the convex code with all the apps
great idea. There's a repo with a turborepo monorepo. Monorepo is my recommendation, so you get the type benefits & autocomplete in both. However if one is python and doesn't use types right now, you can just configure the CONVEX_URL to point to the existing backend
there is an
anyAPI
type right? That is used for when your convex is not directly in the same project rootactually in the frontend i use rescript so i don't get much of the type safety from convex. But it is really nice to have TS in convex. I just make sure to mirror the types in Rescript and keep it updated.
never heard of
rescript
what does it do that convex types dont?ReScript Documentation
The ReScript Programming Language
Fast, Simple, Fully Typed JavaScript from the Future
Rescript is like Typescript but purely functional programming
oh
i see
@Gorka Cesium in case you missed it I just published a monorepo template: https://www.convex.dev/templates/monorepo
If you ended up with any best practices you didn't see there for pnpm etc. lmk!
Templates
The backend application platform with everything you need to build your product.
thank you Ian, i'll check it right now
this is exactly how i was thinking to do it. Great to see this validation