フルスタック2026注目

Buddy's Hangout

カフェ注文&店舗運営システム

rohith-a.me/projects/proj-15
Buddy's Hangout – カフェ注文&店舗運営システム screenshot 1 of 1
01

課題

地域のカフェが店頭・電話・チャットで注文や席予約、イベント問い合わせを受けており、キッチンとフロアで状況を一元把握できなかった。

02

アプローチ

MongoDB/Mongooseと全APIルートへのZodバリデーションを備えたモバイルファーストのNext.js 15 App Routerサイトを構築。テーブル別QRコードによる注文、サーバー側での価格再計算、HMAC署名Cookieによるスタッフ認証、IP別レート制限、MongoDBへの画像保存を実装。

03

成果

来店客は店内飲食・テイクアウトの注文、店頭/UPI決済、ライブ注文追跡、席予約が可能。スタッフは通知音付きキッチンボード、決済確認、メニュー管理、QR印刷、予約管理、CSV出力など8つの管理機能を利用可能。

システム設計

Buddy's Hangout の構成

技術アーキテクチャの説明は英語です。

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.

同じようなプロジェクトをお考えですか?

フリーランス・業務委託のご依頼を受け付けています。お気軽にご相談ください。