# falleng0d/remotecontrol-lib architecture

> Architecture diagram of the GitHub repository falleng0d/remotecontrol-lib, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/falleng0d/remotecontrol-lib
- Repository: https://github.com/falleng0d/remotecontrol-lib

## Overview

##### Main Components

a) Core Library Components:
- Input Processing Layer
- Virtual Keys System
- Action Management
- Component System
- Factory System

b) External Interfaces:
- Protocol Buffer Interface
- Client Interface

**┌─ External Interface Layer ─────────────────┐**
- Client Interface                         │
- Protocol Buffer Interface (gRPC)         │
- Core Processing Layer ───────────────────┤
- ┌─ Input Management ─┐ ┌─ Actions ──────┐ │
- Virtual Keys     │ │ - Action Base  │ │
- Keyboard Handler │ │ - Action Tasks │ │
- ┘ └───────────────┘ │
- Component Layer ──────────────────────┤
- Layout Components                     │
- Geometry Handling                     │
- Element Management                    │
- ┘

##### Key Elements to Highlight

- Rectangles: Core modules
- Hexagons: Interface points
- Rounded rectangles: Services

- Blue: Core components
- Green: External interfaces
- Yellow: Processing components
- Gray: Utility services

##### Component Relationships

- Virtual Keys → Action Management
- Protocol Buffer Interface → Input Processing
- Component System → Layout Management
- Factory System → Element Creation

##### Specific Implementation Details

Key architectural patterns:
- Factory Pattern (shown in factory/ directory)
- Mixin-based composition (from mixin/ directory)
- Observer Pattern (indicated by subscribable.dart)
- Protocol Buffer communication layer

##### Technical Stack Indicators

Integration with:
- Dart SDK
- Protocol Buffers
- gRPC services

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph External["External Interface Layer"]
        CI["Client Interface"]:::interface
        PB["Protocol Buffer Interface"]:::interface
    end

    subgraph Core["Core Processing Layer"]
        subgraph Input["Input Processing"]
            VK["Virtual Keys System"]:::core
            KH["Keyboard Handler"]:::core
            IP["Input Processing"]:::core
        end

        subgraph Actions["Action Management"]
            AB["Action Base"]:::core
            AT["Action Tasks"]:::core
        end
    end

    subgraph Components["Component Layer"]
        subgraph Layout["Layout Management"]
            LC["Layout Components"]:::component
            GH["Geometry Handler"]:::component
        end
        
        subgraph Elements["Element System"]
            EM["Element Management"]:::component
            FS["Factory System"]:::component
        end
    end

    subgraph Support["Support Systems"]
        LS["Logging System"]:::support
        MS["Mixin System"]:::support
    end

    %% Relationships
    CI --> VK
    PB --> IP
    IP --> VK
    VK --> AB
    KH --> AT
    AB --> AT
    AT --> EM
    EM --> LC
    FS --> EM
    GH --> LC
    MS --> EM
    LS --> Core
    LS --> Components

    %% Click Events
    click VK "https://github.com/falleng0d/remotecontrol-lib/tree/master/lib/virtualkeys/"
    click AB "https://github.com/falleng0d/remotecontrol-lib/blob/master/lib/actions/action_base.dart"
    click AT "https://github.com/falleng0d/remotecontrol-lib/blob/master/lib/actions/action_task.dart"
    click LC "https://github.com/falleng0d/remotecontrol-lib/blob/master/lib/components/flex_layout.dart"
    click GH "https://github.com/falleng0d/remotecontrol-lib/blob/master/lib/components/geometry.dart"
    click FS "https://github.com/falleng0d/remotecontrol-lib/tree/master/lib/factory/"
    click PB "https://github.com/falleng0d/remotecontrol-lib/tree/master/lib/proto/"
    click CI "https://github.com/falleng0d/remotecontrol-lib/blob/master/lib/client.dart"
    click EM "https://github.com/falleng0d/remotecontrol-lib/tree/master/lib/elements/"
    click LS "https://github.com/falleng0d/remotecontrol-lib/tree/master/lib/logger/"
    click MS "https://github.com/falleng0d/remotecontrol-lib/tree/master/lib/mixin/"
    click IP "https://github.com/falleng0d/remotecontrol-lib/blob/master/lib/virtualkeys/protobuf/parse_key_action.dart"

    %% Styling
    classDef interface fill:#90EE90,stroke:#333,stroke-width:2px
    classDef core fill:#ADD8E6,stroke:#333,stroke-width:2px
    classDef component fill:#FFE4B5,stroke:#333,stroke-width:2px
    classDef support fill:#D3D3D3,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["Interface Components"]:::interface
        L2["Core Components"]:::core
        L3["System Components"]:::component
        L4["Support Systems"]:::support
    end
```
