Ship it
Put every piece together in one working app: load the menu from the kitchen, render it, keep a Cart in sync with the page, accept typed quick orders, and place the order with retries — showing friendly messages along the way.
Wiring the whole app
The final app is mostly wiring: every part already exists and has been tested on its own. An async start() function runs once when the page loads. It shows a loading message, awaits the menu, renders it, connects the event listeners, and shows the empty totals. Wrapping start-up in an async function lets it use await and catch a failed load in one place.
async function start() {
status.textContent = "Loading menu…";
try {
const menu = await withRetry(fetchMenu);
renderMenu(menu);
showTotals();
status.textContent = "";
} catch {
status.textContent = "The kitchen isn't answering. Please refresh in a moment.";
}
}
start();Each feature then hangs off an event: clicking Add uses the cart, submitting the quick-order box uses parseOrder from Day 3, and the checkout button uses withRetry(placeOrder). Because every piece was built small and tested, connecting them is calm work rather than a debugging marathon.