Next.js Discord

Discord Forum

Seeking Advice: Scaling a Restaurant Web App with Next.js and Hosting Concerns

Unanswered
Mackenzie River Husky posted this in #help-forum
Open in Discord
Mackenzie River HuskyOP
Hello everyone! I'm facing a problem—I've developed a web app for my girlfriend's parents' restaurant, where customers can order food for delivery. There's registration involved, with a Supabase database backend, but currently, payment is only possible via cash on delivery (which is enough for them). What hosting alternatives are available to scale this project to multiple restaurants while keeping costs low and ensuring protection against DDoS attacks? I've heard stories about Netlify and Vercel generating bills of thousands of dollars within hours ( if the traffic increases, they charge $40-50 for every 100GB). My girlfriend father has a few friends in the hospitality industry whom I'd like to help in a similar manner. I'm considering a solution where there's a core functionality project on Git, which I could then replicate for other websites with minor modifications. What hosting options should I consider? Can Next.js projects be hosted on Namecheap or Hostinger? I've heard they offer good prices and adequate protection. Thank you in advance for your assistance; unfortunately, I'm completely inexperienced when it comes to hosting. Also, I've been using Next.js for about six months now.

9 Replies

Fire ant
You can purchase any good VPS provider and deploy it there, for DDos protection, you can use Cloudflare. Learning how to deploy it on your own infra is good for your knowledge and experience, it also build up your Devops knowledge and you will have full access on your own app.
https://nextjs.org/docs/app/building-your-application/deploying
Crème D’Argent
Use vercel and supabase lol
@Crème D’Argent Use vercel and supabase lol
Blue-gray Gnatcatcher
They literally said they didn't want to use managed hosting with surprise billing.
Blue-gray Gnatcatcher
Although I do see that they implemented spend management after all the horror stories on Reddit and Twitter. @Mackenzie River Husky I'm as much of an advocate of self-hosting, and the solution proposed by @Fire ant is great if you are planning to maintain it, but if you want to focus on development I really believe a managed SaaS such as Vercel would save a lot of DevOps headaches, especially if you're developing this on your own with no server op.
Mackenzie River HuskyOP
Please don't be upset that I'm only responding now. I didn't receive any notification on Discord. Thank you very much for your willingness to help.
How difficult is it to set up a Next.js project on a VPS? For example, would it work smoothly on https://www.hostinger.com/vps-hosting? Would it have slightly less functionality compared to running it on Vercel's server?

ericswpark: Thanks to you too! I admit it's very convenient, I'm currently using it as well. Pricing is the real issue for me, as they charge a lot for a certain amount of traffic. However, in terms of this aspect, could hosting on Firebase be as easy as it is on Vercel?
There, though, I can't find bandwidth pricing, but the database pricing seems linear. However, as I see, the latest version it supports is 13.4.7.

I would also like another SaaS where there's no sudden surge in cost for a certain amount of traffic. If anyone happens to know of such a solution, please don't hesitate to share. I would greatly appreciate it. Thank you!
@Mackenzie River Husky Please don't be upset that I'm only responding now. I didn't receive any notification on Discord. Thank you very much for your willingness to help. How difficult is it to set up a Next.js project on a VPS? For example, would it work smoothly on https://www.hostinger.com/vps-hosting? Would it have slightly less functionality compared to running it on Vercel's server? ericswpark: Thanks to you too! I admit it's very convenient, I'm currently using it as well. Pricing is the real issue for me, as they charge a lot for a certain amount of traffic. However, in terms of this aspect, could hosting on Firebase be as easy as it is on Vercel? There, though, I can't find bandwidth pricing, but the database pricing seems linear. However, as I see, the latest version it supports is 13.4.7. I would also like another SaaS where there's no sudden surge in cost for a certain amount of traffic. If anyone happens to know of such a solution, please don't hesitate to share. I would greatly appreciate it. Thank you!
Blue-gray Gnatcatcher
FWIW, I'm currently hosting a project on a DigitalOcean droplet. As long as you stick to a long-term stable distro like Debian updates and upgrades should be a simple sudo apt update && sudo apt upgrade -y with no breakages (usually). The only pain point for us is that we actually grew out of the initial $10 droplet and had to rescale, which did incur a couple of minutes of downtime as DO resized the Droplet for us. Whether that's worth the cost savings or not is up to you to decide.

Also another tip is by the time you start to rack up charges you'll be looking at scaling up or migrating anyway, so there's no easy answers that will solve for each dev's specific usecase. I'd say try with a bunch of solutions, set billing caps, see which one you're more comfortable with, and sticking with that until you grow out of it or into it.

I have no experience with Firebase, but if it's anything like GCP billing mistakes are just as easy to make as AWS.
Mackenzie River HuskyOP
Thank you for the detailed response, I'll look into the topic further. The key point is that I can easily host stable versions on a VPS with SSR and SSG. However, which among Firebase, AWS, and Vercel is the most secure in terms of DDoS attacks and billing mishaps according to your information? I apologize if this is a silly question, but this part is not clear to me yet. Thanks in advance!
@Mackenzie River Husky Thank you for the detailed response, I'll look into the topic further. The key point is that I can easily host stable versions on a VPS with SSR and SSG. However, which among Firebase, AWS, and Vercel is the most secure in terms of DDoS attacks and billing mishaps according to your information? I apologize if this is a silly question, but this part is not clear to me yet. Thanks in advance!
Blue-gray Gnatcatcher
IMHO Vercel and other SaaS will offload security and DDoS concerns, at the cost of billing surges (which can be mitigated with caps as previously mentioned)
Selfhosted through something like DigitalOcean/Linode will prevent billing surges entirely, but it may incur downtime if you get unexpected growth and need to scale up the server. If you want to experiment, I'd say start DO and move to Vercel if you find it too cumbersome. If you just want to not deal with that then Vercel and then move to DO if you find the billing too unpredictable
Mackenzie River HuskyOP
Thank you so much your help!