DEV Community

Abhishek Kashyap
Abhishek Kashyap

Posted on

How I built a SaaS for Restaurants using Next.js 15 & Supabase (and how you can too)

I'm a 3rd-year engineering student, and recently I took on a freelance challenge: Build a Digital Menu system for a local restaurant.

The requirement was simple: The owner wanted to update prices on his phone, and customers should see the changes instantly via a QR code.

Here is how I architected the solution using the Next.js 15 App Router and Supabase.

The Database (Supabase)
I needed a relational DB. I set up two main tables:

restaurants (id, name, logo)

menu_items (id, name, price, restaurant_id)

The Security (RLS Policies)
This was the tricky part. I didn't want Restaurant A to edit Restaurant B's menu. I used Supabase RLS (Row Level Security) to enforce this:

create policy "Owners can update their own items"
on menu_items
for update
using ( auth.uid() = owner_id );
Now, the frontend is secure by default.

  1. The Frontend (Next.js 15) I used Server Actions for the mutations. When the owner changes a price, it calls a Server Action that writes directly to Supabase and revalidates the cache path. 'use server' export async function updatePrice(id, newPrice) { const supabase = createClient(); await supabase.from('menu_items').update({ price: newPrice }).eq('id', id); revalidatePath('/dashboard'); }

The Result
The app is blazing fast. The restaurant owner loves it because they don't have to reprint paper menus anymore.

Want the Source Code?
I realized many freelancers struggle with this same setup (Auth + Database + Dashboard). So, I cleaned up the code and packaged it as a Starter Kit.

It includes:

Full Admin Dashboard

QR Code Generator

Mobile-Optimized Menu View

Agency License (Sell to clients & keep 100% profit)

I'm launching it today with a student discount (₹1,000 OFF).

👉 Get the Source Code here: https://abhinova343.gumroad.com/l/restrosaas

Let me know if you have questions about the Next.js 15 setup in the comments!

nextjs #supabase #webdev #javascript

Top comments (0)