Automatic dispatch
When the kitchen marks an order ready, the delivery service creates the delivery and claims a free driver
in one compare-and-set write. Two orders can never take the same driver, and orders wait and retry until
someone comes online.
Events that can't get lost
An order change and its event are written in the same database transaction (transactional outbox). Event
ids are deterministic, every consumer skips what it already handled, and failures go to a dead-letter
topic that can be replayed.
Live tracking you can trust
The customer's map updates over Server-Sent Events and falls back to polling. A driver's position only
counts for their own current delivery, and the screen never says "Live" for old data.
Money you can audit
A flat EGP 25 delivery fee is split 50/50 and frozen on each order. Driver earnings go to an append-only
ledger and settle after 12 hours. Refunds are full, once per payment, under a row lock, with an audit
record.
Checkout that can't overcharge
At checkout the cart is checked again against the menu. If a price changed or an item sold out, the order
is refused with what changed and the cart is updated, so nobody pays a price they didn't see.
Safe by default
Roles live in the JWT, every service checks ownership, and internal routes need signed requests. Phone
codes are stored only as hashes, with attempt limits and cooldowns.
Tested the way people use it
Each app has its own UI test suite, written in Maestro and run in CI. The flagship test drives all three
apps through one order: the customer orders, the restaurant app cooks it, the driver app delivers it, and
the customer rates the driver.
Every backend pull request also has to pass:
- Unit tests and lint in every service
- A full-stack run of the critical workflow
- Migrations on a fresh database
- CodeQL, dependency audit and container scans