# beyaz/reactwithdotnet architecture

> Architecture diagram of the GitHub repository beyaz/reactwithdotnet, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/beyaz/reactwithdotnet
- Repository: https://github.com/beyaz/reactwithdotnet

## Overview

ReactWithDotNet is a .NET framework for building React applications in C#. A request enters the server-side handler, which establishes component context and renders a component tree; the framework serializes that tree for the JavaScript client, which reconstructs and manages the UI and sends interactions back to .NET. The repository also includes styling and component abstractions, bindings for numerous React libraries, and a UI designer with a component preview. The graph follows relationships visible in excerpts, the source index, or the README; unsampled implementation details are not inferred.

Main entry points: [`ReactWithDotNet/ComponentRequestHandler.cs`](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/ComponentRequestHandler.cs) (Request Handler), [`ReactWithDotNet/Component.cs`](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/Component.cs) (Stateful Components), [`ReactWithDotNet/UIDesigner/ReactWithDotNetDesignerComponentPreview.cs`](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/UIDesigner/ReactWithDotNetDesignerComponentPreview.cs) (Component Preview), [`ReactWithDotNet/Element.cs`](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/Element.cs) (Element Tree)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Server Rendering"]
  node_handler["Request Handler"]
  node_context["Request Context<br/>[ReactContext.cs]"]
  node_serializer["Element Serializer"]
  node_type_serialization["Type Serialization<br/>[TypeSerializer.cs]"]
end

subgraph group_core["Component Core"]
  node_component["Stateful Components<br/>[Component.cs]"]
  node_pure_component["Pure Components<br/>[PureComponent.cs]"]
  node_element["Element Tree<br/>[Element.cs]"]
  node_html["HTML Elements<br/>[HtmlElement.cs]"]
  node_modifiers["Modifiers<br/>[Modifier.cs]"]
  node_styles["Styles<br/>[Style.cs]"]
end

subgraph group_client["React Client"]
  node_jsclient["JavaScript Client API<br/>[JsClient.cs]"]
  node_client_runtime["React Runtime"]
  node_client_entry["Client Entry<br/>[index.jsx]"]
end

subgraph group_integrations["React Integrations"]
  node_third_party["Third-Party Components"]
  node_mui["MUI Bindings"]
  node_prime["PrimeReact Bindings"]
end

subgraph group_designer["UI Designer"]
  node_designer["Designer"]
  node_preview["Component Preview"]
  node_designer_model["Designer Model"]
  node_state_cache["Designer State Cache<br/>[StateCache.cs]"]
end

node_http(("HTTP Request"))

node_http -->|"sends request"| node_handler
node_handler -->|"uses context"| node_context
node_handler -->|"initializes components"| node_component
node_handler -->|"handles instances"| node_pure_component
node_handler -->|"serializes elements"| node_serializer
node_handler -->|"serializes values"| node_type_serialization
node_component -->|"reads context"| node_context
node_component -->|"renders elements"| node_element
node_component -->|"uses styles"| node_styles
node_pure_component -->|"renders elements"| node_element
node_element -->|"holds styles"| node_styles
node_element -->|"applies modifiers"| node_modifiers
node_modifiers -->|"modifies elements"| node_html
node_modifiers -->|"modifies components"| node_third_party
node_client_entry -->|"loads runtime"| node_client_runtime
node_jsclient -->|"invokes client"| node_client_runtime
node_client_runtime -->|"resolves components"| node_third_party
node_client_entry -->|"loads bindings"| node_mui
node_client_entry -->|"loads bindings"| node_prime
node_designer -->|"creates preview"| node_preview
node_designer -->|"updates model"| node_designer_model
node_designer -->|"persists state"| node_state_cache
node_preview -->|"reads model"| node_designer_model
node_preview -->|"loads state"| node_state_cache
node_preview -->|"renders preview"| node_component

