Skip to main content
Back to work

J-Cafe - The Kosher Place

Six branches, two languages, one kitchen that needs to know what to make

6

active branches

38

automated tests

0

order leaks since

2

interface languages

What was stuck

A kosher chain with six branches in Thailand and an audience speaking two languages. Orders arrived through scattered channels, the kitchen received them by hand, and there was no single place to see what was happening across every branch at once. Underneath that sat a worse fault: three competing sources of truth for branch identity, and orders leaking between branches. The code carried a hard fallback to a default branch in about 38 places. In an ordering system, an order that reaches the wrong branch is not a display bug - it is a meal that left the wrong kitchen.

What we built

The engineering decision: the server becomes the sole authority for branch identity. We added resolveOrderCompany, moved to a single source of truth held in an httpOnly cookie, gave every branch its own cart key, and removed every hard fallback - all of them, not most. One authority in place of three. The operations layer was built on top of that: a bilingual storefront with secure checkout, a picker screen in each branch showing what to assemble right now, and a kitchen display (KDS) that receives the order directly - with nobody reading it out loud. Everything syncs both ways with ODOO, so stock and prices stay a single source of truth.

The process, end to end

  1. Order placed on the siteBilingual storefront, secure checkout
  2. Stock and pricing syncTwo-way with ODOO - one source of truth
  3. Picker screen at the branchWhat to assemble now, per branch
  4. Kitchen display (KDS)The order arrives directly - nobody reads it out loud
  5. Automated tests on every updateThe ordering path is verified before any code change ships

What changed

  • The test suite grew from 7 tests to 38
  • Zero order leaks between branches since

Technologies

FieldE-Commerce
TechnologiesNext.js · Supabase · ODOO · Stripe · Vercel · Playwright