Systems & architecture
Frontend architecture that lasts
Treat the app as a system: state machines, an error-handling strategy, offline-first sync and feature flags — the decisions that keep a codebase healthy as it grows.
5 parts30 min readUpdated Jan 17, 2026
Parts
Part 1
Think in Systems, Not ScreensFrontend apps break when we design them page by page. A short field guide to mapping state, data flow and ownership before drawing the UI.
2 min
Part 2
State Machines for UI: Making Impossible States ImpossibleWhy isLoading, isError and data living side by side breed bugs, how to model UI as states and events, a typed useReducer state machine for a submit flow, and when a statechart library is worth it.
6 min
Part 3
A Frontend Error-Handling Strategy: From Error Boundaries to Retries and ReportingClassify errors before handling them, understand what error boundaries do and don't catch, retry properly with backoff and jitter, separate user-facing messages from developer logs, and report errors without leaking personal data.
6 min
Part 4
Offline-First and Optimistic UI: Designing Sync That Never Loses DataOptimistic updates with rollback, an IndexedDB-backed outbox, idempotency keys, retrying when the network returns, conflict resolution strategies, showing sync status and testing offline scenarios.
9 min
Part 5
Feature Flags in the Frontend: Types, Evaluation, Rollout and CleanupFeature flags decouple deploy from release, but used carelessly they turn into tech debt and flickering UIs. This post covers the four kinds of flags, evaluating on the server vs the client, typed flag definitions in TypeScript, gradual rollout, A/B testing and a cleanup process.
7 min
Series review
0/10 answered · 0 correct
10 questions drawn from the parts of this series. Answers here count toward each post's own quiz.
Other series
Series- AI engineering for web developers4 parts · 86 min read0/4 read
- NestJS in production3 parts · 67 min read0/3 read
- Web performance from the ground up8 parts · 74 min read0/8 read
- Modern CSS and the web platform5 parts · 46 min read0/5 read
- The engineering craft4 parts · 21 min read0/4 read
- Frontend in depth7 parts · 129 min read0/7 read
- Business analysis for product teams6 parts · 147 min read0/6 read
- Web application security9 parts · 168 min read0/9 read