Skip to content
Live
  • Lagos --:-- WAT
  • Barça next: at Sabah FK · Wed 25 Nov, 18:45 WAT
  • Latest article: What it's like being the developer at a finance firm
  • Press ⌘K to search
  • Available for new projects
MOE#07

Case studySide projectNext.js · Node.js · Postgres · Redis

Tastyc case study: a restaurant ordering system built with Next.js, Node.js and PaystackTastyc.

A restaurant platform any kitchen can run: online ordering, live tickets, reservations and loyalty, from one codebase.

Solo · design to deploy
Role
Restaurant ops · SaaS
Category
Apr 2026 – today
Timeline
Live demo
Status
Tastyc admin dashboard showing orders, revenue and reservations
DemoOrders, revenue and tonight's bookings at a glance
By the numbers
API modules
19
DB migrations
17
User roles
5
Job queues
4
Email templates
8
01 / The problem

The brief

Most small restaurants in Lagos take orders across WhatsApp, phone calls and paper tickets. Payments get confirmed by screenshot, the kitchen finds out about an order when someone shouts it, and nobody knows who their regulars are.

Tastyc covers the whole service. Customers browse the menu, pay with Paystack and watch their order move from the kitchen to their table or door. Diners scan a QR code at the table and order without signing up. Staff run the night from a live kitchen display, and managers get orders, reservations, menus, newsletters and analytics in one dashboard.

“A new restaurant should be configured, not forked.”Name, currency, hours, delivery fee, capacity and loyalty rates all live in the database.
02 / The stack

The line-up

Eleven technologies in a 4-3-3: the database at the back, the frontend up front. Tap one to see its job.

4-3-3 · ATTACKING ↑
No.7 · AttackNext.js 16App Router storefront, customer dashboard, admin and kitchen display.
03 / Architecture

How an order moves

Eight passes from “Place order” to a ticket on the kitchen screen.

  1. 01The customer browses the menu, fills a cart and checks out.
  2. 02The storefront sends the order with an idempotency key.
  3. 03Seen that key before? Redis returns the first order instead of making a second.
  4. 04The order and its items are written to Postgres in one transaction.
  5. 05The API starts the payment and hands the customer to Paystack.
  6. 06Paystack sends a signed charge.success webhook. Only now is the order paid.
  7. 07The ticket lands on the kitchen screen over Socket.IO, in a room only kitchen staff can join.
  8. 08A BullMQ worker sends the confirmation email and push notification, with retries.
04 / Timeline

Build log

Counted in days from the first commit, straight from the Git history.

  1. DAY1

    First commit

    One monorepo, two apps: a Next.js storefront and an Express API, wired together with Docker Compose.

  2. DAY3

    Auth and the first schema

    Custom JWT auth with httpOnly cookies, and the first migration: users, menus, orders, payments, reservations.

  3. DAY11

    Four migrations in a day

    An audit log for sensitive actions, guest checkout, the loyalty points system and the indexes that keep the dashboard quick.

  4. DAY22

    Reservations hit the calendar

    Bookings sync to the restaurant's Google Calendar, and a no-show cron frees tables nobody turned up for.

  5. DAY29

    Refresh tokens, done properly

    Tokens moved into the database, so every refresh rotates the token and a stolen one can be revoked.

  6. DAY30

    Push alerts and a configurable restaurant

    Web push for order updates, and the settings table that turns one restaurant's site into a product.

  7. DAY35

    Staff chat

    Channels for front of house and kitchen, with pinned messages for the specials and the 86'd list.

  8. DAY199

    Migration: Railway → Render

    The API moved hosts. Four things broke on the way. All four are in the post-mortem below.

05 / Trade-offs

Key decisions

DECISION 01

Every order carries an idempotency key

Mobile data in Lagos drops mid-request, and people tap Place order twice. Without a key that's two orders, and maybe two charges. The API keeps the first response in Redis under the key and returns it for any retry.

TRADE-OFF · An extra Redis read per order and a key expiry to manage. Cheaper than refunding a customer.

DECISION 02

Trust the webhook, not the redirect

The redirect back from Paystack can be faked, or never arrive if the tab closes. An order is marked paid only when the webhook arrives with a valid HMAC-SHA512 signature and a charge.success event.

TRADE-OFF · Confirmation is asynchronous, so the order page waits for a live status update instead of trusting the URL.

DECISION 03

Rooms, not polling, for the kitchen

Each order gets its own Socket.IO room, and new tickets go to a kitchen room only kitchen and manager roles can join. No screen refreshing every five seconds, and no customer seeing someone else's order.

TRADE-OFF · Long-lived connections need a server that stays awake. A free tier that sleeps drops them, so clients reconnect and rejoin.

DECISION 04

Configure the restaurant, don't fork the code

Name, currency, opening hours, delivery fee, capacity and loyalty rates live in one settings row with an onboarding flow. A new restaurant is a settings page, not a new repo.

TRADE-OFF · More validation and settings UI up front, and every feature reads config instead of hard-coding a value.

06 / Post-mortem

What broke

What broke moving the API from Railway to Render, straight from the logs.

Incident 1 · Build

The Docker build fails

"/prisma.config.ts": not found

ROOT CAUSERender built from the repo root, so the Dockerfile's COPY paths pointed outside the build context.

FIXRoot directory set to apps/api, and the setting kept in a render.yaml in Git so it can't drift.

Incident 2 · Boot

The container crashes on start

Cannot find module '@react-email/components'

ROOT CAUSEEmails render at runtime, but the packages were devDependencies, and npm prune deleted them from the image.

FIXMoved to dependencies, plus cors, which had only been installed by accident through socket.io.

Incident 3 · Redis

Redis won't connect

connect EACCES / → ECONNRESET

ROOT CAUSEAn https:// REST URL went where ioredis wants redis://, so it was read as a socket path. Then plain redis:// hit a TLS-only server.

FIXA rediss:// URL, with TLS switched on for the BullMQ connection too.

Incident 4 · Data

Login fails in production

table "refresh_tokens" does not exist

ROOT CAUSEThe new database was restored from a dump taken before the last five migrations.

FIXprisma migrate deploy against the new database. All five were additive, so no data was touched.

07 / Outcome

The result

Tastyc is live with a public demo. Demo mode blocks destructive actions and caps each user's daily orders with counters in Redis, so strangers can try the whole flow without wrecking it.

It's a side project, so there's no revenue chart here. What it shows is the work clients pay for: payments that can't double-charge, real-time updates that stay private, background jobs that survive a redeploy, and a deploy I can debug from the logs alone.

What's next

  • Run migrations as a release step, so schema and code ship together.
  • Validate every environment variable at boot, and fail loudly.
  • Build the Docker image in CI on every pull request.
  • A React Native app for customers and the kitchen.
esc
Curriculum vitae

Moses Chukwudi Nwigberi · Résumé

The short version: WealthBridge, VisCorner, DITCOSoft, Pepnops and a few seasons of freelance.

Open the PDF