Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/apursley2012/alex-pizza-assistant/llms.txt

Use this file to discover all available pages before exploring further.

Alex Pizza Assistant stores pricing and fee values in two completely independent locations: data/menu.json and js/app.js. The JSON file controls what the menu card displays in the browser UI; the JavaScript constants control what the ordering engine calculates at runtime. Neither file reads from the other — app.js does not fetch or import menu.json. Any pricing change must therefore be applied in both places to keep the displayed menu and the live order totals in sync.
Dual-source pricing — changes must be made in two files.app.js declares its own prices object, TAX_RATE, and DELIVERY_FEE constants that are used for every live calculation (subtotals, tax, totals). data/menu.json is never fetched or parsed by JavaScript — its values are only rendered as static text inside the “Menu Logic” sidebar card in index.html. Updating menu.json alone will change what the menu card displays but will not affect any calculated totals. Updating app.js alone will change calculated totals but leave the displayed menu prices out of date. Always update both files together.

data/menu.json

data/menu.json is a static JSON file referenced directly in the index.html markup as display content for the “Menu Logic” sidebar card. It is not fetched or parsed by JavaScript at any point — its values are baked into the HTML at edit time and serve as the human-readable menu reference shown alongside the chat interface.
{
  "prices": {
    "small": 8.99,
    "medium": 14.99,
    "large": 17.99
  },
  "salesTaxMultiplier": 1.1,
  "deliveryFee": 5,
  "couponThreshold": 50
}
prices.small
number
default:"8.99"
Price in USD for a small pizza. Displayed on the menu card inside the receipt panel. To affect order calculations, also update prices.small in js/app.js.
prices.medium
number
default:"14.99"
Price in USD for a medium pizza. Displayed on the menu card inside the receipt panel. To affect order calculations, also update prices.medium in js/app.js.
prices.large
number
default:"17.99"
Price in USD for a large pizza. Displayed on the menu card inside the receipt panel. To affect order calculations, also update prices.large in js/app.js.
salesTaxMultiplier
number
default:"1.1"
Multiplier used to express the sales tax rate on the menu card (e.g., 1.1 represents 10% sales tax). This value is for display reference only. The actual tax rate applied to order calculations is the separate constant TAX_RATE = 0.1 in app.js.
deliveryFee
number
default:"5"
Flat delivery surcharge in USD shown on the menu card. This value is for display reference only. The fee applied to live orders is the separate constant DELIVERY_FEE = 5 in app.js. Update both to keep the displayed and calculated fees in sync.
couponThreshold
number
default:"50"
Minimum order total in USD shown on the menu card that triggers the congratulatory coupon message. This value is for display reference only. The actual threshold checked at runtime is the hard-coded value 50 inside finishOrder() in app.js — update both if you change this threshold.

JavaScript Constants (app.js)

app.js declares its own copies of the pricing values as top-level constants. These are what the ordering engine actually uses when computing subtotals, tax, and delivery fees during a live session — menu.json is not imported at runtime and has no effect on these calculations.
const prices = {
  small: 8.99,
  medium: 14.99,
  large: 17.99
};

const TAX_RATE = 0.1;
const DELIVERY_FEE = 5;
prices.small
number
default:"8.99"
Runtime price in USD for a small pizza. Used by calculateTotals() to compute the subtotal. Must match prices.small in menu.json to keep the displayed menu and calculated totals consistent.
prices.medium
number
default:"14.99"
Runtime price in USD for a medium pizza. Used by calculateTotals() to compute the subtotal. Must match prices.medium in menu.json.
prices.large
number
default:"17.99"
Runtime price in USD for a large pizza. Used by calculateTotals() to compute the subtotal. Must match prices.large in menu.json.
TAX_RATE
number
default:"0.1"
Decimal tax rate applied to the order subtotal (e.g., 0.1 = 10%). Used directly in calculateTotals() as order.tax = order.subtotal * TAX_RATE. Must be kept consistent with the salesTaxMultiplier value in menu.json (where 1.1 corresponds to 0.1).
DELIVERY_FEE
number
default:"5"
Flat delivery surcharge in USD added to orders where the customer selects delivery. Set to 0 to offer free delivery. Must match the deliveryFee value in menu.json.

Coupon Logic

At the end of every order, finishOrder() compares order.total against a hard-coded threshold of 50 and emits one of two bot chat bubbles. To change the threshold, update the hard-coded 50 in the condition below and the couponThreshold field in data/menu.json so the menu card display stays accurate.
if (order.total >= 50) {
  addBubble("Congratulations! You've been awarded a $10 off coupon for your next order.", "bot");
} else {
  addBubble("Orders over $50 receive a free $10 off coupon.", "bot");
}
The coupon message is purely informational — there is no coupon-redemption step in the current order flow. To add redemption logic, introduce a new step in the steps array after finishOrder() is called, or apply a discount inside calculateTotals().

CSS Custom Properties

All colors are declared as CSS custom properties on :root in css/styles.css. Override any variable in your own stylesheet or directly in :root to re-theme the entire interface without touching component styles.
VariableHex valueUsage
--oven-black#22130EBorders, shadows, nav background, primary dark tone
--deep-red#B53A24Chat title bar background, receipt kicker text, error/heading accents
--tomato#E4572EPrimary action buttons (Continue, Start over), hover state for nav links
--cheese#FFD166User chat bubble background, total-row highlight, pizza icon badge
--cream#FFF7EDPage and card backgrounds, light nav text, footer background
--flour#F8E4C9Soft warm fill used for secondary surface areas
--basil#5B7F45Result/confirmation chat bubble background
--ink#2B1B14Body text, dark label text
--muted#7C5C4BSecondary/label text, receipt term labels, placeholder text

Build docs developers (and LLMs) love