knaxuslearn · build · ship

Roadmaps / Frontend / The milestone project

Read first

The milestone project

Scenario. storefront sells 5,000 products. A visitor browses a category page, searches, opens a product page, adds items to a cart and fills in a checkout form. Half of the visitors use a mid-range phone on a slow 4G connection. Targets, measured in the lab on a throttled mid-range phone profile: Largest Contentful Paint (LCP) at or under 2.5 s; Interaction to Next Paint (INP) at or under 200 ms; Cumulative Layout Shift (CLS) at or under 0.1; the first route ships 170 KB or less of compressed JavaScript; no serious or critical accessibility violation in an automated scan; the whole purchase flow works with a keyboard alone; a strict Content Security Policy with no unsafe-inline for scripts.

PhaseCheckpointDone when
1Measured pageThe first version of the category page loads, and a trace shows the critical path (HTML, CSS, JavaScript, image, in order). A table lists LCP, INP and CLS lab values on the throttled profile, with your predictions beside them. A seeded problem (an unsized hero image that shifts the layout) is found from the trace and fixed, with before and after numbers.
2Typed and accessibleStrict TypeScript passes on the whole app. The cart state has one owner and a test for each transition. The search box, menu and dialog work with keyboard and screen reader, and an automated scan shows no serious violation. A seeded bug (a stale cart total after a quantity change) is caught by a test, and you write down which kind of test caught it.
3Rendered and fastCategory pages render on the server, product pages use a stated caching rule and the cart is client-side. The JavaScript budget is enforced in CI and a seeded oversize import fails the build. LCP, INP and CLS meet the targets on the throttled profile, with spread over 10 runs. A seeded slow interaction (a long task on every keystroke) is found in a trace and fixed.
4Shipped and safeEnd-to-end tests cover the purchase flow on two browsers. A strict Content Security Policy is on, and a seeded cross-site scripting payload in a product name is rendered inert. npm audit and a licence check run in CI, and a seeded vulnerable package fails the build. A memo says what you would change for a team of ten.
WWork version (Staff and Principal)On a real product: add one gate (a performance budget, an accessibility scan or a type-strictness ratchet) to CI, fix what it finds and record the result. Pass: a target agreed in writing beforehand is met, or the number of findings falls at least 5 times over the same pages. The ADR is signed by a named stakeholder, scored by someone other than you, and a recheck is booked three months later. Timebox: six weeks alongside Phases 3 and 4.

Evidence to hand in. A repository whose README opens with the problem and the numbers above; one ADR (architecture decision record) per decision, each naming a rejected option; raw trace files and a test report; a one-page design doc; a diagram of how a request becomes a rendered page. Skeletons: Checkpoint 1 is the table below with your numbers and the trace. Checkpoint 3 is the 10-run table (LCP, INP, CLS, bundle size) with spread. Checkpoint 4 is the CI output with the failing and passing audit and the blocked script payload.

LevelWhat you build and hand in
FresherCore scope: three routes, one framework, the four checkpoints, ADRs 1 to 4.
SeniorAdds field measurement with the web-vitals library, an Angular version of the cart as a comparison and ADRs 5 to 7.
StaffAdds written decisions with numbers: a performance and accessibility policy, a migration plan and a cost model.
PrincipalAdds a decision on a shared frontend platform for several teams, with a measured outcome from the work version and a checklist other teams reuse.

Do this at work. A solo lab is not promotion evidence. Take a real product page or flow and run Checkpoint W on it. Start with a baseline over a month of field data: LCP, INP and CLS at the 75th percentile and the count of accessibility issues. Make one change. Measure again. A promotion committee accepts the real decision and who made it, the named stakeholder who relied on it, before and after numbers, and a result checked again three months later.

Solo version. With no real product, pick a named open-source web app, run Lighthouse and an accessibility scan on three pages and write a one-page review. Ask a peer or mentor to check your measurements. Use a free public catalogue API or a generated JSON file of 5,000 products.

Laptop scale. Everything runs on a laptop. Lab numbers come from the browser's own throttling, not a real phone, so say so in the memo. Field data needs real visitors; the solo version measures lab data only.

Honest sizing. A three-route shop takes an experienced engineer a few days. The checkpoints add measurement, accessibility testing, a budget gate and a security pass, which is where the hours go. Phase 2 is the heaviest for a fresher (types, state and accessibility together), so use the extra fresher week there.

Worked reference: what a "3 Proven" hand-in for Checkpoint 1 looks like

The numbers are illustrative. The shape (one large image and one render-blocking script explain most of the loss) is what you should expect. Hand in your own measurements.

Category page, throttled mid-range phoneBeforeAfter the fixes
LCP4.1 s2.2 s
CLS0.240.02
INP (add-to-cart click)310 ms140 ms
JavaScript, compressed410 KB165 KB
What the trace showedAn unsized, unoptimised hero image; a blocking analytics scriptThe image sized and preloaded; the script deferred

ADR-2 excerpt: Load the hero image with explicit dimensions and a high fetch priority, and defer the analytics script. The unsized image moved the layout after it loaded, which caused most of the CLS, and the blocking script delayed the first paint. After the fix LCP fell from 4.1 s to 2.2 s on the throttled profile. Rejected: lazy-loading the hero image, because the hero is the LCP element and lazy loading delays it. Rejected: removing the analytics script, because the business needs it; it loads after the page is interactive. Revisit when the field data at the 75th percentile disagrees with the lab numbers.