Gorka Cesium
Gorka Cesium15mo ago

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
CodingWithJamal
CodingWithJamal15mo ago
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.
Gorka Cesium
Gorka CesiumOP15mo ago
i'm thinking about putting the projects ni the same repo and use pnpm workspaces to share the convex code with all the apps
ian
ian15mo ago
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
CodingWithJamal
CodingWithJamal15mo ago
there is an anyAPI type right? That is used for when your convex is not directly in the same project root
Gorka Cesium
Gorka CesiumOP15mo ago
actually 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.
CodingWithJamal
CodingWithJamal15mo ago
never heard of rescript what does it do that convex types dont?
Gorka Cesium
Gorka CesiumOP15mo ago
ReScript Documentation
The ReScript Programming Language
Fast, Simple, Fully Typed JavaScript from the Future
Gorka Cesium
Gorka CesiumOP15mo ago
Rescript is like Typescript but purely functional programming
CodingWithJamal
CodingWithJamal15mo ago
oh i see
ian
ian11mo ago
@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.
Gorka Cesium
Gorka CesiumOP11mo ago
thank you Ian, i'll check it right now this is exactly how i was thinking to do it. Great to see this validation

Did you find this page helpful?