# plyght/voxa architecture

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

- Interactive diagram: https://gitdiagram.com/plyght/voxa
- Repository: https://github.com/plyght/voxa

## Overview

##### Main Components

a. Client-Side Components (Primary Layer):
- Inside this container, create the following sub-components:
- UI Layer (SwiftUI)
- ContentView
- DiscordWindowContent
- WebView Component
- Application Core
- DiscordApp (Main App Entry)
- Window Management
- SecondaryWindowController
- Asset Management
- System Resources

b. External Integration Layer:
- Discord API Services
- WebView Bridge
- Native macOS System Integration

##### Component Relationships

- DiscordApp → ContentView (initialization flow)
- ContentView → DiscordWindowContent (UI hierarchy)
- DiscordWindowContent → WebView (content rendering)
- WebView → Discord API Services (external communication)
- SecondaryWindowController → Window Management (window handling)

##### Technical Stack Indicators

- SwiftUI as the primary UI framework
- macOS native APIs
- WebKit integration
- Discord API integration

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph VoxaClient["Voxa macOS Client"]
        subgraph UILayer["UI Layer"]
            CV["ContentView"]:::ui
            DWC["DiscordWindowContent"]:::ui
            WV["WebView Component"]:::ui
        end

        subgraph AppCore["Application Core"]
            DA["DiscordApp"]:::core
            subgraph WM["Window Management"]
                SWC["SecondaryWindowController"]:::core
            end
        end

        subgraph AssetMgmt["Asset Management"]
            SR["System Resources"]:::asset
            AI["App Icons"]:::asset
            CS["Color Sets"]:::asset
        end

        subgraph Config["Configuration"]
            SC["System Configuration"]:::config
            AC["Application Configuration"]:::config
        end
    end

    subgraph External["External Integration Layer"]
        DAS["Discord API Services"]:::external
        WB["WebView Bridge"]:::external
        MSI["Native macOS System Integration"]:::external
    end

    %% Relationships
    DA --> CV
    CV --> DWC
    DWC --> WV
    WV -.-> WB
    WB -.-> DAS
    SWC --> WM
    WV -.-> MSI
    
    %% Click Events
    click CV "https://github.com/plyght/voxa/blob/main/Discord/ContentView.swift"
    click DWC "https://github.com/plyght/voxa/blob/main/Discord/DiscordWindowContent.swift"
    click WV "https://github.com/plyght/voxa/blob/main/Discord/WebView.swift"
    click DA "https://github.com/plyght/voxa/blob/main/Discord/DiscordApp.swift"
    click SWC "https://github.com/plyght/voxa/blob/main/Discord/SecondaryWindowController.swift"
    click AI "https://github.com/plyght/voxa/blob/main/Discord/Assets.xcassets/AppIcon.appiconset"
    click CS "https://github.com/plyght/voxa/blob/main/Discord/Assets.xcassets/AccentColor.colorset"
    click SC "https://github.com/plyght/voxa/blob/main/Discord/Discord.entitlements"
    click AC "https://github.com/plyght/voxa/blob/main/Discord/Info.plist"

    %% Styling
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef asset fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef external fill:#9b59b6,stroke:#8e44ad,color:white
    classDef config fill:#e74c3c,stroke:#c0392b,color:white

    %% Legend
    subgraph Legend
        L1["UI Components"]:::ui
        L2["Core Components"]:::core
        L3["Asset Components"]:::asset
        L4["External Services"]:::external
        L5["Configuration"]:::config
    end
```
