HELM
Ch 04 · Frontend Architecture
Chapter 04 · The user surface

Frontend — the choices that decide UX, perf, and shipping speed

Framework, rendering mode, state library, build tool, monorepo, design system — six choices, each with a 50% chance of being wrong. This chapter is the cheat-sheet.

4.1 · The 2026 framework field

FrameworkSweet spotWatch out
Next.js (React)Default for most product apps; App Router + RSC + Server Actions.Vendor pull toward Vercel; learning curve on RSC.
Remix / React Router 7Web-platform-first; great forms & nested routing.Smaller ecosystem than Next.
AstroContent sites; islands; ship ~0 KB JS by default.Not a SPA framework.
SvelteKitSmaller bundles, simpler model; great DX.Smaller hiring pool.
Nuxt (Vue)Vue ecosystems; strong in EU/Asia.Less momentum than Next.
SolidJS / SolidStartFine-grained reactivity; very fast.Tiny community.
QwikResumability — near-instant TTI on huge apps.Adoption is slow.
HTMX + server templatesServer-rendered apps with surgical interactivity.Limited for rich client UIs.

4.2 · Rendering modes — pick once, suffer forever

SSG Build-time HTML Marketing, docs, blogs ★ fastest TTFB ✗ rebuild on change ISR Re-gen on demand e-commerce, CMS-driven ★ fast + fresh ✗ cache complexity SSR Per-request HTML Logged-in pages ★ personalised ✗ server cost RSC Streamed server components ★ small JS bundle ✗ mental model shift SPA / CSR Client renders SaaS dashboards ★ rich UX ✗ slow first paint

4.3 · State management — pick the lightest thing that works

LibFor
Built-in React state + ContextMost components; don't over-engineer.
Zustand / JotaiSmall global stores without Redux ceremony.
Redux ToolkitBig apps with complex flows; well-known patterns.
TanStack Query / SWRServer-state: caching, dedupe, mutations, polling.
XStateExplicit state machines for complex UI flows.
Signals (Solid / Preact / Vue ref)Fine-grained reactivity.

Default rule: server state via TanStack Query, client state via Zustand or built-ins. Reach for Redux/XState only when the complexity is real.

4.4 · Styling & design systems

ApproachPicks
Utility-firstTailwind CSS (default in 2026).
CSS-in-JSVanilla-extract, Panda CSS, Emotion. Stitches is dead; styled-components is legacy.
Headless component libsRadix UI, Headless UI, React Aria.
Full UI libsshadcn/ui (copy-paste, owns the code), MUI, Mantine, Ant Design.
Design tokensStyle Dictionary, Tokens Studio; sync Figma ↔ code.

4.5 · Data fetching

  • Default to server-component fetch + Server Actions in Next 15+.
  • For client interactivity use TanStack Query or SWR.
  • For typed end-to-end use tRPC (within a monorepo) or generate clients from OpenAPI / GraphQL.
  • Streaming + suspense — show skeletons fast, hydrate progressively.

4.6 · Build tools

ToolWhere
ViteSPA / library dev. Fast HMR. The default 2026 dev server.
TurbopackNext.js bundler (Rust). Production-grade.
esbuild / swcUnderneath everything fast.
BunJS runtime + bundler + package manager + test runner in one binary.
Rspack / RolldownRust-based Webpack/Rollup replacements.

4.7 · Monorepos

ToolNotes
pnpm workspacesCheap, fast, the default base.
TurborepoCached task runner; great for JS/TS monorepos.
NxHeavier, opinionated, polyglot. Strong for very large orgs.
Moon / LageNewer alternatives in the same space.

4.8 · The performance budget — Core Web Vitals

MetricWhat it measuresGood target
LCP (Largest Contentful Paint)Loading< 2.5s
INP (Interaction to Next Paint)Responsiveness< 200ms
CLS (Cumulative Layout Shift)Visual stability< 0.1
TTFBServer response< 800ms
TBT / Total JSMain-thread work; JS shipped< 150 KB gzipped initial

4.9 · Accessibility & i18n — non-negotiable

  • WCAG 2.2 AA baseline. Test with axe + manual keyboard pass.
  • Semantic HTML first; ARIA second.
  • Keyboard focus visible; tab order matches reading order.
  • i18n via ICU MessageFormat (FormatJS, lingui, next-intl). Pluralisation, RTL, locale-aware dates.

4.10 · The testing pyramid for frontend

  • Unit — Vitest / Jest. Fast, hundreds per second.
  • Component — Testing Library + Storybook stories as tests.
  • E2E — Playwright (the default 2026). Cypress is legacy choice.
  • Visual regression — Chromatic, Percy.
  • Synthetic — Checkly / Datadog Synthetics for prod URL health.

4.11 · Self-check

Q1 · For server state (caching, dedupe, refetch), default tool?
Redux
TanStack Query / SWR
Context only
localStorage