What Frontend Architecture Really Is (and What It Isn't)
Frontend architecture is the intentional structure of boundaries in your codebase. It is not the name of the framework you npm-installed.
Contents
The most common misdiagnosis in modern web development sounds like this: “Our frontend architecture is React with Tailwind.”
React is a UI library. Tailwind is a styling system. Neither is an architecture.
If you believe your framework is your architecture, you will stop making structural decisions. You will let the framework’s default file router dictate your data flow. You will let your components fetch their own data, manage their own domain logic, and handle their own styling all in the same file. That is not architecture. That is an untamed blob of accidental complexity waiting to ossify.
Frontend Architecture is the intentional design of boundaries.
Architecture as a System of Boundaries
Good architecture enables teams to change one part of a system without breaking everything else. It does this by enforcing boundaries.
The Component Boundary (Separation of Concerns)
Classic Separation of Concerns meant splitting HTML, CSS, and JavaScript into separate files. Modern component-driven development changed this: we now group code by feature, not by file type.
However, the concern still exists. A UI component should not assemble API URLs, parse raw JSON into domain objects, enforce business rules, and render markup all at once.
graph TD
subgraph The Blob (Accidental Architecture)
B1[Button Component] -->|Fetches Data| B2(Raw Network Response)
B1 -->|Parses| B3(Domain Logic)
B1 -->|Renders| B4(UI)
end
subgraph The Boundary (Disciplined Architecture)
D1[Data Layer] -->|Normalizes| D2[Domain Layer]
D2 -->|Passes Props| P1[Presentation Layer]
end
An example of Accidental Architecture: A UserProfile React component calls fetch(), manually checks if user.age > 18, and then returns a red badge if the check fails. If the age rule changes to 21, you have to hunt down every UI component that manually checks the age.
An example of Boundary Discipline: A dedicated User domain module exports a canDrinkAlcohol(user) function. The UserProfile component imports that function. The UI knows how to render the red badge; the domain module knows the rules.
The State Boundary
State should be scoped to the narrowest possible boundary.
- Local State: Ephemeral UI concerns. Is this dropdown open? What is typed in this input? (Belongs inside the component).
- Feature State: State shared within a specific feature domain. (Belongs in a context provider or feature-scoped store).
- Global State: State the entire application needs to know about, like the current logged-in user or the selected theme. (Belongs in a global store).
The Failure Mode: Putting a boolean like isDropdownOpen into a global Redux store. This couples a microscopic UI detail to the global architecture, forcing unnecessary re-renders.
The Rendering Boundary
Not all pixels are created equal. Architecture requires deciding where and when code turns into HTML.
If you treat a marketing site and a complex SaaS dashboard the same way, you are failing at architecture. A marketing site demands a static Rendering Strategy for SEO and speed. A SaaS dashboard demands client-side interactivity. Choosing the wrong rendering boundary imposes permanent performance penalties.
The Four Architecture Modes
Different product shapes demand entirely different boundary systems.
1. The Content Publication (e.g., Interface Atlas)
- Primary Boundary: The Content Model (Information Architecture).
- State: Minimal to none.
- Rendering: Static HTML with selective interactive islands.
- Architecture Focus: Ensuring content is decoupled from layout components so it can be queried and reused.
2. The Single-Page Application (SPA)
- Primary Boundary: Client-side state and routing.
- State: Complex, highly normalized client caches.
- Rendering: CSR or full-page SSR/Hydration.
- Architecture Focus: Managing the synchronization between the server database and the client-side memory.
3. The Design System
- Primary Boundary: The API contract of UI components.
- State: Strictly controlled local UI state; completely agnostic to domain data.
- Rendering: Must support multiple environments (React, Vue, Web Components).
- Architecture Focus: Consistency, accessibility, and preventing breaking changes for consuming teams.
Final Heuristic
The test of your frontend architecture is not whether it uses the latest framework. The test is what happens when requirements change.
If changing the data structure of your backend requires rewriting your UI components, your boundaries have failed. Architecture is the discipline of protecting the UI from the database, and protecting the database from the UI.
Related Guides and Terms
For deeper exploration, see:
- Information Architecture and Content Architecture — How knowledge structure drives UI.
- Web Performance as Architecture — How rendering decisions affect performance.
- Choosing the Right Stack — How to map product shape to tech stack.
Key glossary terms: Frontend Architecture, Separation of Concerns, Rendering Strategy