Draw module boundaries, manage state at scale, and design resilient data fetching, caching, concurrency, and real-time updates.
Follow the suggested order, or jump to any tutorial.
State Architecture and Module BoundariesStart here
Decide who owns each piece of state, separate server state from client state, keep derived data derived, and draw module boundaries so features don't reach into each other's stores.
State Management at Scale
How stores actually work: subscriptions, selectors, and why re-renders explode in large apps. Build an external store, see structural sharing in action, connect it to React with useSyncExternalStore, and learn when Redux, Zustand, Jotai, or XState fits.
API Design for Frontend Consumers
Design API contracts from the consumer's side: validate responses at the boundary, return errors the UI can act on, paginate with cursors, make retries safe with idempotency keys, and evolve without breaking old clients.
Data Fetching and Cache Patterns
Treat server data as a cache, not state: deduplicate requests, serve stale data while revalidating, avoid race conditions, and invalidate after mutations. Then build a small query cache yourself.
useFetch Hook with Retry and Exponential Backoff
Build a data-fetching hook that fails well: a status union instead of booleans, retries only for errors worth retrying, exponential backoff with jitter, Retry-After, cancellation on unmount, and a clear budget for giving up.
Concurrency Handler
Control async work in the browser: limit how many tasks run at once, share one token refresh across many failing requests, choose between Promise.all, allSettled, race, and any, and add timeouts. Then build a concurrency limiter.
Real-Time Updates Using WebSockets
Choose between polling, SSE, and WebSockets, then make real-time updates reliable: reconnect with backoff, resume from the last sequence number, drop duplicates, detect gaps, and batch high-frequency updates so the UI stays smooth.
How Linear Feels Instant: Build a Local-First Sync Engine
Why apps like Linear never show a spinner, and how to build the engine behind it: a local store every read comes from, optimistic transactions, a server that orders every change, deltas and catch-up, an offline outbox with safe retries, field-level conflicts, fractional ordering, and a live two-client demo you can break.
Dates, Times, and Time Zones
Handle time correctly for users everywhere: instants vs calendar dates vs wall times, the classic bugs, formatting with Intl, daylight saving gaps and overlaps, converting wall time in any zone to an instant, relative times, Temporal, storage and API rules, and SSR hydration.