home / work / yallanorder

Project

YallaNorder

White-label online ordering for Egyptian restaurants: a branded store on its own subdomain, live kitchen boards, and Kashier payments, with no delivery-app commission.

Role
Led development, CodeX Technologies
Stack
  • Node.js / Express 5
  • TypeScript
  • PostgreSQL / Prisma
  • socket.io
  • Next.js 16 / React 19
  • TanStack Query
  • Kashier

The problem

Restaurants in Egypt that sell through the big delivery apps give up a large commission on every order, and they don't own the customer relationship. Building their own ordering site is out of reach for most of them.

What it is

YallaNorder gives each restaurant its own branded ordering store on a subdomain (for example your-restaurant.yallanorder.com), set up for them: menu, branches, and delivery zones. Orders come straight to the restaurant, with no marketplace commission in the middle. It launched in November 2026.

I led its development at CodeX, working with Mena Maged, our CTO, on the front ends, especially the dashboard. It's three apps on one API:

  • The storefront (Next.js): one deployment serves every restaurant. A proxy maps the subdomain to the tenant, so your-restaurant.yallanorder.com/checkout renders that restaurant's checkout. Customers browse by branch, customise items, build offer bundles, and pay cash or online, in Arabic or English.
  • The dashboard (Next.js): three roles with their own views. Platform admins run restaurants, payments, and the audit log; restaurant managers run the menu, offers, vouchers, happy hours, loyalty, staff, and branding; branch staff run their live order board, mark items out of stock, and close the day.
  • The API (Express 5, Prisma, PostgreSQL): one backend for both, with a module per domain (orders, menu, offers, vouchers, loyalty, payments, settlements, audit) and socket.io pushing order changes to the staff boards.

Decisions that shaped it

The tenant header is a hint, not a credential. The storefront forwards the restaurant's slug to the API in a header. Anyone can forge a header, so the API treats it only as a name to look up, checks the restaurant exists and is active, and grants nothing on the strength of it. A deactivated restaurant looks exactly like a missing one, so deactivation isn't visible from outside.

Money is always an integer. Every amount is stored and passed in piasters (18000 means EGP 180.00): never floats, never formatted strings. Discounts, cashback, and settlement totals are all integer arithmetic.

Two paths confirm a payment, and they can't disagree. Kashier's signed webhook is the source of truth, but webhooks arrive late or not at all, so the return page can also ask Kashier directly. Both funnel into one idempotent function: a repeated webhook, or a webhook racing the return page, changes nothing the second time, and the confirmation email goes out exactly once. An amount that doesn't match the order is refused and logged for a manual check. The browser's return URL is never trusted on its own: it carries a status anyone can type.

Real-time without leaking data. When an order changes, the API tells that restaurant's and branch's boards over socket.io, but only after the database write commits, and the notice carries no customer details. The board refetches through the REST API, which applies its own permissions. A lost notice costs one poll interval, never the order.

A business day isn't a calendar day. Restaurants run shifts past midnight, so orders are grouped by business date and reported in the restaurant's local hour. A late shift lands in one end-of-day settlement instead of being split across two.

A bug that testing caught before customers did: in Kashier's test mode, a customer could pay, close the tab before returning, and lose the webhook. The job that cancels unpaid orders would then cancel an order that had actually been paid, leaving a manual refund. Now that job asks Kashier about every order before cancelling it, and only cancels the ones Kashier confirms are unpaid. An order Kashier can't answer for waits for the next run instead of being cancelled unchecked.

Shortly before launch we also moved the database from MariaDB to PostgreSQL. The catch worth knowing about: MariaDB compares text case-insensitively by default and Postgres doesn't, so emails and slugs are now normalised before they're stored and searches opt into case-insensitive matching explicitly.

Why the payments side matters

Online payments in Egypt shape the whole product: which gateway, how refunds work, what happens when a webhook arrives twice. I've written about those choices in comparing Egypt's payment gateways and split payments and deposits for marketplaces.

← All work