The Web FrontendVol. 2 · Part II
0 / 0

Shelves / The Web Frontend

FE·33

Frontend Projects

Eight build-it-yourself projects that grow one product, a tiffin-ordering app, from a static page to a monitored production PWA: what each teaches, a milestone plan, measurable definitions of done, and stretch goals for experienced readers.

12 topics · ~7 min read · 5-question quiz
Updated Suggest a correction

How to approach the projects

One product, built up in layers

Reading teaches recognition; building teaches skill. This chapter's projects all grow one product, an online ordering app for a small South Indian tiffin centre, so each project builds on the last instead of starting from nothing, and by the end you have a portfolio piece that shows the whole of Part II working together.

# Project Main chapters Roughly
1 Accessible static menu site 12, 13, 14, 20 a weekend
2 Interactive cart in plain JavaScript 15, 17, 21 a weekend
3 The ordering SPA (React or Angular, TypeScript) 16, 21, 22 or 23, 25 2–3 weeks
4 Offline-first PWA 19, 29 1 week
5 Server-rendered storefront with a performance budget 18, 24, 27 1–2 weeks
6 A small design system 14, 20, 21 1–2 weeks
7 Live order tracking 19, 25 1 week
8 Production pipeline: tests, CI, deploys, monitoring 26, 28, 30, 31, 32 2 weeks

If you're new to the web, do them in order, after the Start Here chapter's warm-up exercises. If you're experienced, skim 1–2, then treat each later project's stretch goals as the real assignment.

The working method

For every project:

  1. Write the definition of done first. Each project lists measurable checks (a Lighthouse score, an axe result, a test, a timing). Copy them into a checklist before writing code.
  2. Build the thinnest end-to-end slice first, then widen it: one dish rendered end to end before the whole menu.
  3. Measure, don't guess: use the techniques from the chapter labs (DevTools, Playwright, Lighthouse, axe) on your own project.
  4. Keyboard-test and screen-reader-test every screen before calling it done.
  5. Write a short README for each project: what you built, the decisions you made and why, what you measured, and what you'd do next. That README is what interviewers read.

The eight projects

Project 1: an accessible static menu site

Goal. A three-page site (Home, Menu, Visit us) in plain HTML and CSS, no JavaScript.

Milestones. Semantic structure with landmarks and headings → the menu as a real table or list with prices → a responsive layout with grid and flexbox, mobile-first → a form for table bookings with labels, native validation and autocomplete → optimised images (srcset, WebP/AVIF, dimensions) → deploy to any static host.

Done when. axe reports 0 violations on every page; you can complete the booking form with the keyboard alone; the layout has no horizontal scrolling at 320 px and works at 200% text zoom; Lighthouse (mobile) scores 100 for Accessibility and at least 95 for Performance; the HTML validator reports no errors.

Stretch. Dark mode with prefers-color-scheme and tokens; a print stylesheet for the menu; container queries for the dish cards.

Project 2: an interactive cart in plain JavaScript

Goal. Add "Add to cart", quantities, a running total, a coupon box and a saved cart to project 1, with no framework.

