API with Next.JS
Unanswered
Cuckoo wasp posted this in #help-forum
Cuckoo waspOP
I understand that Next.JS has api routing. My question, I think, is a bit more fundamental. We are building a Next.JS application. And hosting it at Vercel. Our application does a great deal of communication with our PostgreSQL server (also at Vercel, but I don't think that matters). We are communicating well enough with the database from inside our application. However, our v2 plan is to also release a native mobile app for Android and for iOS. Those two mobile applications will also need to access the same database. My thought is that we need to build our API as a standalone project so that all 3 applications will access a single API, ensuring consistency of data and also providing us with only one API that needs to be built. The question is, should we use Next.JS and Vercel to build that standalone API or something like Express. And, should we host it at Vercel. And, finally, can we build it inside the original Next.JS application and still have it available as purely an API for the 2 mobile applications?
Thank you in advance for your thoughts on this.
Thank you in advance for your thoughts on this.
12 Replies
Northeast Congo Lion
I would suggest Express or anything else outside of Vercel/NextJS if you're API is going to do alot
you will quickly hit vercel hobby limits, and you're generally better keeping API routes for minimal work
we had recent problem as well but we decided to keep all API work in separate standalone server, so multiple frontned (panel, mobile app etc) can all talk to the one API
@Northeast Congo Lion you will quickly hit vercel hobby limits, and you're generally better keeping API routes for minimal work
Cuckoo waspOP
Is your standalone API server hosted at Vercel? If not, where? AWS? Or something else?
Northeast Congo Lion
we have it hosted on dedicated server
with external provider
@Cuckoo wasp Is your standalone API server hosted at Vercel? If not, where? AWS? Or something else?
Northeast Congo Lion
AWS, Azure, GCP will all work
you are better to understand your requirements for the project, how many requests, network load etc
aws azure etc are good to use but can get expensive.
Cuckoo waspOP
ok. Thanks. Gosh, in my somewhat limited experience, traffic has to be very high before AWS is expensive. I just don't like having to "manage" the server at all. Linux is not our strong suit. We would much rather write great code than be experts in hardware. Your input is very much appreciated.
@Cuckoo wasp ok. Thanks. Gosh, in my somewhat limited experience, traffic has to be very high before AWS is expensive. I just don't like having to "manage" the server at all. Linux is not our strong suit. We would much rather write great code than be experts in hardware. Your input is very much appreciated.
Northeast Congo Lion
sure, i am the same, i just hire a dedicated resource
to manage our infrastructure