full stack2026Featured

Buddy's Hangout

Cafe Ordering & Operations

rohith-a.me/projects/proj-15
Buddy's Hangout - Cafe Ordering & Operations screenshot 1 of 1
01

The challenge

A neighbourhood cafe takes orders, table bookings and event enquiries over the counter, the phone and chat, with no single place for staff to see what the kitchen and the floor need next.

02

The approach

Built a mobile-first Next.js 15 App Router site on MongoDB/Mongoose with Zod validation on every API route. Per-table QR codes open the menu with the table pre-selected; the server re-prices every order from the database before saving it; staff sign in with an HMAC-signed HTTP-only cookie; public forms are rate-limited per IP; and dish photos are stored in MongoDB and served with immutable caching, because Vercel's filesystem is read-only.

03

The outcome

Guests can browse, order dine-in or takeaway, pay at the counter or by UPI, track the order live, book a table, enquire about events and join the newsletter. Staff run eight back-of-house sections: a polling kitchen board with a chime for new orders, payment verification, a menu studio with image uploads, table and QR printing, reservations with table assignment and clash warnings, an event pipeline, and a subscriber list with CSV export.

System design

How Buddy's Hangout is put together

One Next.js 15 App Router deployment serves both the guest site and the back of house. Guests order through validated, rate-limited API routes that re-price everything from MongoDB; staff screens are server-rendered behind a signed cookie and refresh by polling, so the whole system runs on serverless functions with no socket server.

back-of-house sections
8
Mongoose models
9
rate-limited public endpoints
6
signed staff session, extendable
12 h

01 · Clients

client

Guests

table QR or website

client

Staff

kitchen, floor, owner

02 · Next.js routes

gateway

Public API routes

Zod

orders, bookings, tracking

gateway

Admin pages & API

RSC

HMAC cookie checked per request

03 · Domain

service

Rate limiter

sliding window per IP

service

Order pricing

DB prices, available items only

service

QR generator

PNG and SVG per table

04 · Data

database

MongoDB

Atlas · Mongoose 8

9 collections

object store

Media collection

image bytes, 4 MB cap

clientgatewayservicedatabaseobject store

11 connections

  • Guests→Public API routesHTTPS
  • Staff→Admin pages & APIHTTPS
  • Public API routes→Rate limiter
  • Public API routes→Order pricingnew order
  • Order pricing→MongoDB
  • Public API routes→MongoDBbookings, enquiries
  • Admin pages & API→MongoDBstatus, menu, tables
  • Admin pages & API→QR generator
  • Admin pages & API→Media collectionupload
  • Staff→Admin pages & APIpoll every 8 s · async
  • Guests→Public API routestrack every 15 s · async

Request flow · A guest orders from table T05

  1. 1Scanning the table’s QR code opens the menu with ?table=T05, and the table is remembered for checkout.
  2. 2Checkout posts item ids and quantities only. The route checks the rate limit and validates the body with Zod.
  3. 3Prices are looked up from available menu items in MongoDB, so the total the client shows is never trusted.
  4. 4The kitchen board picks the order up on its next poll and chimes; staff move it from received to ready.
  5. 5The guest’s tracking page re-checks every 15 seconds until the order is completed.

Design decisions

The server owns the price
Orders carry ids and quantities; the subtotal is computed from database prices and unavailable dishes are refused.
Images in the database
Vercel’s filesystem is read-only, so uploads are stored as bytes in MongoDB and served with a one-year immutable cache header.
Tracking needs the phone too
Order numbers are time-based and guessable, so tracking requires the checkout phone number and answers a wrong guess the same as a missing order.
UPI is verified by people
A UPI reference submitted by a guest only flags the order; staff mark it paid after checking the cafe’s own account.

Trade-offs & known limits

  • The rate limiter lives in each function’s memory, so limits are per instance rather than global across Vercel.
  • Staff screens poll instead of holding a live connection, so a new order can take up to 8 seconds to appear.
  • No payment gateway or outgoing email or SMS; guests are confirmed by call or WhatsApp from the admin panel.

Have something similar in mind?

I'm open for freelance and contract work — let's talk about what you're building.