click node_handler "https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/ComponentRequestHandler.cs"
click node_context "https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/ReactContext.cs"
click node_serializer "https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/ElementSerializer.cs"
click node_type_serialization "https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/TypeSerializer.cs"
click node_component "https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/Component.cs"
click node_pure_component "https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/PureComponent.cs"
click node_element "https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/Element.cs"
click node_html "https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/HtmlElement.cs"
click node_modifiers "https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/Modifier.cs"
click node_styles "https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/Style.cs"
click node_jsclient "https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/JsClient.cs"
click node_client_runtime "https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/JsClientEngine/react-with-dotnet/react-with-dotnet.jsx"
click node_client_entry "https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/JsClientEngine/index.jsx"
click node_third_party "https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/ThirdPartyReactComponent.cs"
click node_mui "https://github.com/beyaz/reactwithdotnet/tree/main/ReactWithDotNet/ThirdPartyLibraries/MUI/Material"
click node_prime "https://github.com/beyaz/reactwithdotnet/tree/main/ReactWithDotNet/ThirdPartyLibraries/PrimeReact"
click node_designer "https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/UIDesigner/ReactWithDotNetDesigner.cs"
click node_preview "https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/UIDesigner/ReactWithDotNetDesignerComponentPreview.cs"
click node_designer_model "https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/UIDesigner/ReactWithDotNetDesignerModel.cs"
click node_state_cache "https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/UIDesigner/StateCache.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_handler,node_context,node_serializer,node_type_serialization toneBlue
class node_component,node_pure_component,node_element,node_html,node_modifiers,node_styles toneAmber
class node_jsclient,node_client_runtime,node_client_entry,node_http toneMint
class node_third_party,node_mui,node_prime toneRose
class node_designer,node_preview,node_designer_model,node_state_cache toneIndigo
```

## Components

### Server Rendering

- [Request Handler](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/ComponentRequestHandler.cs): `ReactWithDotNet/ComponentRequestHandler.cs`
- [Request Context](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/ReactContext.cs): `ReactWithDotNet/ReactContext.cs`
- [Element Serializer](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/ElementSerializer.cs): `ReactWithDotNet/ElementSerializer.cs`
- [Type Serialization](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/TypeSerializer.cs): `ReactWithDotNet/TypeSerializer.cs`

### Component Core

- [Stateful Components](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/Component.cs): `ReactWithDotNet/Component.cs`
- [Pure Components](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/PureComponent.cs): `ReactWithDotNet/PureComponent.cs`
- [Element Tree](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/Element.cs): `ReactWithDotNet/Element.cs`
- [HTML Elements](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/HtmlElement.cs): `ReactWithDotNet/HtmlElement.cs`
- [Modifiers](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/Modifier.cs): `ReactWithDotNet/Modifier.cs`
- [Styles](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/Style.cs): `ReactWithDotNet/Style.cs`

### React Client

- [JavaScript Client API](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/JsClient.cs): `ReactWithDotNet/JsClient.cs`
- [React Runtime](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/JsClientEngine/react-with-dotnet/react-with-dotnet.jsx): `ReactWithDotNet/JsClientEngine/react-with-dotnet/react-with-dotnet.jsx`
- [Client Entry](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/JsClientEngine/index.jsx): `ReactWithDotNet/JsClientEngine/index.jsx`

### React Integrations

- [Third-Party Components](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/ThirdPartyReactComponent.cs): `ReactWithDotNet/ThirdPartyReactComponent.cs`
- [MUI Bindings](https://github.com/beyaz/reactwithdotnet/tree/main/ReactWithDotNet/ThirdPartyLibraries/MUI/Material): `ReactWithDotNet/ThirdPartyLibraries/MUI/Material`
- [PrimeReact Bindings](https://github.com/beyaz/reactwithdotnet/tree/main/ReactWithDotNet/ThirdPartyLibraries/PrimeReact): `ReactWithDotNet/ThirdPartyLibraries/PrimeReact`

### UI Designer

- [Designer](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/UIDesigner/ReactWithDotNetDesigner.cs): `ReactWithDotNet/UIDesigner/ReactWithDotNetDesigner.cs`
- [Component Preview](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/UIDesigner/ReactWithDotNetDesignerComponentPreview.cs): `ReactWithDotNet/UIDesigner/ReactWithDotNetDesignerComponentPreview.cs`
- [Designer Model](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/UIDesigner/ReactWithDotNetDesignerModel.cs): `ReactWithDotNet/UIDesigner/ReactWithDotNetDesignerModel.cs`
- [Designer State Cache](https://github.com/beyaz/reactwithdotnet/blob/main/ReactWithDotNet/UIDesigner/StateCache.cs): `ReactWithDotNet/UIDesigner/StateCache.cs`

### Other components

- **HTTP Request**

## Connections

- HTTP Request → Request Handler: sends request (evidence: `ReactWithDotNet/ComponentRequestHandler.cs`)
- Request Handler → Request Context: uses context (evidence: `ReactWithDotNet/ComponentRequestHandler.cs`)
- Request Handler → Stateful Components: initializes components (evidence: `ReactWithDotNet/ComponentRequestHandler.cs`)
- Request Handler → Pure Components: handles instances (evidence: `ReactWithDotNet/ComponentRequestHandler.cs`)
- Request Handler → Element Serializer: serializes elements (evidence: `ReactWithDotNet/ComponentRequestHandler.cs`)
- Request Handler → Type Serialization: serializes values (evidence: `ReactWithDotNet/ComponentRequestHandler.cs`)
- Stateful Components → Request Context: reads context (evidence: `ReactWithDotNet/Component.cs`)
- Stateful Components → Element Tree: renders elements (evidence: `ReactWithDotNet/Component.cs`)
- Stateful Components → Styles: uses styles (evidence: `ReactWithDotNet/Component.cs`)
- Pure Components → Element Tree: renders elements (evidence: `ReactWithDotNet/PureComponent.cs`)
- Element Tree → Styles: holds styles (evidence: `ReactWithDotNet/Element.cs`)
- Element Tree → Modifiers: applies modifiers (evidence: `ReactWithDotNet/Element.cs`)
- Modifiers → HTML Elements: modifies elements (evidence: `ReactWithDotNet/Modifier.cs`)
- Modifiers → Third-Party Components: modifies components (evidence: `ReactWithDotNet/Modifier.cs`)
- Client Entry → React Runtime: loads runtime (evidence: `ReactWithDotNet/JsClientEngine/index.jsx`)
- JavaScript Client API → React Runtime: invokes client (evidence: `ReactWithDotNet/JsClient.cs`)
- React Runtime → Third-Party Components: resolves components (evidence: `ReactWithDotNet/JsClientEngine/react-with-dotnet/react-with-dotnet.jsx`)
- Client Entry → MUI Bindings: loads bindings (evidence: `ReactWithDotNet/JsClientEngine/index.jsx`)
- Client Entry → PrimeReact Bindings: loads bindings (evidence: `ReactWithDotNet/JsClientEngine/index.jsx`)
- Designer → Component Preview: creates preview (evidence: `ReactWithDotNet/UIDesigner/ReactWithDotNetDesigner.cs`)
- Designer → Designer Model: updates model (evidence: `ReactWithDotNet/UIDesigner/ReactWithDotNetDesigner.cs`)
- Designer → Designer State Cache: persists state (evidence: `ReactWithDotNet/UIDesigner/ReactWithDotNetDesigner.cs`)
- Component Preview → Designer Model: reads model (evidence: `ReactWithDotNet/UIDesigner/ReactWithDotNetDesignerComponentPreview.cs`)
- Component Preview → Designer State Cache: loads state (evidence: `ReactWithDotNet/UIDesigner/ReactWithDotNetDesignerComponentPreview.cs`)
- Component Preview → Stateful Components: renders preview (evidence: `ReactWithDotNet/UIDesigner/ReactWithDotNetDesignerComponentPreview.cs`)
