Skip to content

Frontend: Greek taverna theme, real order history, live-update explanation - #13

Open
devinder-dev wants to merge 4 commits into
mainfrom
feature/frontend
Open

devinder-dev wants to merge 4 commits into
mainfrom
feature/frontend

Conversation

@devinder-dev

@devinder-dev devinder-dev commented Jun 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

Follow-up to the merged frontend PR (#12), addressing feedback that the UI looked too basic, the order history was unreadable, and a real bug found while clicking through: opening /history with old localStorage data crashed to a blank page.

  • Reseeds the menu with real Greek dishes (Gyros, Souvlaki, Greek Salad, Moussaka) instead of placeholder pizza items.
  • Redesigns the frontend around a Mediterranean color palette (terracotta/olive/cream/Aegean blue) with food-emoji menu cards instead of a plain list.
  • Order history now stores a snapshot of what was actually submitted (items + total, captured at placement time) instead of just a bare order id - reads "2x Gyros, 1x Greek Salad - $31.00" instead of a raw UUID.
  • The order status screen explains how the live update actually works ("checking every 1.5s" while polling, "the kitchen service published an event over RabbitMQ" once ready).
  • Real bug fixed: a browser with order-history entries from before items/totalCents were added crashed OrderHistoryPage (entry.items.map(...) on items: undefined), and with no error boundary, that blanked the whole app. getOrderHistory now validates each entry's shape and drops anything malformed; added a top-level error boundary as a backstop for any future unexpected render error.
  • order-events.ts (order service's own consumer of kitchen's events) now logs a success line, matching every other consumer in the system (kitchen, notification) - it was the only one with no visible confirmation it had actually run.

Full verification pass (not just unit tests)

  • bun run typecheck clean across all 7 packages
  • bun run test green - 60 tests total (43 frontend, including the new error-boundary and old-shape-localStorage regression tests)
  • Live event flow traced through real Docker logs for a real order: order service logs persist -> synced to accepted -> synced to ready; kitchen logs accepted -> ready; notification logs all 3 events - every consumer in the system visibly confirms it ran
  • Idempotency verified live, not just via unit test: published the same order.placed event (same eventId) twice directly to RabbitMQ - kitchen's log shows "accepted" and "ready" exactly once each, proving the Redis-backed dedupe actually collapses a real redelivery
  • Public-entry-point invariant re-confirmed after all changes: nginx is still the only published port
  • Snyk: 0 issues

devinder-dev and others added 4 commits June 22, 2026 22:12
…explanation

Reseeds the menu with Greek dishes (Gyros, Souvlaki, Greek Salad,
Moussaka) instead of placeholder pizza, and redesigns the frontend around
a Mediterranean color palette with food-emoji menu cards instead of a
plain list.

Order history now stores a snapshot of what was actually submitted
(items + total, captured at placement time from the same cart lines sent
to POST /api/orders) instead of just a bare order id, so the history page
shows "2x Gyros, 1x Greek Salad - $31.00" rather than a raw UUID.

The order status screen now explains how the live update actually works
("checking every 1.5s" while polling, "the kitchen service published an
event over RabbitMQ" once ready) instead of just showing a stage tracker
with no explanation of the mechanism.
…torage

A browser that already had order-history entries from before items/
totalCents were added to the stored shape would crash OrderHistoryPage:
entry.items.map(...) throws on the old {orderId, placedAt}-only shape, and
with no error boundary, that unmounts the whole app to a blank page. This
actually happened during manual testing, not hypothetically.

Fixes:
- getOrderHistory now validates each entry's actual shape and silently
  drops anything that doesn't match, instead of trusting raw JSON.
- Added a top-level React error boundary as a backstop for any other
  unexpected render error, so a future bug shows a recoverable message
  instead of a blank page.
- order-events.ts now logs a success line when it syncs an order's status
  from a kitchen event, matching every other consumer in the system
  (kitchen, notification) — it was the only one with no visible
  confirmation that it had actually run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant