Skip to content
All work

Case study · Restaurant operations platform

RestoCafe OS

A multi-branch restaurant platform built around one hard problem: keeping an order correct while tills, a kitchen screen and a patchy connection all touch it.

Engineering project

Role
Sole author
Domain
Restaurant POS, kitchen and table service
Shape
NestJS API, Prisma schema, ops PWA
Status
In development, early commit history

The operation

A waiter adds a dish while the cashier splits the bill and the kitchen marks it ready. Every one of them must see the same order, and none of them may overwrite the others.

One order, every state

The order moves through explicit states. Each transition is checked on the server and broadcast to every screen that shows it.

  1. Step 01DRAFT

    Draft

    Items added at the table or the till.

  2. Step 02CONFIRMED

    Confirmed

    Sent to the kitchen; the order is now shared.

  3. Step 03IN_PREPARATION

    In preparation

    The kitchen board picks it up in real time.

  4. Step 04READY

    Ready

    Marked from the kitchen; the floor is notified.

  5. Step 05SERVED

    Served

    Closed at the table.

  6. Step 06PAID

    Paid

    Invoiced and settled, once.

What keeps it correct

  1. 01

    Idempotency keys

    A retried request with the same key returns the first result instead of applying twice.

    idempotency-key.store.ts

  2. 02

    Optimistic versions

    Updates carry the version they were based on; a stale write is rejected, not merged.

    expectedVersion

  3. 03

    Row locks for tables

    Seating and moving orders between tables runs under SELECT … FOR UPDATE.

    FOR UPDATE

  4. 04

    An offline queue

    The ops app queues actions while offline and replays them on reconnect, with tests for the queue.

    offline-queue.test.ts

  5. 05

    Real-time with auth

    Socket.IO with a Redis adapter, and a short-lived socket token instead of the session cookie.

Inside the product

Captured by the repository’s own Playwright visual tests against a seeded project. Orders, tables and amounts are test data.

Kitchen board
Kitchen board
Order entry
Order entry
Table service board
Table service board
Operations dashboard
Operations dashboard
Paid invoice
Paid invoice
Daily report
Daily report

What was verified

  • NestJS, Prisma and PostgreSQL, with a schema of around forty models.
  • An idempotency-key store and version checks (expectedVersion) on order updates.
  • Row locking in the table service.
  • Socket.IO with a Redis adapter and a dedicated socket token.
  • An offline queue in the ops web app, with its own tests.

Executed on 18 Oct 2026 against the working tree: 112 passed, 6 failed, 3 skipped (Jest, 2 of 33 suites failing, including the order-lifecycle suite).

What I do not claim

  • It is not deployed and has no restaurants using it.
  • k6 load scripts and Kubernetes manifests exist, but no load results or production cluster are claimed.
  • The history is short: most of the work is still uncommitted.

Architecture

A NestJS and TypeScript API with Prisma on PostgreSQL, Redis for the Socket.IO adapter and caching, and a React PWA for operations with an offline queue.

Stack

NestJS · TypeScript · Prisma · PostgreSQL · Redis · Socket.IO · React · PWA