# 12zhan/huxerui architecture

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

- Interactive diagram: https://gitdiagram.com/12zhan/huxerui
- Repository: https://github.com/12zhan/huxerui

## Overview

HuxerUI is a declarative C++ UI framework: application code creates a root view, the shared runtime composes and lays it out, and a platform backend connects it to native windowing and rendering. The runtime also supports input, navigation, animation, text editing, accessibility, resources, and platform services. The graph preserves these documented capabilities and the sampled runtime/resource/text/backend layers. Some feature implementations and platform adapters were not sampled; their placement follows the repository tree, and documented links cite the README.

Main entry points: [`src/runtime/runtime.cpp`](https://github.com/12zhan/huxerui/blob/main/src/runtime/runtime.cpp) (Composition Runtime), [`src/application/app.cpp`](https://github.com/12zhan/huxerui/blob/main/src/application/app.cpp) (Application API), [`platform`](https://github.com/12zhan/huxerui/tree/main/platform) (Native Platform Hosts), [`src/graphics/paint.cpp`](https://github.com/12zhan/huxerui/blob/main/src/graphics/paint.cpp) (Paint and Geometry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app_api["Application API<br/>[app.cpp]"]
  node_window["Window Lifecycle<br/>[window.cpp]"]
end

subgraph group_runtime["UI Runtime"]
  node_runtime_core["Composition Runtime<br/>[runtime.cpp]"]
  node_components["UI Components"]
  node_layout["Responsive Layout<br/>[layout.cpp]"]
  node_input["Input and Gestures<br/>[gesture.cpp]"]
  node_navigation["Navigation<br/>[navigation.cpp]"]
  node_animation["Animation<br/>[animation.cpp]"]
  node_semantics["Accessibility Semantics<br/>[semantics.cpp]"]
  node_text["Text Editing<br/>[text_input.cpp]"]
end

subgraph group_graphics["Graphics and Resources"]
  node_paint["Paint and Geometry<br/>[paint.cpp]"]
  node_resources["App Resources<br/>[resource.cpp]"]
end

subgraph group_services["Platform Services"]
  node_files["File Services<br/>[file.cpp]"]
  node_http["HTTP Services<br/>[http.cpp]"]
  node_system["System Services"]
end

subgraph group_backends["Platform Backends"]
  node_platform_adapter["Platform Adapter<br/>[app.cpp]"]
  node_android_accessibility["Android Accessibility"]
  node_android_view["Android View Host<br/>[HuxerUIView.java]"]
  node_windows_renderer["Windows Renderer<br/>[win32_renderer.cpp]"]
  node_linux_renderer["Linux Renderer<br/>[linux_renderer.cpp]"]
  node_web_renderer["Web Renderer<br/>[web_renderer.cpp]"]
  node_platform_hosts["Native Platform Hosts"]
end

node_developer(("Application Code"))

node_developer -->|"defines root"| node_app_api
node_app_api -->|"starts runtime"| node_runtime_core
node_runtime_core -->|"composes views"| node_components
node_runtime_core -->|"supports layout"| node_layout
node_runtime_core -->|"handles input"| node_input
node_runtime_core -->|"supports navigation"| node_navigation
node_runtime_core -->|"supports animation"| node_animation
node_runtime_core -->|"provides semantics"| node_semantics
node_runtime_core -->|"supports text editing"| node_text
node_runtime_core -->|"uses resources"| node_resources
node_runtime_core -->|"uses text internals"| node_text
node_runtime_core -->|"uses platform services"| node_platform_adapter
node_runtime_core -->|"uses window state"| node_window
node_runtime_core -->|"produces rendered UI"| node_paint
node_paint -.->|"uses visual assets"| node_resources
node_app_api -->|"registers platform"| node_platform_adapter
node_platform_adapter -->|"connects host services"| node_platform_hosts
node_platform_hosts -->|"renders on Windows"| node_windows_renderer
node_platform_hosts -->|"renders on Linux"| node_linux_renderer
node_platform_hosts -->|"renders on Web"| node_web_renderer
node_platform_hosts -->|"hosts Android UI"| node_android_view
node_android_view -->|"uses accessibility provider"| node_android_accessibility
node_windows_renderer -->|"reads paint internals"| node_paint
node_windows_renderer -->|"reads resource internals"| node_resources
node_linux_renderer -->|"reads paint internals"| node_paint
node_linux_renderer -->|"reads resource internals"| node_resources
node_web_renderer -->|"reads paint internals"| node_paint
node_web_renderer -->|"reads resource internals"| node_resources
node_app_api -->|"offers file access"| node_files
node_app_api -->|"offers HTTP access"| node_http
node_app_api -->|"offers system integration"| node_system

click node_app_api "https://github.com/12zhan/huxerui/blob/main/src/application/app.cpp"
click node_window "https://github.com/12zhan/huxerui/blob/main/src/application/window.cpp"
click node_runtime_core "https://github.com/12zhan/huxerui/blob/main/src/runtime/runtime.cpp"
click node_components "https://github.com/12zhan/huxerui/tree/main/src/components"
click node_layout "https://github.com/12zhan/huxerui/blob/main/src/runtime/layout.cpp"
click node_input "https://github.com/12zhan/huxerui/blob/main/src/runtime/gesture.cpp"
click node_navigation "https://github.com/12zhan/huxerui/blob/main/src/components/navigation.cpp"
click node_animation "https://github.com/12zhan/huxerui/blob/main/src/runtime/animation.cpp"
click node_semantics "https://github.com/12zhan/huxerui/blob/main/src/runtime/semantics.cpp"
click node_text "https://github.com/12zhan/huxerui/blob/main/src/text/text_input.cpp"
click node_paint "https://github.com/12zhan/huxerui/blob/main/src/graphics/paint.cpp"
click node_resources "https://github.com/12zhan/huxerui/blob/main/src/resources/resource.cpp"
click node_files "https://github.com/12zhan/huxerui/blob/main/src/io/file.cpp"
click node_http "https://github.com/12zhan/huxerui/blob/main/src/io/http.cpp"
click node_system "https://github.com/12zhan/huxerui/blob/main/src/application/system_tray_internal.h"
click node_platform_adapter "https://github.com/12zhan/huxerui/blob/main/src/application/app.cpp"
click node_android_accessibility "https://github.com/12zhan/huxerui/blob/main/platform/android/huxerui/src/main/java/org/huxerui/HuxerUIAccessibilityProvider.java"
click node_android_view "https://github.com/12zhan/huxerui/blob/main/platform/android/huxerui/src/main/java/org/huxerui/HuxerUIView.java"
click node_windows_renderer "https://github.com/12zhan/huxerui/blob/main/platform/windows/win32_renderer.cpp"
click node_linux_renderer "https://github.com/12zhan/huxerui/blob/main/platform/linux/linux_renderer.cpp"
click node_web_renderer "https://github.com/12zhan/huxerui/blob/main/platform/web/web_renderer.cpp"
click node_platform_hosts "https://github.com/12zhan/huxerui/tree/main/platform"

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_app_api,node_window toneBlue
class node_runtime_core,node_components,node_layout,node_input,node_navigation,node_animation,node_semantics,node_text toneAmber
class node_paint,node_resources toneMint
class node_files,node_http,node_system toneRose
class node_platform_adapter,node_android_accessibility,node_android_view,node_windows_renderer,node_linux_renderer,node_web_renderer,node_platform_hosts,node_developer toneIndigo
```

## Components

### Application

- [Application API](https://github.com/12zhan/huxerui/blob/main/src/application/app.cpp): `src/application/app.cpp`
- [Window Lifecycle](https://github.com/12zhan/huxerui/blob/main/src/application/window.cpp): `src/application/window.cpp`

### UI Runtime

- [Composition Runtime](https://github.com/12zhan/huxerui/blob/main/src/runtime/runtime.cpp): `src/runtime/runtime.cpp`
- [UI Components](https://github.com/12zhan/huxerui/tree/main/src/components): `src/components`
- [Responsive Layout](https://github.com/12zhan/huxerui/blob/main/src/runtime/layout.cpp): `src/runtime/layout.cpp`
- [Input and Gestures](https://github.com/12zhan/huxerui/blob/main/src/runtime/gesture.cpp): `src/runtime/gesture.cpp`
- [Navigation](https://github.com/12zhan/huxerui/blob/main/src/components/navigation.cpp): `src/components/navigation.cpp`
- [Animation](https://github.com/12zhan/huxerui/blob/main/src/runtime/animation.cpp): `src/runtime/animation.cpp`
- [Accessibility Semantics](https://github.com/12zhan/huxerui/blob/main/src/runtime/semantics.cpp): `src/runtime/semantics.cpp`
- [Text Editing](https://github.com/12zhan/huxerui/blob/main/src/text/text_input.cpp): `src/text/text_input.cpp`

### Graphics and Resources

- [Paint and Geometry](https://github.com/12zhan/huxerui/blob/main/src/graphics/paint.cpp): `src/graphics/paint.cpp`
- [App Resources](https://github.com/12zhan/huxerui/blob/main/src/resources/resource.cpp): `src/resources/resource.cpp`

### Platform Services

- [File Services](https://github.com/12zhan/huxerui/blob/main/src/io/file.cpp): `src/io/file.cpp`
- [HTTP Services](https://github.com/12zhan/huxerui/blob/main/src/io/http.cpp): `src/io/http.cpp`
- [System Services](https://github.com/12zhan/huxerui/blob/main/src/application/system_tray_internal.h): `src/application/system_tray_internal.h`

### Platform Backends

- [Platform Adapter](https://github.com/12zhan/huxerui/blob/main/src/application/app.cpp): `src/application/app.cpp`
- [Android Accessibility](https://github.com/12zhan/huxerui/blob/main/platform/android/huxerui/src/main/java/org/huxerui/HuxerUIAccessibilityProvider.java): `platform/android/huxerui/src/main/java/org/huxerui/HuxerUIAccessibilityProvider.java`
- [Android View Host](https://github.com/12zhan/huxerui/blob/main/platform/android/huxerui/src/main/java/org/huxerui/HuxerUIView.java): `platform/android/huxerui/src/main/java/org/huxerui/HuxerUIView.java`
- [Windows Renderer](https://github.com/12zhan/huxerui/blob/main/platform/windows/win32_renderer.cpp): `platform/windows/win32_renderer.cpp`
- [Linux Renderer](https://github.com/12zhan/huxerui/blob/main/platform/linux/linux_renderer.cpp): `platform/linux/linux_renderer.cpp`
- [Web Renderer](https://github.com/12zhan/huxerui/blob/main/platform/web/web_renderer.cpp): `platform/web/web_renderer.cpp`
- [Native Platform Hosts](https://github.com/12zhan/huxerui/tree/main/platform): `platform`

### Other components

- **Application Code**

## Connections

- Application Code → Application API: defines root (evidence: `README.md`)
- Application API → Composition Runtime: starts runtime (evidence: `README.md`)
- Composition Runtime → UI Components: composes views (evidence: `README.md`)
- Composition Runtime → Responsive Layout: supports layout (evidence: `README.md`)
- Composition Runtime → Input and Gestures: handles input (evidence: `README.md`)
- Composition Runtime → Navigation: supports navigation (evidence: `README.md`)
- Composition Runtime → Animation: supports animation (evidence: `README.md`)
- Composition Runtime → Accessibility Semantics: provides semantics (evidence: `README.md`)
- Composition Runtime → Text Editing: supports text editing (evidence: `README.md`)
- Composition Runtime → App Resources: uses resources (evidence: `src/runtime/runtime.cpp`)
- Composition Runtime → Text Editing: uses text internals (evidence: `src/runtime/runtime.cpp`)
- Composition Runtime → Platform Adapter: uses platform services (evidence: `src/runtime/runtime.cpp`)
- Composition Runtime → Window Lifecycle: uses window state (evidence: `src/runtime/runtime.cpp`)
- Composition Runtime → Paint and Geometry: produces rendered UI (evidence: `README.md`)
- Paint and Geometry → App Resources: uses visual assets
- Application API → Platform Adapter: registers platform (evidence: `src/application/app.cpp`)
- Platform Adapter → Native Platform Hosts: connects host services (evidence: `README.md`)
- Native Platform Hosts → Windows Renderer: renders on Windows (evidence: `README.md`)
- Native Platform Hosts → Linux Renderer: renders on Linux (evidence: `README.md`)
- Native Platform Hosts → Web Renderer: renders on Web (evidence: `README.md`)
- Native Platform Hosts → Android View Host: hosts Android UI (evidence: `README.md`)
- Android View Host → Android Accessibility: uses accessibility provider (evidence: `platform/android/huxerui/src/main/java/org/huxerui/HuxerUIView.java`)
- Windows Renderer → Paint and Geometry: reads paint internals (evidence: `platform/windows/win32_renderer.cpp`)
- Windows Renderer → App Resources: reads resource internals (evidence: `platform/windows/win32_renderer.cpp`)
- Linux Renderer → Paint and Geometry: reads paint internals (evidence: `platform/linux/linux_renderer.cpp`)
- Linux Renderer → App Resources: reads resource internals (evidence: `platform/linux/linux_renderer.cpp`)
- Web Renderer → Paint and Geometry: reads paint internals (evidence: `platform/web/web_renderer.cpp`)
- Web Renderer → App Resources: reads resource internals (evidence: `platform/web/web_renderer.cpp`)
- Application API → File Services: offers file access (evidence: `README.md`)
- Application API → HTTP Services: offers HTTP access (evidence: `README.md`)
- Application API → System Services: offers system integration (evidence: `README.md`)
