Skip to content

    Frontend System Design

    Capstone: Architecture and Design Document

    Write the front-end capstone design doc: context, goals and non-goals, decisions with alternatives, cross-cutting concerns and an audit plan, from a skeleton.

    By Published 13 min read

    • frontend-system-design
    • capstone
    • design-doc
    • architecture-decisions
    Share

    Standard lessonadvancedFrontend System Design

    Before this: Capstone: Brief and Requirements

    What you'll learn: By the end of this lesson you will be able to write a front-end design doc from a template, state goals and non-goals so that each one can be checked, record a decision with its alternatives and the condition that would reverse it, cover the cross-cutting concerns a front end tends to forget (accessibility, performance, failure states, observability), and write the audit plan before the build so the later review can contradict the doc.

    A builder does not start with bricks. They draw the plan, mark what the building will not include (no lift, no basement), and write down why the walls are where they are, so a plumber can later tell which wall is safe to move. A design doc is that plan for software. The capstone asks you to make one for a complete front end before you build it, and to write it so that someone else can check your work against it.

    The capstone brief and requirements (a separate lesson in this module) set the scope. This lesson turns that scope into a design. The next one, on the build, audit and review, tests the result against what you write here. The architecture decision record lesson of this module goes deeper on single records.

    Sources: "Design Docs at Google", Michael Nygard's "Documenting Architecture Decisions", the WCAG-EM methodology, WCAG 2.2 conformance, web.dev Web Vitals and performance budgets. All read on 2026-12-02.

    The core idea

    A design doc is a record of decisions and trade-offs written while changing course is still cheap. Its value is that someone can later point at a sentence and say "this was promised, and here is what happened".

    Three illustrations run through the lesson:

    • Minimal example: one decision written as a table with its alternatives and its reversal condition.
    • Realistic example: the skeleton of a design doc for an order dashboard, the front end of a grocery marketplace (the ShopStream front end). Replace it with your own project.
    • Failure example: a doc that lists a goal nobody can check, and the audit that therefore cannot fail it.

    What a design doc is for

    "Design Docs at Google" gives the functions of a design doc: early identification of design issues while changes are still cheap, building consensus before coding, covering cross-cutting concerns that might otherwise be missed, and spreading senior engineers' knowledge. It suggests that for a larger project around 10 to 20 pages is a sweet spot and that a short "mini design doc" of one to three pages suits smaller incremental work. It warns against docs that are really implementation manuals.

    For a capstone, aim at the small end: a few pages a reviewer can read in one sitting. The test of a doc is whether a reader can find, for any part of the system, the sentence that explains why it is that way.

    The template

    The article lists a structure that "has proven useful": context and scope, goals and non-goals, the design, alternatives considered and cross-cutting concerns. The capstone version keeps those and adds two sections that a front end needs, an audit plan and a results section.

    # Design doc: <project name>
    1. Context and scope        what exists today, what this builds, link to the brief
    2. Goals and non-goals      checkable goals; non-goals with a reason each
    3. Requirements             functional, then non-functional with numbers
    4. Design overview          system-context figure, data flow, where state lives
    5. Decisions                one table per decision: options, choice, cost, reversal
    6. Cross-cutting concerns   accessibility, performance, failure states, observability, security
    7. Audit plan               each goal -> the measurement that will judge it, written first
    8. Risks and open questions what could be wrong and who finds out
    9. Results                  filled in after the audit; allowed to say the design was wrong

    Figure 1. The doc sits between the brief and the audit

    Where the design doc sits in the capstoneBrief to Design doc; Design doc to Build; Build to Audit; Audit to Results (feeds back); Results to Design doc (may change it)Brief: scope, requirementsBriefscope,requirementsDesign doc: decisions, audit planDesign docdecisions, auditplanBuild: code that follows the docBuildcode that followsthe docAudit: measure against the planAuditmeasure againstthe planResults: section 9 of the docResultssection 9 of thedocfeeds backmay change it

    How to read this: the doc is the middle of the capstone, not its first page. The audit does not grade the code in a vacuum; it measures the code against the plan in the doc, and the results go back into the same document.

    Context, goals and non-goals

    Context and scope. The article says this section "should be entirely focused on objective background facts": what exists, what the project builds, and how it relates to the brief. It is not a place for requirements or opinions.

    Goals say what the system should achieve. A goal earns its place only if you can name how it would be judged. "Fast" is a wish. "LCP of 2.5 seconds or less at the 75th percentile" is a goal: web.dev says a page should hit the "good" value of LCP within 2.5 seconds, INP of 200 milliseconds or less and CLS of 0.1 or less, and that a good threshold to measure is the 75th percentile of page loads, segmented across mobile and desktop.

    Non-goals are, in the article's words, "things that could reasonably be goals, but are explicitly chosen not to be goals". They are not the opposite of goals ("the page should not be slow"). For the order dashboard, a real non-goal is "no offline editing in version 1", because someone could sensibly ask for it. Give each non-goal a one-line reason; it tells the reviewer what not to fault.

    Illustration 1: the minimal example

    One decision as it would appear in section 5. The numbers are illustrative.

    Option Gain Cost Choose when
    Client-side rendering only Simplest to build and host Slow first paint on weak devices; content needs scripts The app is behind a login and not indexed
    Server rendering of the shell and the first list Faster first paint of the list A server to run; hydration to get right First paint matters and data is cheap to fetch on the server
    Static prerendering Cheapest to serve Data is as old as the last build The data barely changes

    Choice: server-render the shell and the first page of orders; render the rest on the client. Cost accepted: a server tier and a hydration step to test. Reverse when: the audit shows server time dominating LCP, or the hosting cost exceeds the budget in section 3. The rendering strategies lesson covers the options in depth; the doc only records your choice.

    A decision with a reversal condition can be revisited without an argument. Nygard's article on decision records says a record has a title, context, decision, status and consequences, that it should be one or two pages, and that a reversed decision is kept and marked superseded.

    Figure 2. The life of a decision record

    stateDiagram-v2 accTitle: Status of a decision record accDescr: A decision starts as proposed, becomes accepted after review, and may later be marked deprecated or superseded by a newer record. A reviewed proposal can also be rejected and kept as a record. [*] --> Proposed Proposed --> Accepted: review agrees Proposed --> Rejected: review disagrees Accepted --> Superseded: a newer record replaces it Accepted --> Deprecated: no longer applies Superseded --> [*] Deprecated --> [*] Rejected --> [*]

    How to read this: records are not deleted when plans change. The old one stays, marked, so a later reader can see what was believed and when. "Proposed", "accepted", "deprecated" and "superseded" come from Nygard's article; "rejected" is this lesson's addition.

    Requirements with numbers

    Section 3 separates what the system does (functional) from how well it must do it (non-functional). The second list is the one audits judge, so every item needs a number or a yes/no test. For the order dashboard:

    Kind Requirement How it is judged
    Performance LCP, INP, CLS at the 75th percentile within the published "good" values Field or lab measurement per route
    Performance JavaScript on the main route under a budget you choose (illustrative: 170 KB gzip) Build output
    Accessibility No automated violations; every key flow done by keyboard alone Tool run plus a manual pass
    Resilience Loading, empty, error and refresh-failed states exist for every remote list Checklist of screens
    Testing No failing tests; the critical flows have at least one end-to-end test Test run

    A performance budget is, per web.dev, "a set of limits imposed on metrics that affect site performance", which can be quantity-based (page weight, request count, script size), milestone timings or rule-based scores. See performance budgets and profiling and Core Web Vitals.

    The design overview

    Section 4 shows the system once, as one figure, and says where state lives. Keep it to what the audit will touch.

    Illustration 2: the realistic example

    The order dashboard is a single-page front end for staff of a grocery marketplace. It shows an order list with search and a status filter, a detail page and a "mark as packed" action, and talks to one backend-for-frontend (BFF) service in front of the orders API. Staff sign in through an identity provider. All numbers here are illustrative.

    Figure 3. Context of the order dashboard

    Order dashboard: system contextPacking staff to Front end; Front end to BFF (JSON over HTTPS); BFF to Orders API; Front end to Identity provider (sign in); Front end to Field data (reports)OUR SYSTEMPacking staff: desktop and tabletPacking staffdesktop andtabletFront end: list, detailFront endlist, detailBFF: shapes data, one originBFFshapes data, oneoriginOrders API: source of truthOrders APIsource of truthIdentity provider: sign-inIdentityprovidersign-inField data: vitals and errorsField datavitals and errorsJSON over HTTPSsign inreports

    How to read this: the accent box is what the capstone builds; grey boxes are outside it.

    State goes in the same section: server data in a cache keyed by query (see server state, caching and revalidation), the filter and search in the URL, and a draft of an in-progress action in the component. For each piece of state write one line: where it lives, who may change it, and what happens on reload.

    Cross-cutting concerns

    The article gives "security, privacy, and observability" as examples and says teams decide which apply. For a front end, five nearly always do:

    1. Accessibility. State the target. WCAG 2.2 defines three levels: A is the minimum, AA needs every A and AA criterion, and AAA adds the AAA ones. The same page says AAA is not recommended as a general policy for entire sites. A capstone usually targets AA. Conformance applies to full pages and complete processes: every page in a multi-step flow must conform at the claimed level. See accessibility fundamentals and WCAG.
    2. Performance. The budget from section 3, and which route it applies to.
    3. Failure states. The states of every remote list (loading, empty, error, refresh failed). The error, loading and empty states lesson gives the model.
    4. Observability. What you will measure in the field and how it reaches you (real user monitoring).
    5. Security and privacy. Where the token is kept, what is logged, what the CSP allows.

    One sentence each is enough, if each has an owner and a way to be checked.

    The audit plan comes first

    Section 7 is a table with one row per goal: the goal, the measurement, the tool, who runs it, and the pass line. Write it before the build: criteria written after the results are measured tend to fit the results.

    For accessibility, the W3C's WCAG-EM methodology shows how a real evaluation is planned: define the scope, explore the target, select a representative sample, evaluate it, report. It says the structured sample should include common views and essential functionality, and that a random sample of 10 percent of the structured set is added to check that the structured set missed nothing. It also says that conformance claims for a whole website cannot be made from a sample alone. For a six-page capstone, check all six and claim only what you checked.

    W3C guidance on evaluation tools adds that tools "can not determine accessibility, they can only assist", so the plan lists manual steps (a keyboard walk of each key flow) next to the tool run.

    Figure 4. From goal to evidence

    flowchart LR accTitle: From a goal to the evidence that judges it accDescr: Each goal in the design doc maps to a measurement, a tool or manual step, and a pass line. If a goal has no measurement it is rewritten or moved to non-goals before the build starts. G["Goal in section 2"] --> M{"Is there a
    measurement?"} M -- yes --> T["Tool or manual step
    and pass line"] M -- no --> R["Rewrite the goal
    or make it a non-goal"] T --> P["Row in the audit plan"] R --> G

    How to read this: the diamond is the whole discipline. A goal with no way to be judged does not enter the plan; it is rewritten until it can be, or it moves to the non-goals.

    Illustration 3: a failure

    An illustrative case. A doc lists the goal "The dashboard should feel responsive and accessible", and the audit plan says "check with Lighthouse". The run shows a green score and the project is declared done, although a keyboard-only user cannot reach the "mark as packed" button. No sentence in the doc was wrong, because no sentence could be. Lighthouse's performance score is a weighted average of metric scores, and only metrics contribute to it; it says nothing about keyboard reachability. The fix: rewrite the goal as "every key flow completes by keyboard alone, and no automated violations", with a manual step per flow.

    Trade-offs

    Choice Gain Cost
    Short doc with decision tables Read in one sitting; easy to keep current Detail lives in code and records
    Audit plan before the build Honest criteria Some criteria turn out wrong and must be revised, with a note
    Targeting AA A recognised target More to check than a basic scan
    One record per decision Easy to supersede More files to keep tidy

    Build it

    This lesson has no lab: the deliverable is a document. Use the template above as the starting point and fill in the skeleton for your own capstone. A minimal skeleton, as it would start, with the order dashboard as the example:

    # Design doc: Order dashboard
    1. Context and scope: staff packing tool for a grocery marketplace; builds the front end only.
    2. Goals: G1 LCP at p75 within the published good value. G2 every key flow completes by keyboard alone.
       Non-goals: N1 no offline editing in v1 (reason: sync conflicts are out of scope).
    3. Requirements: JavaScript on the main route under the budget in section 3 (illustrative: 170 KB gzip).
    4. Design overview: Figure 3; server data cached by query; filter in the URL.
    5. Decisions: D1 render the shell on the server (table, reversal: server time dominates LCP).
    6. Cross-cutting: AA target; states per list; field vitals reported; token kept in memory.
    7. Audit plan: G1 -> lab run per route and field data; G2 -> keyboard walk of 3 flows.
    8. Risks: hydration mismatches; the tablet keyboard flow is untested.
    9. Results: (empty until the audit).

    The next lesson has a small pure-TypeScript lab that scores a checklist like section 7.

    In practice: the doc for the order dashboard

    NOTE

    This is a realistic scenario, not a case history. It is a composite built from common team practice. It describes no specific company or product, and every number in it is an illustrative assumption.

    The situation

    A three-person team starts the order dashboard. Two want to begin coding on day one. The third asks for a two-page doc first. Nobody is sure whether the first release must work on tablets, and the packing manager's wish list has 14 items.

    Starting architecture

    Figure 5. Before the doc

    Before the doc: scope held in conversationsWish list to Code; Code to ReviewWish list: 14 items, no orderWish list14 items, noorderCode: starts on day oneCodestarts on day oneReview: what was promised?Reviewwhat waspromised?

    How to read this: the warning boxes are where the project loses information. Scope lives in chat, and the review has nothing written to hold the build against.

    Options considered

    Option Fixes Costs Risk
    Code first, doc at the end No delay The doc describes what happened Criteria fit the results
    A short design doc from the template Goals, non-goals, plan About a day of writing Over-detail

    The decision

    Field Decision record
    Context Scope is in chat; tablets are undecided; 14 wishes.
    Decision Write a short doc using the template. Cut the wish list to 5 goals and 3 non-goals with reasons. Write the audit plan before the first commit.
    Consequences, good The review checks the build against written goals; arguments move to the decision tables.
    Consequences, bad A day of writing; some goals are later revised.
    Revisit when The audit shows a goal that cannot be measured, or the scope changes.

    Rollout and verification

    1. Draft sections 1 to 3 and agree the goals and non-goals with the packing manager.
    2. Write sections 4 to 7; ask someone outside the team to find a goal with no measurement.
    3. Build. When a decision changes, add a record and mark the old one superseded.
    4. Run the audit from the plan and fill in section 9, including what did not work.

    The 2 a.m. failure

    The doc says the token is kept in memory, but a later change stored it in local storage for convenience, and nobody updated the doc. A security review at 2 a.m. after an alert finds the mismatch.

    First three checks: (1) compare the cross-cutting section with the code; (2) look for records marked accepted whose reversal condition has occurred; (3) check whether the change had a record. Mitigation: revert the change or write the record and accept the new risk. Follow-up: add the token location to the audit plan as a check, so a mismatch is found by a test and not by an incident.

    Architect's notes

    • Numbers in the doc, not in your head. If a number matters, it appears with its unit and a source or the word illustrative.
    • Say what you did not choose. The alternatives table is the most useful part of the doc.

    Common mistakes

    • Goals that cannot be judged, such as "fast", "clean", "accessible".
    • An audit plan written after the results.
    • Decisions without alternatives or a reversal condition.
    • Claiming conformance for pages you did not check.

    Key takeaways

    • A design doc records decisions and trade-offs while changing course is cheap.
    • Goals need a measurement; non-goals are reasonable goals you chose not to pursue, each with a reason.
    • Record each decision with options, cost and a reversal condition; mark reversed records superseded.
    • Cover accessibility, performance, failure states, observability and security explicitly.
    • Write the audit plan first, including manual steps, because tools assist and do not determine accessibility.

    Practice exercises

    Exercise 1: Starter (30 min). Rewrite three vague goals so each has a measurement and a pass line.

    Exercise 2: Intermediate (2 hours). Write sections 1 to 3 and the audit plan (section 7) for your own capstone. Ask a colleague to find one goal with no measurement.

    Exercise 3: Advanced (half day). Write three decision records for your capstone with at least two alternatives each and a reversal condition. Then change one decision on purpose and mark the first record superseded.

    In this course:

    Official documentation

    Ask about this article

    Get answers grounded in this post. AI-generated — based on this article, and may be imperfect.

    Scaled AI Weekly

    Enjoyed this? Get more like it every Monday.

    Real architecture decisions, LLMOps patterns that survive production, and engineering leadership advice — from 12+ years of building at enterprise scale. Free. No spam. Unsubscribe anytime.

    Get new articles by email

    Free. We email a confirmation link first, and you can unsubscribe from any email.

    Join engineers building production AI systems

    Comments