Web Products That Scale Without a Rewrite
Architecture patterns for React and Next.js that survive real traffic, real teams, and the feature requests that follow launch.

01
What architecture survives real growth?
Modular domains with explicit API boundaries, typed contracts, and observability hooks from the first production deploy.
Monoliths are fine until boundaries blur. I structure React/Next apps so new features land in isolated modules with shared design tokens and testable services. A `features/` or domain-based folder structure beats a flat `components/` dump once you have more than one engineer touching the codebase.
02
How should you split frontend and backend concerns?
Server components and route handlers for data fetching; client components only where interactivity demands it — with shared types between API and UI.
In Next.js App Router, default to server rendering for dashboards and marketing pages. Push client boundaries down the tree. On the API side, version endpoints when mobile clients depend on them. Document breaking changes. Teams that skip typed contracts spend their second year fixing silent integration bugs.
03
When should you invest in performance?
Before marketing spend — measure LCP, API p95, and error rates when traffic is still small so fixes are cheap.
Caching, image strategy, and database indexes are product decisions. Slow dashboards kill B2B trust as fast as consumer churn. Add performance budgets in CI: bundle size limits, Lighthouse thresholds on critical routes. Fixing a 4s page load at 100 users is a afternoon; at 10,000 users it is a quarter.
04
What database and API patterns avoid rewrites?
Normalize what must stay consistent; denormalize read paths that users hit constantly — with migrations treated as first-class releases.
Avoid N+1 queries in list views. Use pagination and cursor-based APIs from day one. Background jobs for email, exports, and webhooks — never block the request thread. I set up migration workflows and staging data early so schema changes do not become scary Friday deploys.
05
How do you onboard the second engineer without chaos?
Shared conventions: lint rules, PR templates, feature flags, and a written architecture note that fits on one page.
Scaling teams fail when every developer invents a new pattern. Establish how you name things, where tests live, and how features get toggled off in production. A senior product engineer documents this as they build — not as a post-launch cleanup task.