Hey everyone,
I’m thinking about using Next.js for my next project, but I’m not sure if it’s the right choice. I really like how Next.js handles loading states and makes routing super easy. It seems like it could save me a lot of time on the frontend.
The thing is, I’m not too keen on putting my backend stuff in the api
folder. I’d rather keep my backend separate. Does anyone know if it’s possible to use Next.js just for the frontend part? I’m worried it might make deployment tricky.
Also, I should mention that I’m not planning to use Vercel for hosting. Will that cause any issues?
I’d love to hear from folks who’ve tried this setup or have any thoughts on it. Thanks in advance for your help!
hey, next.js for frontend only is legit and works. but how r u planning to handle data? i’d love to hear more about your backend idea. curious to learn what stack u might use?
Absolutely, you can use Next.js solely for frontend development. I’ve done this on several projects, and it works beautifully. You don’t have to use the API routes if you don’t want to - that’s just an optional feature.
For your backend, you can set up a separate server using something like Express or FastAPI. Then, configure your Next.js app to make API calls to that server. This approach gives you more flexibility and keeps your concerns nicely separated.
Regarding deployment, it’s entirely possible without Vercel. I’ve deployed Next.js apps on AWS, DigitalOcean, and even traditional VPS setups. You might need to tweak your build process a bit, but it’s definitely doable.
Just remember to set up your environment variables correctly for API endpoints and you should be good to go. It’s a powerful stack that offers great performance and developer experience.