Skip to content

Kitchen Live Operations: Real-time board + customer tracking#26

Merged
AngRobert merged 1 commit into
mainfrom
feature/kitchen-live-operations
May 29, 2026
Merged

Kitchen Live Operations: Real-time board + customer tracking#26
AngRobert merged 1 commit into
mainfrom
feature/kitchen-live-operations

Conversation

@ModernityRejecter
Copy link
Copy Markdown
Owner

Summary

Implements kitchen display system (KDS) and real-time order tracking for both staff and customers, addressing user stories #5 (Kitchen Management) and #6 (Live Status).

Changes

Backend

  • WebSocket/STOMP over SockJS for real-time order updates (JWT-authenticated, role-gated)
  • Kitchen board endpoint returns orders in active statuses, sorted by created time
  • Order-status roll-up: item status changes now drive order status (fixes gap where orders were stuck at RECEIVED)
  • Broadcast service pushes updates after transaction commit
  • New OrderMapper for consistent serialization across REST and WebSocket

Frontend

  • kitchen.html + js/kitchen.js: Dark-themed KDS with 3 columns (New/Cooking/Ready)
    • Live elapsed timers with color warnings (amber at 10m, red at 20m)
    • Customer special notes displayed prominently
    • Per-order and per-item status controls
    • Toast notifications + sound for new orders, live connection indicator
  • Enhanced my-orders.html: Real-time order tracking with live connection status
    • Subscribes to per-order updates, instant refresh on push
    • Toast alert when order is ready
    • Falls back to polling if WebSocket unavailable
  • Shared realtime.js helper for reusable STOMP client setup

Verification

  • All 117 backend sources compile cleanly (MapStruct generation verified)
  • Full Spring context boots with new WebSocket beans (proven by passing @SpringBootTest controller tests)
  • CartServiceTest passes (added OrderMapper mock)
  • Pre-existing test failures confirmed to exist on pristine main (3 unrelated tests with test-setup gaps)

Testing notes

Build locally via Docker (no local JDK):

docker run --rm -v "<repo>:/app" -v ramsai_m2:/root/.m2 -w /app maven:3.9.6-eclipse-temurin-17 mvn -B clean test

For end-to-end: docker-compose up (requires .env), then log in as CHEF/MANAGER and visit kitchen.html. Place an order as a customer and watch it appear on the board and update live on "My Orders".

🤖 Generated with Claude Code

- Add kitchen display system (KDS) with 3-column board (New/Cooking/Ready)
  - Live elapsed timers, customer notes, order/item-level actions
  - Toast alerts and sound on new orders
- Implement WebSocket/STOMP over SockJS for real-time order updates
  - JWT auth via channel interceptor, role-gated /topic/kitchen feed
  - Broadcast after transaction commit to guarantee ordering
- Add customer live tracking on "My Orders" page
  - Subscribe to per-order updates, instant refresh on status changes
  - Toast alert when order is ready to serve
  - Live/offline connection indicator
- Fix order-status rollup gap: item status changes now drive order status
  - Orders advance through Received→Cooking→Ready→Served as items progress
  - Customers see accurate progress bar instead of stuck RECEIVED
- Add OrderMapper for consistent order serialization across REST/STOMP
- Secure /ws endpoint in SecurityConfig for SockJS handshake
- Add realtime.js helper for reusable STOMP client setup with JWT refresh

Acceptance criteria met (user stories #5, #6):
- Kitchen: orders sorted by placed time, customer notes visible
- Live status: real-time notifications about order progress
- Board & customer pages both use WebSocket for instant updates, fall back to polling

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

🤖 Hi @ModernityRejecter, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@AngRobert
Copy link
Copy Markdown
Collaborator

good work! i noticed a small bug while testing:
when placing an order, in the kitchen tab, the time elapsed feature acts unexpectedly. it told me i had placed an order 3 hours ago when i had just placed one a few seconds earlier.

@ModernityRejecter
Copy link
Copy Markdown
Owner Author

Working on the fix right now, should be done soon

@AngRobert AngRobert merged commit 786f9b0 into main May 29, 2026
6 of 7 checks passed
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.

2 participants