Milestones. State in a plain object, a single render() (chapter 21's UI = f(state)) → event delegation for all buttons → localStorage persistence → coupon validation with clear error messages → money handled in integer paise and formatted with Intl.NumberFormat.

Done when. The cart survives a reload; totals are correct for a table of test cases you write (including rounding with a 10% coupon on ₹55); no innerHTML with user-provided data; screen readers announce cart updates through a polite live region.

Stretch. Undo and redo using a reducer and a history of states; sync the cart between two open tabs with BroadcastChannel.

Project 3: the ordering SPA

Goal. Rebuild the app as a single-page application in React or Angular with TypeScript: menu, dish details, cart, checkout and order history, talking to an API.

Milestones. A typed API layer with runtime validation at the boundary (Zod or similar) → a mock API with MSW (or a small Node/Spring backend if you have one) → routing with deep links → server state through TanStack Query, Angular httpResource or similar, with loading, error and empty states → a checkout form with validation → optimistic "add to favourites" with rollback.

Done when. tsc passes with strict and no any; every route works on reload (deep links); every request shows loading and error states (test them by forcing failures with MSW); no race conditions when switching dishes quickly (chapter 22's lab); the Profiler shows no component re-rendering on unrelated state changes.

Stretch. Build it in both React and Angular and write a comparison of the two codebases; add a state machine for checkout.

Project 4: an offline-first PWA

Goal. Make project 3 installable and usable offline.

Milestones. Web app manifest and icons → a service worker with cache-first for the app shell and network-first for menu data → an offline banner → orders placed offline queued in IndexedDB and sent when the connection returns → an "update available, reload" prompt for new versions.

Done when. Chromium reports no installability errors; with the network disabled after one visit, the app opens and shows the last menu; an order placed offline is delivered exactly once after reconnecting (no duplicates: use an idempotency key); deploying a new version never leaves a tab broken (chapter 31's lab).

Stretch. Push notifications for "your order is ready"; measure storage use and handle quota errors.

Project 5: a server-rendered storefront with a performance budget

Goal. Move the public pages (home, menu, dish pages) to a full-stack framework (Next.js, React Router, Astro, Nuxt, SvelteKit or Angular SSR) with the right rendering strategy per route, and hit a performance budget on a throttled phone.

Milestones. Static generation with revalidation for the menu; streaming for slow sections (reviews); islands or Server Components so static content ships no JavaScript; responsive images with a CDN; a JavaScript budget per route enforced in CI.

Done when. On a throttled mid-range phone profile (chapter 27's lab settings): LCP under 2.5 s, CLS under 0.1, INP under 200 ms for adding to cart; the menu page ships less than 100 KB of compressed JavaScript; no hydration mismatch warnings; Lighthouse CI fails the build when a budget is exceeded.

Stretch. Compare two frameworks on the same pages and write up the numbers; add partial prerendering or incremental hydration.

Project 6: a small design system

Goal. Extract the app's UI into a reusable library: tokens, primitives (Button, Input, Select, Dialog, Tabs, Toast) and documentation.

Milestones. Design tokens as CSS custom properties with light and dark themes → accessible primitives (use headless libraries or native elements like <dialog>) → Storybook (or a docs page) with every state → visual regression tests → publish as a package in a monorepo workspace and consume it from the app.

Done when. Every component passes axe and keyboard tests in its stories; each follows its ARIA Authoring Practices pattern; visual tests catch a deliberate 1-pixel padding change; the app uses only library components for these controls.

Stretch. Ship the primitives as Web Components so a second app in another framework can use them; add a theming API.

Project 7: live order tracking

Goal. Customers see their order move through "placed → cooking → ready → delivered" in real time; the kitchen sees new orders arrive.

Milestones. Server-Sent Events for customer updates with Last-Event-ID resume → a WebSocket (or SSE plus POST) for the kitchen screen → status modelled as a state machine shared by client and server → reconnection with backoff and a visible connection indicator.

Done when. Killing and restarting the server mid-order loses no status update (chapter 19's lab); the UI never shows impossible states (cooking and delivered at once); updates are announced to screen readers; a test simulates a dropped connection and verifies recovery.

Stretch. Show the kitchen's queue with optimistic reordering; add presence ("2 cooks online").

Project 8: the production pipeline

Goal. Make the whole app shippable and observable like a real product.

Milestones. Unit, component (with MSW) and Playwright tests for the critical journeys → CI that runs type-checking, lint, tests, accessibility checks and bundle budgets on every pull request, with preview deployments → security headers (strict CSP with nonces, frame-ancestors, HSTS) and dependency updates automated → atomic deploys that keep old assets → error tracking with source maps and releases, RUM for Web Vitals, and traces from browser to backend.

Done when. A failing test, a type error, an axe violation or an exceeded budget blocks merging; the CSP report-only rollout shows no violations before enforcing; a deliberate error in production appears in the tracker with an un-minified stack trace and the release name; your dashboard shows p75 LCP and INP per route; you can roll back in under a minute.

Stretch. Canary releases with automatic rollback on an error-rate increase; mutation testing on the pricing logic; a load test of the real-time service.

Tracking your progress

Portfolio checklist

Keep one repository (or a monorepo) with a README per project covering: the goal, a screenshot or short recording, the architecture and key decisions, the measurements against the definition of done, and what you'd improve. The measurements are what make it convincing: "LCP 1.9 s at p75 on a throttled Moto G profile, 84 KB of JavaScript on the menu route, 0 axe violations" says more than any list of technologies.

Mapping to mastery levels

Completing projects 1–3 with their checks puts you solidly at L2 across the volume. Doing the stretch goals and being able to explain every measurement you took is L3–L4. Making and defending the architecture decisions in projects 5–8 (rendering strategy, state architecture, caching, release and monitoring design) is L5 work, the level senior and staff frontend interviews probe.