# saviorxtanren/mixer-mixitup architecture

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

- Interactive diagram: https://gitdiagram.com/saviorxtanren/mixer-mixitup
- Repository: https://github.com/saviorxtanren/mixer-mixitup

## Overview

##### Project Type and Purpose
– Mix It Up is a large desktop “one-stop” streaming assistant for Twitch, YouTube, and Trovo. It comprises:
- A core library (MixItUp.Base) implementing actions, commands, services, external platform connectors, data models, and business logic.
- A WPF UI front-end (MixItUp.WPF) that binds to the core via ViewModels and controls.
- Installer/Uninstaller and Reporter desktop apps.
- Plugin extensions for devices (StreamDeck, Loupedeck, AVerMedia).
- . NET API client libraries and a SignalR client for remote control.
- Multiple MixPlay interactive game samples under the MixPlay folder.

##### File‐Structure/Architecture Analysis
– Top‐level solution “mixer-mixitup.sln” contains multiple .NET projects:
- MixItUp.Base: core services, models, event handling, external integrations.
- MixItUp.WPF: UI layer—XAML views, ViewModels, Developer API controllers, in‐process HTTP and SignalR hosts.
- MixItUp.Installer, MixItUp.Uninstaller, MixItUp.Reporter: auxiliary desktop tools.
- MixItUp.SignalR.Client and MixItUp.API.NET8 / MixItUp.API: .NET client libraries wrapping REST and SignalR for remote control.
- MixItUp.*Plugin: device plugin frameworks for StreamDeck, Loupedeck, AVerMedia.
- MixPlay subfolders: static web apps for interactive overlays or mini-games.

##### Key Components
(A) UI Layer
- MixItUp.WPF: WPF Application (XAML Views + ViewModels)
- Reporter, Installer, Uninstaller: standalone WPF/WinForms apps
- MixPlay Web Clients (static JS+HTML)

(B) Core Layer
- MixItUp.Base Library:
– Services (ChatService, CommandService, ExternalServiceManager, etc.)
– Models (Commands, Actions, Currency, Overlay, StreamingPlatform)
– ServiceManager & ServiceBase classes controlling lifecycles
– PluginHost interfaces and plugin loading

(C) API & Remote Control
- Developer API inside WPF (HTTP REST controllers & SignalR hubs)
- MixItUp.API.NET8 / MixItUp.API: REST client wrappers
- MixItUp.SignalR.Client: SignalR-based client

(D) External Integrations
- Streaming Platforms: Twitch, YouTube, Trovo (each with “New” and “API” service submodules)
- Third-party services: IFTTT, Discord, Streamlabs, EleventLabs TTS, Patreon, etc.
- Device Plugins: StreamDeck, Loupedeck, AVerMedia

(E) Data Storage/Local Database
- SettingsTemplateDatabase.db and per-user settings persisted by SettingsService
- Local file storage (logs, overlay resources, plugin configs)

##### Relationships and Data Flows
– UI Layer ↔ Core Layer: ViewModels invoke Core Services; Services raise events for UI updates.
– Core Layer → External Integrations: ServiceManager dispatches chat/events to streaming platform API clients, external webhooks, TTS, etc.
– Core Layer ↔ Data Storage: Services read/write settings & state into local DB via IDatabaseService.
– UI & External Clients ↔ Developer API: External tools or scripts call WPF’s in-process HTTP/SignalR endpoints to issue commands, read state, or automate flows.
– Plugin Hosts ↔ Core Layer: Device plugins load via defined interfaces, call Core services to run commands/actions.

##### Architectural Patterns & Principles
– MVVM (Model-View-ViewModel) in WPF UI
– Service-oriented core with interfaces (IStreamingPlatformService, IExternalService, IServiceBase) and a ServiceManager
– Plugin extensibility via well-defined plugin interfaces (e.g., MixItUpPlugin.cs)
– API layering: HTTP REST + SignalR Hub for remote control, consumed by client libraries

##### Deliverables for the Engineer
– MixItUp.Base service modules
– MixItUp.WPF Developer API controllers
– MixPlay overlay hosting

