← 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
Access
public repo, link on its way
read the source →

A Screens

The BrewPhoria storefront home screen on an iPhone, showing the drink categories and featured menu.

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.

BrewPhoria's AI barista conversation, turning a spoken craving into a priced drink.

“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.

Two iPhones showing a BrewPhoria drink's detail screen with size, milk and syrup options.

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.

Two iPhones showing BrewPhoria's checkout sheet and the order history that follows it.

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.

BrewPhoria's loyalty screen showing the points balance and tier progress.

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.

Redeeming BrewPhoria points against a drink at checkout.

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.

  1. Offline-first guest cart that merges conflict-free the moment you sign in. It survives cold starts.

  2. Atomic checkout: order, stock, cart, and loyalty all move in one transaction, or none do.

  3. 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

↑ Back to the surface