How to combine multiple backend projects that have different tech stack

Hello fellow developers o/ I have an interesting situation. I have a nextjs website that requires 2 external backing projects to fulfil its functionality needs. The backend projects are written in express and springboot respectively. I wanted to combine the backend projects somehow (like "route1" is express and "route2" is springboot api's) so that i don't need to host the projects at different places. Is there a way to achieve that? I'll be using bevel to deploy the website if that's relevant in any way, sorry pretty new to backend. Also pardon me for bad english, it's not my native language. Extended question: Can it be made so nextjs app and its ssr is maintained but its "api" route call the combined backend projects api. Thanks in advance for your valuable suggestions ๐Ÿ˜„
5 Replies
Yash Saxena
Yash SaxenaOPโ€ข2mo ago
using vercel* to deploy
Styly
Stylyโ€ข2mo ago
why express? You can can get away with 99% of use cases on next api routes? but yes you can make the next project like a proxy but i dont see the point in wasting requests.
rv0
rv0โ€ข2mo ago
Hey, could you include why you don't want to host these projects with two different providers? Obviously it's more convenient to have them in the same place, but are there other reasons? The reason I'm asking is that it seems that Springboot deployment to Vercel is possible, but not with the same one-click experience that youd get with NextJS. Unless I'm mistaken about the Springboot situation, your options are: 1) Make your springboot application run on Vercel anyway 2) Avoid the above by rewriting the Springboot backend to express and merge those two. 3) Pick a different provider that supports both JS and Java backends out of the box 4) Learn how to set up webservers and host through a VPS. 5) Host with different providers anyway 6) Many more combinations of the above Some additional info on Java + Vercel: Supported frameworks Build image / Runtimes Community Runtimes Build Output API
GitHub
vercel/DEVELOPING_A_RUNTIME.md at main ยท vercel/vercel
Develop. Preview. Ship. Contribute to vercel/vercel development by creating an account on GitHub.
Supported Frameworks on Vercel
Learn about the frameworks that can be deployed to Vercel.
Build image
Learn about the container image used for Vercel builds.
Build Output API (v3)
The Build Output API is a file-system-based specification for a directory structure that can produce a Vercel deployment.
Choosing a Runtime
Runtimes transform your source code into Functions, which are served by our Edge Network. Learn about the official runtimes supported by Vercel.
Yash Saxena
Yash SaxenaOPโ€ข2mo ago
my main reason for not hosting these projects with teri different providers was just the excessive cloud cost. I'd love to use vercel for springboot but as far as i'm aware vercel only supports js based projects.
rv0
rv0โ€ข2mo ago
In that case I can definitely recommend option nr 4. Even if you decide youre not going to host your own production youll have seen the basics of webhosting, which is something youre able to use for the rest of your life
Want results from more Discord servers?
Add your server