For: Full Stack · Ordering Website

Ordering website

The pages customers use, and how each one behaves.

Pages

Page Address What it does
Home /ar, /en Restaurant name and tagline, open/closed status, chef's picks (dishes marked featured), categories, order types, address, hours and map link
Menu /{locale}/menu All active categories with a sticky category bar that follows the scroll, and a search across Arabic and English names and descriptions
Dish /{locale}/menu/{slug} Photo, description, tags, preparation time, calories, option groups, a note for the kitchen, quantity
Checkout /{locale}/checkout Order type, customer details, payment method, summary with delivery fee and tax
Order tracking /{locale}/order/{code} Live status of one order, updated every 5 seconds
Track an order /{locale}/order Form to open an order by its code
Book a table /{locale}/reservations Reservation request for staff to confirm
  • Unavailable dishes stay visible as Sold out today and cannot be added; staff switch them back on from the dashboard.
  • Dishes without options get an Add button right on the card. Dishes with options open their page, where required choices are marked and the price updates as options are picked.
  • Option groups are either "pick one" (maxSelect 1, radio buttons) or "up to N" (checkboxes). A required "pick one" group starts with its first option selected.
  • Tags (Spicy, Vegetarian, New, Popular, Gluten-free) are chosen per dish in the dashboard.

Cart

The cart is kept in the browser (localStorage), so it survives a page reload and works without an account. The same dish with different options or notes becomes separate lines. The drawer shows the minimum order when the cart is below it. The cart's prices are only a preview: the server prices the order again from the database when it is placed.

Checkout

  • Order types are the ones switched on in Settings: pickup, delivery (needs an address and adds the delivery fee) and dine-in (needs a table number).
  • Table QR codes: link each table to /{locale}/checkout?table=12. The page selects dine-in and fills in the table.
  • Name, phone and address are remembered on that phone for next time.
  • Tax is a percentage of subtotal plus delivery fee, rounded to the smallest currency unit.
  • Ordering is refused when the restaurant is closed (opening hours), when online orders are paused, or below the minimum order. The checkout explains which.

Order tracking

After placing an order the customer lands on its tracking page. The steps are New → Being prepared → Ready → (On the way, for delivery) → Delivered, each with the time it happened. The page polls GET /api/orders/{code} every 5 seconds (every 15 seconds when the tab is hidden) and stops once the order is completed or cancelled. The code (like SF-7KQ2-M9XD) is random, so it cannot be guessed, and the phone number is partly hidden on this page.

Reservations

Customers send name, phone, number of guests (1–20), date (today to 60 days ahead) and time. The half-hour time slots are set in src/app/[locale]/(site)/reservations/page.tsx (TIMES, 12:00 to 22:30 by default). Requests arrive in Dashboard > Reservations as To confirm; staff call the customer and confirm or decline.

Search engines

Each page has its own title and description in both languages, and dish pages include MenuItem structured data with the price. /sitemap.xml lists the home, menu, reservations and every dish in both languages; /robots.txt keeps the dashboard, checkout and order pages out of search results.