← All projectspersonal product2026Under the hood ↓
BrewPhoria
Every order moves four tables at once. They all commit, or nothing happened.
Cross-platform coffee ordering: a Flutter client on a layered Node/Express/TypeScript API.
- Role
- Personal product · solo
- Stack
- FlutterNode.jsPostgreSQLPrismaExpressTypeScriptRiverpodDioHiveRedisGemini
- Result
- 1transaction covers the order, the stock, the cart and the points
A Screens

The menu opens before the network answers
The catalogue is cached to Hive on first run, so a cold start on bad signal opens to a full menu instead of a spinner. The network reconciles behind it, and the reader never watches that happen.

“Something sweet and cold” is a query
A tool-augmented Gemini agent resolves loose language against the live catalogue rather than a prompt full of product names. Add a drink to the menu at nine and it is orderable by speech at nine.

Priced as you build it, and never by the phone
Size, milk, shots and syrups reprice on every tap — computed on the server, rendered by the client. The phone displays a number it was handed; it never does the arithmetic that decides what you pay.

One transaction, or nothing happened
Checkout writes the order, decrements stock, empties the cart and credits points inside a single Prisma transaction. A connection dropped mid-tap leaves no half-order and no phantom stock to reconcile by hand.

Points that cannot be spent twice
Earning and redeeming write to the same ledger as checkout, under the same transaction. Two impatient taps on a slow connection cannot spend one free cup twice, which is the failure a loyalty scheme is judged on.

Under the hood
BrewPhoria
Under the hood
BrewPhoria
B Architecture
From a guest cart to a confirmed order
The phone can build a cart with nobody signed in, and none of the numbers it holds are trusted. At checkout the server recomputes all of them and moves four things at once, or moves none of them.
What happens at checkout
The phone never decides a price. Order, stock, cart and loyalty all move inside one database transaction, and the push notification is sent only after it commits.
- What people use
- Code I wrote
- Where it is kept
- Someone else's service
An order that cannot change under you
What you bought is copied onto the order at the moment of purchase: name, image, price and options. The catalogue can be edited afterwards and a delivered order still reads exactly as it did at the till.
C Decisions
The calls that made the difference, and what each one bought.
Offline-first guest cart that merges conflict-free the moment you sign in. It survives cold starts.
Atomic checkout: order, stock, cart, and loyalty all move in one transaction, or none do.
An AI barista (Gemini, tool-augmented) that resolves “something sweet and cold” to real menu items.
D What it runs on
- Flutter
- Node.js
- PostgreSQL
- Prisma
- Express
- TypeScript
- Riverpod
- Dio
- Hive
- Redis
- Gemini
public repo, link on its way