Build the tracking.
Three views. One system.
The static shell of a delivery tracking app. Three audiences, three layouts: a customer tracking page (public, mobile-first, one answer), a courier event view (mobile, one big button), and a dispatcher dashboard (desktop, map and table). One shared design system. No data, no logic, no timers. Just the shell that Stage 02 brings to life.
Short answer: One HTML file, three top-level layouts, toggled by a small tab bar. Customer view: a centered card with a tracking code input and a vertical timeline of events. Courier view: a stacked card with the delivery details and three big buttons (picked up / out for delivery / delivered). Dispatcher view: a two-column grid - map placeholder on the left, active-deliveries table on the right - with a header showing four KPIs. Shared CSS tokens. Sample data hardcoded. No JavaScript beyond the tab toggle.
Three views, one app
Three audiences that share nothing structurally. Same tokens make them feel like one product.
A delivery tracking app is the first build in the studio with three real audiences. The previous four had one (Inventory, POS, HR) or two (HR with manager + employee). Delivery Tracking has three, and none of them can be collapsed into another without losing something essential.
The customer
Public. Not logged in. Tracking on a phone. Wants one answer: where is my parcel. One card, one timeline, no navigation.
The courier
In a car. On a phone. Often one-handed. Needs one unmissable button: "I delivered this." Event log is a tap, not a form.
The dispatcher
At a desk. Managing 50 deliveries at once. Needs a map, a table, and the ability to assign a courier in two clicks.
Why not one view
A single view that serves all three is a compromise. The customer sees noise. The courier sees too many buttons. The dispatcher loses the information density they need.
The tab bar at the top is the only navigation. It flips between #view-customer, #view-courier, and #view-dispatcher via a data-view attribute on . In Stage 02, the tab persists the active view in localStorage, and the customer view becomes the default for /track/ URLs while the dispatcher view becomes the default for the operator. Same layout, different defaults, one codebase.
Customer tracking - one card, one answer
Public. Mobile-first. Centered. No navigation.
The customer has clicked a tracking link from an email. They have a tracking code and a phone. The page has exactly one job: show where the parcel is, in plain English. Here's the shell:
.dl-customer {
display: grid;
place-items: center;
min-height: calc(100vh - var(--header-h));
padding: 2rem 1rem;
}
.dl-track-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 16px;
padding: 2rem 1.75rem;
max-width: 520px;
width: 100%;
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.dl-track-code {
display: flex;
gap: 0.5rem;
}
.dl-track-code input {
flex: 1;
background: var(--bg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 0.75rem 1rem;
color: var(--text);
font-size: 1rem;
font-family: ui-monospace, "SF Mono", Menlo, monospace;
outline: none;
}
.dl-customer {
display: grid;
place-items: center;
min-height: calc(100vh - var(--header-h));
padding: 2rem 1rem;
}
.dl-track-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 16px;
padding: 2rem 1.75rem;
max-width: 520px;
width: 100%;
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.dl-track-code {
display: flex;
gap: 0.5rem;
}
.dl-track-code input {
flex: 1;
background: var(--bg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 0.75rem 1rem;
color: var(--text);
font-size: 1rem;
font-family: ui-monospace, "SF Mono", Menlo, monospace;
outline: none;
}
Why place-items: center, not flexbox: place-items: center on a grid parent centers the child both horizontally and vertically in one declaration. Flexbox needs justify-content and align-items, two declarations, and still doesn't handle the "child should not stretch" case as cleanly. The min-height (not height) lets the card grow taller than the viewport if the timeline is long. The parent grid scrolls. The card stays centered when it fits, and grows when it doesn't. Why the code input is monospace: Tracking codes are typically uppercase alphanumeric strings (DEL-8F3A2B). Monospace makes them readable character by character, which matters when the customer is checking against an email. A proportional font would render "DEL- 8F3A2B" with the dash at an arbitrary vertical position, making it harder to parse. Same reason passwords and license plates use monospace in forms. Why max-width 520px: The customer is on a phone. The card should be at most 520px wide, which is a comfortable width at phone sizes and stays readable on tablets (where the card centers with whitespace around it). Desktop users get the same card, still centered, still comfortable. The alternative - full-width on desktop • makes the timeline look stretched and hard to scan. The card is a phone-shaped reading surface, always.
The timeline below the code input is a vertical list. Each row: timestamp on the left, a colored dot in the middle, the event text on the right. The most recent event is at the top. This is the same vertical-timeline pattern as the HR timeline, but reversed (newest first) because a customer wants the latest state first, not the origin.
Courier view - one button, one delivery
Mobile. Big taps. No confusion about what to do next.
The courier is in a car, on a phone, often one-handed, sometimes wearing gloves. The view shows one delivery at a time. The primary action is a full-width button. Secondary actions are still finger-sized. Here's the primary button and the layout:
.dl-courier {
padding: 1rem;
max-width: 480px;
margin: 0 auto;
display: flex;
flex-direction: column;
gap: 1rem;
}
.dl-courier-action {
width: 100%;
padding: 1.5rem 1rem;
font-size: 1.125rem;
font-weight: 800;
border-radius: 12px;
border: none;
background: var(--accent);
color: var(--bg);
text-transform: uppercase;
letter-spacing: 0.05em;
transition: background 0.15s, transform 0.05s;
}
.dl-courier-action:hover:not(:disabled) {
background: var(--accent-dark);
color: white;
}
.dl-courier-action:active:not(:disabled) {
transform: scale(0.99);
}
.dl-courier {
padding: 1rem;
max-width: 480px;
margin: 0 auto;
display: flex;
flex-direction: column;
gap: 1rem;
}
.dl-courier-action {
width: 100%;
padding: 1.5rem 1rem;
font-size: 1.125rem;
font-weight: 800;
border-radius: 12px;
border: none;
background: var(--accent);
color: var(--bg);
text-transform: uppercase;
letter-spacing: 0.05em;
transition: background 0.15s, transform 0.05s;
}
.dl-courier-action:hover:not(:disabled) {
background: var(--accent-dark);
color: white;
}
.dl-courier-action:active:not(:disabled) {
transform: scale(0.99);
}
Why padding 1.5rem and font-size 1.125rem: Combined, this gives a tap target that is roughly 60px tall - well above the 44px Apple HIG minimum and the 48px Material minimum. A courier with gloves or a hand in motion can hit it. A button that is 40px tall is a button that gets missed. In a delivery app, a missed tap is a failed delivery. Why uppercase: "PICKED UP" is recognized faster than "Picked up" at a glance. The courier isn't reading; they're confirming. Uppercase short words are recognized faster than mixed case. Same reason the POS button says "CHARGE" not "Charge". Why max-width 480px and centered: The courier view is mobile-first but should not stretch on a tablet. 480px keeps the button width comfortable at phone sizes, and centers on larger screens so a tablet user (dispatcher covering a shift) sees a phone-shaped card rather than a full-width button that looks wrong. Why the button is the ONLY primary action: The courier is logging a single event at a time. Show one button. The next event (out for delivery, delivered) is the next page state, not a second button on the same page. Multiple primary buttons side by side is a dispatcher pattern (assign, cancel, reassign). The courier does one thing at a time. One button, always.
Above the button, a card shows the delivery details: tracking code, customer name, address, and the current status badge. The card is the "what am I delivering" summary. The button is the "do the thing" action. Two zones, no ambiguity. Below the button, two small secondary actions: Report failure and Add note. They are still finger-sized (44px minimum) but visually quieter than the primary action.
Dispatcher dashboard - map left, table right
Desktop. Information-dense. Two columns that earn their space.
The dispatcher manages every active delivery at once. The layout is a two-column grid: map on the left, active-deliveries table on the right. Above both, four KPI cards. The whole dashboard is one screen — the dispatcher should never have to scroll to see what matters.
.dl-dispatcher {
display: grid;
grid-template-rows: auto 1fr;
grid-template-columns: 1fr 1fr;
grid-template-areas:
"kpis kpis"
"map table";
height: calc(100vh - var(--header-h));
gap: 1rem;
padding: 1rem;
}
.dl-kpis {
grid-area: kpis;
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 1rem;
}
.dl-map {
grid-area: map;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
min-height: 0;
overflow: hidden;
}
.dl-table-panel {
grid-area: table;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
}
.dl-dispatcher {
display: grid;
grid-template-rows: auto 1fr;
grid-template-columns: 1fr 1fr;
grid-template-areas:
"kpis kpis"
"map table";
height: calc(100vh - var(--header-h));
gap: 1rem;
padding: 1rem;
}
.dl-kpis {
grid-area: kpis;
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 1rem;
}
.dl-map {
grid-area: map;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
min-height: 0;
overflow: hidden;
}
.dl-table-panel {
grid-area: table;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
}
Why 1fr 1fr and not 2fr 1fr:
The map and the table carry equal weight.
A dispatcher scans both: the map for the
spatial overview ("who is where"), the
table for the operational detail ("who
is late", "who has 8 deliveries").
A 2fr 1fr layout would suggest the map
is twice as important. It isn't. The
table is where the dispatcher does the
work - assigning, reassigning, marking
failures. The map is context. Equal
weight matches the mental model.
On narrow screens (< 1000px), the grid
becomes one column with the map above
the table. The map is still there for
context; the table is still there for
work.
Why grid-template-rows: auto 1fr:
The KPI row's height depends on the
number inside. "23 active deliveries"
wraps differently than "7". auto lets
it fit the content.
The content row (map + table) takes
whatever is left. 1fr on the second
row of a fixed-height grid means "fill
the rest."
min-height: 0 on the map and the table
panel prevents the flex/grid overflow
bug - without it, the internal scroll
refuses to engage and the page overflows
instead. Same gotcha as every scrollable
child in a grid parent.
Why the KPI row spans both columns:
The KPIs summarize the whole dashboard,
not either panel. Putting them above
the grid, spanning full width, matches
their role. In a 4-card row, the visual
rhythm is "here is the state of the
world" followed by "here are the tools
to change it."
Alternately, the KPIs could be a sidebar
on the left. That would work on wide
screens but break on tablets and phones.
A top row is more responsive and more
conventional for operational dashboards.
The map region shows a placeholder in Stage 01: a dark panel with a subtle grid pattern, a location pin icon, and the text "Map view - live markers in Stage 03". It's honest about being a placeholder, and it commits the layout to a size. In Stage 03, that region becomes a real map with markers. The placeholder ensures the rest of the dashboard is shaped correctly before we choose a mapping library.
The table below the map shows every active delivery. Columns: tracking code, customer, courier, status badge, last update time. Rows sortable in Stage 02, clickable to open a detail panel in Stage 03. The table is the dispatcher's primary workspace — the map is context.
The four KPIs
The dispatcher dashboard has exactly four KPIs at the top. They answer the four questions a dispatcher asks when they sit down:
Active deliveries
How many parcels are in progress right now. The headline number.
Out for delivery
The subset that has a courier en route to the customer. The number to watch when a courier goes silent.
Failed today
Deliveries that couldn't be completed. The queue the dispatcher must triage.
Couriers on shift
How many couriers are available or on delivery. The capacity number.
Shared tokens - what makes it one app
Three layouts, one design system.
The three views share only CSS custom properties. Every color, radius, spacing step, and font size is a token. The layouts diverge; the tokens don't. This is the same discipline as HR's two-view shell and POS's single-view shell. The tokens are the brand.
:root {
--bg: #0f172a;
--surface: #1e293b;
--surface-2: #334155;
--border: #334155;
--text: #e2e8f0;
--text-muted: #94a3b8;
--text-dim: #64748b;
--accent: #61dafb;
--accent-dark: #0891b2;
--success: #10b981;
--warning: #f59e0b;
--danger: #ef4444;
--radius: 8px;
--header-h: 56px;
}
:root {
--bg: #0f172a;
--surface: #1e293b;
--surface-2: #334155;
--border: #334155;
--text: #e2e8f0;
--text-muted: #94a3b8;
--text-dim: #64748b;
--accent: #61dafb;
--accent-dark: #0891b2;
--success: #10b981;
--warning: #f59e0b;
--danger: #ef4444;
--radius: 8px;
--header-h: 56px;
}
The tokens are identical to Inventory, POS, and HR. That's intentional and it's now the fourth time. Every app in the studio shares the same visual identity — same slate palette, same cyan accent, same semantic greens and reds. A user who has used the CRM, Inventory, POS, or HR apps lands on Delivery Tracking and recognizes the language. The tokens are the brand.
--header-h: 56px matches HR and POS. The header height is a shared constant across every app in the studio. If it ever changes, one number in one file per app updates. That's the kind of consistency that accumulates into a brand.
✅The full file
The complete shell. Delivered separately so this page stays readable.
The full shell is delivery-stage-01.html — one HTML file, ~380 lines, no dependencies, no JavaScript beyond the tab toggle. It's delivered as a separate message (see the "Continue the build" section below for how to request it), so this lesson page stays focused on the concepts and the snippets.
The complete Stage 01 code, ready to run.
Right-click, save link as. Or open in a new tab and use File → Save Page.
The file contains:
- The
--token block (identical to the other apps) - The header bar with brand and the three-view tab toggle
- Customer view: tracking code input, sample timeline with 6 events, "no result" empty state
- Courier view: delivery detail card, primary action button, two secondary actions
- Dispatcher view: 4 KPI cards, map placeholder panel, 8-row active-deliveries table
- The CSS for all three layouts
- A 20-line inline script that wires the tab toggle
No data loads, no timers, no storage. Stage 01 is a layout exercise, and the full file is the exercise's answer.
Next: Stage 02 - Interactions
The shell comes alive. The state machine begins.
Stage 02 makes the shell alive. The customer tracking page derives its timeline from an event log. The courier view logs events that change the delivery's state. The dispatcher can assign a courier. Everything persists in localStorage.
The four big lessons in Stage 02:
- Derived delivery status —
deriveDeliveryStatus(events)walks the event log and produces the current state. Same pattern as HR'sderiveShift. - The state machine — valid transitions are
pending → assigned → picked_up → in_transit → out_for_delivery → delivered. Invalid transitions return an error. The event log enforces the graph. - Idempotent event recording — tapping "delivered" twice must not create two delivered events. Three guards: transitioning flag, state check, 5-second dedupe.
- LocalStorage persistence — close the tab mid-delivery, reopen, the delivery is still where it was. Same pattern as every Stage 02 so far.
Stage 02 ships the full file too — delivery-stage-02.html, ~850 lines. Same split: the lesson page here (with snippets), the full file there.