robh
robh2mo ago

2 Apps, 1 Convex Backend functions disappear

Hi All, I am testing Convex for a monitoring dashboard. I have a Nextjs app as the front end and a simple Node app that updates data in the DB. If I start my Nodejs app, I see my stats being updated. If I then start my Nextjs app, my Node functions get overwritten, and my stats do not update as the convex function they were using has disappeared. This is all in the Cloud Dev environment. Do you have any suggestions on the best way to persist functions from different apps in a single backend? Thanks
4 Replies
Convex Bot
Convex Bot2mo ago
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!
Nicolas
Nicolas2mo ago
You should have a single convex folder where you can write the Convex functions called from both your Node and your Next apps. One nice way to achieve that and keeping end-to-end type safety is to use a monorepo. You can take inpiration from this template: 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...
robh
robhOP2mo ago
Thanks @Nicolas I thought I might have to go that way. Thanks for the tip. Aprreciate it.
Nicolas
Nicolas2mo ago
Of course!

Did you find this page helpful?