The deepest open-source React & Next.js engineering resource on GitHub.
Built for engineers who want to understand how and why, not just what.
This is not a tutorial.
This is not a "getting started" guide.
This is not surface-level documentation.
This is a deep engineering handbook — 125 documents across 27 parts, built around:
- 🔬 React internals and runtime behavior (Fiber, reconciliation, concurrent rendering)
- ⚙️ Next.js architecture (App Router, RSC, streaming, four-layer caching)
- 🧠 How browsers actually render your UI
- 🚀 Production performance engineering (profiling, memoization, virtualization)
- 🏗️ Scalable frontend architecture (monorepo, micro-frontends, design systems)
- 🔒 Security engineering (XSS/CSP, CSRF, supply chain, security headers)
- 🔍 Real-world debugging workflows (React DevTools, Node.js inspector, memory leaks)
- 📐 Anti-patterns, testing, and 6 production-grade real-world projects
If you have ever asked:
- "Why does my component re-render so often?"
- "What actually happens after I call
setState?" - "How does Next.js generate HTML on the server?"
- "What is React Fiber and why does it matter?"
- "How does hydration work and why does it break?"
- "What are Next.js's four caching layers and how do they interact?"
- "How do I scale a React app to 10 million users?"
...then this handbook was written for you.
| Audience | What You Will Get |
|---|---|
| Intermediate frontend developers | Deep understanding of React internals beyond docs |
| Senior React engineers | Architecture patterns, scaling strategies, performance systems |
| Next.js engineers | Full App Router internals, RSC, streaming, caching |
| Self-taught developers | Structured university-level progression |
| Senior/Staff interview candidates | Every deep-dive topic interviewers actually ask |
| Production engineers | Real-world debugging, profiling, architecture decisions |
- 01 · What React Actually Is
- 02 · JSX Transformation & Runtime
- 03 · Virtual DOM Deep Dive
- 04 · Component Architecture
- 05 · Unidirectional Data Flow
- 06 · The Render Phase
- 07 · The Commit Phase
- 08 · The React Scheduler
- 09 · Batching & Update Queues
- 10 · Effects: Layout vs Passive
- 11 · Why Fiber Exists
- 12 · Fiber Node Structure
- 13 · Fiber Tree Traversal
- 14 · Interruptible Rendering
- 15 · Time Slicing
- 16 · The Diffing Algorithm
- 17 · Element Identity & Keys
- 18 · Child Reconciliation
- 19 · DOM Reuse Strategies
- 20 · useState Internals
- 21 · useEffect Internals
- 22 · useMemo & useCallback
- 23 · useRef Behavior
- 24 · useReducer & useContext
- 25 · Custom Hook Architecture
- 26 · What Causes Re-renders
- 27 · Reference Equality & Object Identity
- 28 · Context Re-render Propagation
- 29 · Re-render Optimization Patterns
- 30 · Concurrent Rendering Model
- 31 · startTransition & useTransition
- 32 · useDeferredValue
- 33 · Suspense Internals
- 34 · Scheduling Priorities & Lanes
- 38 · What is Next.js
- 39 · App Router Architecture
- 40 · Pages Router Architecture
- 41 · File System Routing
- 42 · Middleware & Edge Runtime
- 43 · Data Fetching Patterns
- 44 · Image & Font Optimization
- 45 · Turbopack Architecture
- 46 · Server Actions Deep Dive
- 47 · Parallel & Intercepting Routes
- 48 · What Are React Server Components
- 49 · Server vs Client Components
- 50 · Streaming & Suspense with RSC
- 51 · RSC Patterns
- 52 · RSC Composition
- 53 · Hydration Strategies
- 54 · Static Site Generation
- 55 · Server-Side Rendering
- 56 · Incremental Static Regeneration
- 57 · Client-Side Rendering Boundaries
- 58 · Rendering Strategies Comparison
- 59 · Edge Rendering
- 60 · Browser Caching
- 61 · CDN & Edge Caching
- 62 · Request Memoization
- 63 · Data Cache
- 64 · Full Route Cache
- 65 · Router Cache
- 66 · Cache Invalidation Strategies
Covered in Part IX docs 45–47 above (Turbopack, Server Actions, Parallel Routes)
- 68 · React Profiler & Flamegraphs
- 69 · Memoization Engineering
- 70 · Virtualization & Windowing
- 71 · Code Splitting & Lazy Loading
- 72 · Bundle Optimization
- 73 · Large List Rendering
- 74 · requestAnimationFrame & requestIdleCallback
- 75 · Context API Internals
- 76 · Redux Architecture
- 77 · Zustand Internals
- 78 · TanStack Query Internals
- 79 · Server State vs Client State
- 80 · Optimistic Updates
- 81 · AST Transformations & Babel
- 82 · SWC Architecture
- 83 · Webpack Internals
- 84 · Vite Internals
- 85 · Tree Shaking & Module Graphs
- 86 · ESM vs CJS
- 87 · HTTP Versions (HTTP/1.1, HTTP/2, HTTP/3)
- 88 · Streaming Responses
- 89 · WebSocket & Server-Sent Events
- 90 · Rendering Waterfalls
- 91 · Backend for Frontend (BFF) Pattern
- 92 · Feature-Based Architecture
- 93 · Atomic Design
- 94 · Monorepo Engineering
- 95 · Micro-Frontends
- 96 · State Machines in UI
- 100 · XSS & Content Security Policy
- 101 · CSRF & Authentication Patterns
- 102 · Dependency & Supply Chain Security
- 103 · Security Headers
- 104 · Unit Testing with React Testing Library
- 105 · Integration Testing with MSW
- 106 · E2E Testing with Playwright
- 107 · Performance Testing
- 108 · Debugging React Applications
- 109 · Debugging Next.js
- 110 · Error Boundaries & Monitoring
- 111 · Performance Debugging
- 112 · Common React Anti-Patterns
- 113 · State Management Anti-Patterns
- 114 · Performance Anti-Patterns
- 115 · React Internals Interview Questions
- 116 · Next.js Interview Questions
- 117 · Frontend System Design
- 118 · Behavioral & Architecture Questions
- P1 · E-Commerce Platform
- P2 · Analytics Dashboard
- P3 · Multi-Tenant SaaS Application
- P4 · Real-Time Chat Application
- P5 · CMS & Blog Platform
- P6 · AI-Powered Application
graph TD
A[Your React Code] --> B[React Runtime]
B --> C[Fiber Reconciler]
C --> D{Render Phase\npure computation}
D --> E[Build Work-in-Progress Tree]
E --> F[Reconcile: Diff Trees]
F --> G{Commit Phase\nuninterruptible}
G --> H[DOM Mutations]
G --> I[useLayoutEffect]
G --> J[useEffect async]
H --> K[Browser]
K --> L[Style Recalculation]
L --> M[Layout]
M --> N[Paint]
N --> O[Composite → Screen]
style A fill:#61dafb,color:#000
style B fill:#764abc,color:#fff
style C fill:#764abc,color:#fff
style D fill:#27ae60,color:#fff
style G fill:#e8491d,color:#fff
style O fill:#27ae60,color:#fff
"My component re-renders too often"
→ What Causes Re-renders → Memoization Engineering → Performance Anti-Patterns
"My Next.js page shows stale data"
→ Cache Invalidation Strategies → Debugging Next.js → Data Cache
"I don't understand hydration errors"
→ Hydration Strategies → Debugging React → Debugging Next.js
"I need to choose a rendering strategy"
→ Rendering Strategies Comparison → Next.js Caching Systems → P1 E-Commerce ADRs
"My application is slow"
→ Performance Debugging → React Profiler → Bundle Optimization
"I need to architect a large React application"
→ Feature-Based Architecture → State Management Deep Dive → Monorepo Engineering
"Preparing for a senior React interview"
→ React Internals Questions → Next.js Questions → Frontend System Design
"I want to understand Next.js App Router deeply"
→ App Router Architecture → React Server Components → Next.js Caching Systems
Read every part in order. Build deep, interconnected mental models. Takes 3–6 months at a comfortable pace. Start at Part I and follow the numbering. Use the Learning Roadmap for structured weekly plans.
Jump to the section that solves your current engineering challenge. Use the Quick Navigation above. Cross-references within each document point you to related concepts.
Focus on Parts I–VIII (React internals), Parts IX–XII (Next.js core + caching), Part XV (performance), and Part XXV (interview prep). The system design section has worked examples at the depth expected at senior/staff level.
Focus on Part IX (Next.js), Part XVI (state management), Part XIX (architecture patterns), Part XXI (security), and Part XXVI (real-world projects). The ADRs in each project document are the most valuable architectural learning artifacts.
Start with the Learning Roadmap which has structured tracks by experience level (Junior → Mid, Mid → Senior, Senior → Staff) with weekly plans and capstone exercises.
Throughout this handbook you will see these markers:
🔬 Internals — Explains how something works inside React/Next.js source code
⚠️ Anti-Pattern — A dangerous or inefficient pattern to avoid
✅ Good Practice — A recommended, production-safe pattern
🧪 Exercise — A hands-on challenge to solidify understanding
📊 Profiling — A performance measurement example
🏭 Production Note — An insight from real production systems
💡 Mental Model — A conceptual framework to simplify understanding
react-nextjs-engineering-handbook/
├── README.md ← You are here
├── CONTRIBUTING.md
└── docs/
├── react-core/ ← Parts I: What React is
├── react-rendering/ ← Parts II & VI: Render/commit phases, re-rendering
├── react-fiber/ ← Part III: Fiber architecture internals
├── reconciliation/ ← Part IV: Diffing, keys, DOM reuse
├── hooks-internals/ ← Part V: Every hook, deeply explained
├── concurrent-react/ ← Part VII: Transitions, Suspense, scheduling
├── react-compiler/ ← Part VIII: Compiler & future React
├── nextjs-core/ ← Parts IX & XIII: App Router, middleware, Server Actions
├── server-components/ ← Part X: RSC, server/client boundary, streaming
├── nextjs-rendering/ ← Part XI: Hydration, SSG/SSR/ISR/CSR, Edge rendering
├── caching/ ← Part XII: All 4 Next.js cache layers
├── browser-internals/ ← Part XIV: Browser rendering pipeline
├── performance/ ← Part XV: Profiling, memoization, virtualization
├── state-management/ ← Part XVI: Context, Redux, Zustand, TanStack Query
├── build-systems/ ← Part XVII: Webpack, Vite, SWC, Turbopack
├── networking/ ← Part XVIII: HTTP, streaming, WebSocket, BFF
├── architecture/ ← Part XIX: Feature arch, monorepo, micro-frontends
├── design-systems/ ← Part XX: Tokens, component API, accessibility
├── security/ ← Part XXI: XSS/CSP, CSRF, dependency, headers
├── testing/ ← Part XXII: Unit, integration, E2E, performance
├── debugging/ ← Part XXIII: React, Next.js, error boundaries, perf
├── anti-patterns/ ← Part XXIV: Common, state, performance anti-patterns
├── interview-prep/ ← Part XXV: React, Next.js, system design, behavioral
├── real-world-projects/ ← Part XXVI: 6 production project breakdowns
└── roadmap/ ← Part XXVII: Learning roadmap & synthesis exercises
125 documents · 27 parts · MIT License
This handbook grows through community engineering expertise.
See CONTRIBUTING.md for guidelines.
All contributions must meet the quality bar:
- Deep technical accuracy (explain why, not just what)
- Mental model section in every document
- Good/bad practice examples with explanation
- Common misconceptions addressed
- Cross-references to related handbook sections
MIT — Free to use, share, and build upon.
If this helped you, please ⭐ the repository.
Built for engineers by engineers.
Inspired by the complexity of real production systems.
Committed to the belief that understanding internals makes better engineers.