React is a JavaScript library for building user interfaces, maintained as a monorepo containing core React, DOM renderer, reconciler, server-side rendering (Fizz), React Server Components (Flight), DevTools, and the experimental React Compiler (Forget). The architecture is highly modular with packages for different concerns: react (core), react-dom (browser), react-reconciler (custom renderers), react-server (SSR), react-server-dom-* (RSC bundler integrations), react-devtools-* (developer tools), and compiler (Babel plugin with Rust crates). Key entry points include react/index.js, react-dom/client.js, react-dom/server.js, react-server-dom-webpack/server.node.js, and compiler/packages/babel-plugin-react-compiler/src/index.ts. Data flows: user-written React components are optionally compiled by the React Compiler to optimize memoization, then rendered by the reconciler which produces fiber trees and commits updates to the DOM or other renderers. Server components are rendered on the server and streamed to the client. DevTools hook into the reconciler to inspect component trees and profiling data. External dependencies include Babel (for compilation), Rollup (for bundling), Jest (for testing), and various browser extension APIs for DevTools. The codebase demonstrates exceptional engineering with clean abstractions, extensive test coverage, and a well-structured monorepo pattern.
The Next.js repository is a monorepo containing the Next.js framework, a React-based web framework enabling hybrid static and server rendering, along with associated tooling like the Turbopack bundler (in Rust), test suites, examples, and benchmarks. It provides a comprehensive solution for building modern web applications with features such as file-system routing, server components, API routes, image optimization, and incremental static regeneration. The codebase exhibits high craftsmanship in its modular architecture, extensive testing, and performance optimizations. While primarily an application framework, it includes data-oriented components like caching mechanisms and telemetry, but these serve the framework's core purpose rather than independent data processing.