Next js front end + Python Backend + Convex
Hello! I'm currently working on a project with a Python backend and a Next.js frontend. I'm exploring Convex DB for real-time capabilities and efficient data management. I have a few questions about integrating Convex into my stack:
Can I use Convex DB alongside my Python backend for managing database operations?
For my Next.js frontend, I'm interested in utilizing Convex's query and mutation functions for dynamic data interaction. Could you provide guidance or best practices on setting up Convex with Next.js, especially for real-time data updates and interactions?
Are there any examples or documentation available that showcase the integration of Convex with a Python backend and a Next.js frontend? I'm particularly keen on understanding how to structure real-time data flows between my backend, Convex DB, and the frontend.
Lastly, do you have any tips or common pitfalls to avoid when integrating Convex into a project with this stack?
2 Replies
Hey @deji_e, with Next.js, Python backend and Convex, you have 3 servers for your webapp. That's quite a lot 🙂 So first I would suggest dropping the Python backend if you can. If you can't (you have some Python-only workload), I'd suggest you treat that server as a third-party service. Then you can have your frontend talk directly to Convex and have Convex talk to your Python service. Next.js will essentially serve as your frontend CDN.
Does this approach work for you?
sorry for the delayed response, I thought I hit send ! but yes I think the approach you recommended will work fine
thanks again