๐จ
Frontend / Presentation
What users see and interact with
Single Page Application (SPA)
React, Angular, Vue, Svelte
Loads once and dynamically updates the page without full reloads. JavaScript framework manages state and rendering in the browser. Feels fast and responsive. Communicates with backends exclusively via APIs.
๐๏ธ Context: SPAs shift rendering to the client, reducing server load but increasing frontend complexity. SEO and initial load time are trade-offs โ mitigate with SSR (Next.js, Nuxt) or static generation.
Server-Side Rendering (SSR)
Next.js, Nuxt, Remix, SvelteKit
HTML is generated on the server per request and sent to the browser ready-to-render. Combines the interactivity of SPAs with fast initial loads and SEO. The server does the heavy lifting on first paint.
๐๏ธ Context: SSR is the modern default for content-heavy sites. Adds server compute cost per request. Streaming SSR (React 18+) sends HTML progressively, improving perceived performance.
Static Site Generation (SSG)
Gatsby, Hugo, Astro, 11ty, Jamstack
Pages are pre-built at build time into static HTML. Served from a CDN with zero server compute at request time. Extremely fast, secure, and cheap to host. Best for content that doesn't change per-user.
๐๏ธ Context: SSG + CDN delivers the best performance and lowest cost for marketing sites, documentation, and blogs. ISR (Incremental Static Regeneration) bridges SSG and SSR for dynamic content.
Micro-Frontends
Module Federation, Single-SPA, iframes
Breaking a frontend monolith into independently developed, deployed, and owned pieces โ one per team or domain. Composed at runtime into a single user experience. The microservices idea applied to the UI.
๐๏ธ Context: Justified at scale (5+ teams on one frontend). Webpack Module Federation is the leading approach. Trade-offs: shared dependency management, consistent UX, and performance overhead of composition.
Design System
Component library, Storybook, Figma tokens
A shared library of reusable UI components, design tokens (colours, spacing, typography), and patterns. Ensures visual consistency across applications and accelerates development by eliminating redundant UI work.
๐๏ธ Context: A design system is a platform capability. Invest in it as a product with its own team, versioning, documentation (Storybook), and adoption metrics. Reduces UI inconsistency and duplicated effort at scale.