**Be thorough**: label every sub-system, outline interfaces, specify protocols (REST, SignalR, WebSockets), and capture the extensibility points (plugin interfaces) that define the architecture’s flexibility.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer"
        WPF["MixItUp.WPF (WPF Application)"]:::ui
        Installer["MixItUp.Installer"]:::ui
        Reporter["MixItUp.Reporter"]:::ui
        Uninstaller["MixItUp.Uninstaller"]:::ui
        MixPlay["MixPlay Web Clients (Static JS/HTML)"]:::ui
    end

    %% Core Layer
    subgraph "Core Layer"
        Base["MixItUp.Base (Services, Models, Business Logic)"]:::core
    end

    %% API & Remote Control
    subgraph "API & Remote Control"
        DevAPI["Developer API (HTTP REST & SignalR Hosts)"]:::api
        API1["MixItUp.API (REST Client v1/v2)"]:::api
        API2["MixItUp.API.NET8 (REST Client .NET8)"]:::api
        SignalRClient["MixItUp.SignalR.Client"]:::api
    end

    %% External Integrations
    subgraph "External Integrations"
        Twitch["Twitch Connector (New & API)"]:::ext
        YouTube["YouTube Connector (New & API)"]:::ext
        Trovo["Trovo Connector (New & API)"]:::ext
        ExternalServices["Third-Party Services\n(IFTTT, Discord, Streamlabs, etc.)"]:::ext
    end

    %% Plugins
    subgraph "Device Plugins"
        StreamDeck["StreamDeck Plugin"]:::plugins
        Loupedeck["Loupedeck Plugin"]:::plugins
        AVerMedia["AVerMedia Plugin"]:::plugins
    end

    %% Data Storage
    DataStore["SettingsTemplateDatabase.db\n(Local SQLite DB)"]:::storage

    %% Relationships
    WPF -->|"invokes Core Services"| Base
    Installer -->|"uses Core Library"| Base
    Reporter -->|"uses Core Library"| Base
    Uninstaller -->|"uses Core Library"| Base
    MixPlay -->|"interacts via Developer API"| DevAPI

    Base -->|"hosts HTTP/SignalR"| DevAPI
    DevAPI -->|"calls into Core"| Base

    DevAPI -->|"REST calls"| API1
    DevAPI -->|"REST calls"| API2
    DevAPI -->|"SignalR messages"| SignalRClient

    Base -->|"dispatches events"| Twitch
    Base -->|"dispatches events"| YouTube
    Base -->|"dispatches events"| Trovo
    Base -->|"integrates with"| ExternalServices

    Base -->|"loads via PluginHost"| StreamDeck
    Base -->|"loads via PluginHost"| Loupedeck
    Base -->|"loads via PluginHost"| AVerMedia

    Base -->|"persists settings/state"| DataStore

    %% Click Events
    click WPF "https://github.com/saviorxtanren/mixer-mixitup/tree/master/MixItUp.WPF/"
    click Installer "https://github.com/saviorxtanren/mixer-mixitup/tree/master/MixItUp.Installer/"
    click Reporter "https://github.com/saviorxtanren/mixer-mixitup/tree/master/MixItUp.Reporter/"
    click Uninstaller "https://github.com/saviorxtanren/mixer-mixitup/tree/master/MixItUp.Uninstaller/"
    click Base "https://github.com/saviorxtanren/mixer-mixitup/tree/master/MixItUp.Base/"
    click DevAPI "https://github.com/saviorxtanren/mixer-mixitup/tree/master/MixItUp.WPF/Services/DeveloperAPI/"
    click API1 "https://github.com/saviorxtanren/mixer-mixitup/tree/master/APIs/MixItUp.API/"
    click API2 "https://github.com/saviorxtanren/mixer-mixitup/tree/master/APIs/MixItUp.API.NET8/"
    click SignalRClient "https://github.com/saviorxtanren/mixer-mixitup/tree/master/MixItUp.SignalR.Client/"
    click ExternalServices "https://github.com/saviorxtanren/mixer-mixitup/tree/master/MixItUp.Base/Services/External/"
    click Twitch "https://github.com/saviorxtanren/mixer-mixitup/tree/master/MixItUp.Base/Services/Twitch/API/"
    click Loupedeck "https://github.com/saviorxtanren/mixer-mixitup/tree/master/MixItUp.LoupedeckPlugin/"
    click Loupedeck "https://github.com/saviorxtanren/mixer-mixitup/tree/master/Loupedeck/MixItUp3Plugin/"
    click StreamDeck "https://github.com/saviorxtanren/mixer-mixitup/tree/master/MixItUp.StreamDeckPlugin/"
    click AVerMedia "https://github.com/saviorxtanren/mixer-mixitup/tree/master/AVerMedia/MixItUpPlugin/"
    click DataStore "https://github.com/saviorxtanren/mixer-mixitup/blob/master/MixItUp.Base/SettingsTemplateDatabase.db"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#000000
    classDef core fill:#90EE90,stroke:#000000
    classDef api fill:#D8BFD8,stroke:#000000
    classDef ext fill:#FFA500,stroke:#000000
    classDef plugins fill:#D3D3D3,stroke:#000000
    classDef storage fill:#A9A9A9,stroke:#000000
```
