# adospace/reactorui-maui architecture

> Architecture diagram of the GitHub repository adospace/reactorui-maui, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adospace/reactorui-maui
- Repository: https://github.com/adospace/reactorui-maui

## Overview

This project is a UI library—MauiReactor—that builds on top of .NET MAUI using a component-based MVU (Model-View-Update) approach. The file tree and README indicate that its purpose is to allow developers to build cross‐platform UI applications entirely in C#, abstracting away much of the platform-specific details via shared component classes and an MVU pattern.

##### Main Components
- Core MauiReactor Library – This is the heart of the project and includes the base classes (Component, VisualNode, etc.), UI controls (Label, Button, Layouts, etc.), animations, and helper classes. It encapsulates the MVU approach.
- Platform Abstraction Layer – The library supports multiple platforms such as Android, iOS, MacCatalyst, Tizen, and Windows. Each platform folder in both the samples and src sections shows platform-specific implementations (e.g., PlatformClass1.cs files and native manifest/configuration files).
- Hot-Reload Infrastructure – Separate modules (in src/MauiReactor.HotReloadConsole and related components) provide live reloading of code changes, which is a significant part of the developer experience.
- Integration Modules – The project includes modules like MauiReactor.Blazor for integrating Blazor components and possibly other hybrid models, which enable web-based UI rendering within MAUI.
- Code Generation and Scaffolding – Subprojects such as MauiReactor.Scaffold and MauiReactor.TemplatePack provide tooling and templates for generating boilerplate code and scaffolding out new projects.
- Sample Applications – There is a wide variety of sample applications (e.g., Calculator, ChartApp, Test App, WeatherTwentyOne, etc.) that demonstrate different aspects of the library. These also help to define usage patterns and validate how core components interact.

##### Relationships and Data Flow
- The Core Library exposes a set of component classes for constructing the UI. These components rely on the MVU pattern, where state changes trigger re-rendering.
- The Hot-Reload Console communicates with the running application’s code, signaling the core library to update rendered UI based on code changes.
- Sample applications sit on top of the library, consuming core components and platform services through the MVU pattern. They should be shown as client apps that depend on and demonstrate the usage of the library.

##### Architectural Patterns and Design Principles
- MVU Pattern – Illustrate how the “State” flows from component classes and how updates (for example, via event handlers like SetState) trigger a re-render of the UI.
- Component-Based Architecture – Each UI piece (from simple controls to complex pages) is composed as a reusable component.
- Platform Abstraction – The separation between shared code and platform-specific code is emphasized by distinct folders for various platforms.
- Code Generation/Scaffolding – The presence of scaffold generators and templates highlights an emphasis on reducing boilerplate code and keeping UI logic declarative.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Layer
    subgraph "Core Layer"
        A["MauiReactor Core Library"]:::core
        B[".NET MAUI"]:::external
    end

    %% Platform Adapters
    subgraph "Platform Adapters"
        P1["Android Adapter"]:::platform
        P2["iOS Adapter"]:::platform
        P3["MacCatalyst Adapter"]:::platform
        P4["Tizen Adapter"]:::platform
        P5["Windows Adapter"]:::platform
    end

    %% Hot-Reload & Developer Tools
    subgraph "Hot-Reload & Developer Tools"
        D1["Hot-Reload Console"]:::hotreload
        D2["HotReload Runtime"]:::hotreload
    end

    %% Integration Modules
    subgraph "Integration Modules"
        I1["MauiReactor.Blazor"]:::integration
        I2["MauiReactor.Blazor TestApp"]:::integration
    end

    %% Scaffolding & Templates
    subgraph "Scaffolding & Templates"
        S1["Scaffold"]:::scaffold
        S2["Scaffold Generator"]:::scaffold
        S3["Template Pack"]:::scaffold
    end

    %% Sample Applications
    subgraph "Sample Applications"
        SA1["Sample Applications"]:::sample
    end

    %% Connections
    %% Core Library depends on .NET MAUI
    A -->|"depends"| B

    %% Core Library translates UI components to native controls via platform adapters
    A -->|"translates"| P1
    A -->|"translates"| P2
    A -->|"translates"| P3
    A -->|"translates"| P4
    A -->|"translates"| P5

    %% Hot-Reload Infrastructure updates the Core Library
    D1 -->|"reloads"| A
    D1 -->|"manages"| D2

    %% Integration Modules interface with the Core Library
    I1 <-->|"integrates"| A
    I1 -->|"coupledWith"| I2

    %% Scaffolding tools generate project code for the Core Library
    S1 -->|"generates"| A
    S2 -->|"generates"| A
    S3 -->|"templates"| A

    %% Sample Applications consume the Core Library components
    SA1 -->|"consumes"| A

    %% Styles
    classDef core fill:#B3E5FC,stroke:#0288D1,stroke-width:2px;
    classDef platform fill:#FFECB3,stroke:#FFA000,stroke-width:2px;
    classDef hotreload fill:#C8E6C9,stroke:#388E3C,stroke-width:2px;
    classDef integration fill:#D1C4E9,stroke:#7E57C2,stroke-width:2px;
    classDef scaffold fill:#FFCDD2,stroke:#D32F2F,stroke-width:2px;
    classDef sample fill:#F0F4C3,stroke:#827717,stroke-width:2px;
    classDef external fill:#CFD8DC,stroke:#607D8B,stroke-width:2px;

    %% Click Events
    click A "https://github.com/adospace/reactorui-maui/tree/main/src/MauiReactor"
    click P1 "https://github.com/adospace/reactorui-maui/tree/main/src/MauiReactor/Platforms"
    click D1 "https://github.com/adospace/reactorui-maui/blob/main/src/MauiReactor.HotReloadConsole"
    click D2 "https://github.com/adospace/reactorui-maui/tree/main/src/MauiReactor/HotReload"
    click I1 "https://github.com/adospace/reactorui-maui/blob/main/src/MauiReactor.Blazor"
    click I2 "https://github.com/adospace/reactorui-maui/blob/main/src/MauiReactor.Blazor.TestApp"
    click S1 "https://github.com/adospace/reactorui-maui/blob/main/src/MauiReactor.Scaffold"
    click S2 "https://github.com/adospace/reactorui-maui/blob/main/src/MauiReactor.ScaffoldGenerator"
    click S3 "https://github.com/adospace/reactorui-maui/blob/main/src/MauiReactor.TemplatePack"
    click SA1 "https://github.com/adospace/reactorui-maui/tree/main/samples"
```
