# squidowl/halloy architecture

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

- Interactive diagram: https://gitdiagram.com/squidowl/halloy
- Repository: https://github.com/squidowl/halloy

## Overview

##### Main Components Identification

The system should be divided into these major components:

a) Core Components:
- IRC Protocol Handler (irc/proto directory)
- Data Management Layer (data directory)
- IPC System (ipc directory)
- User Interface (src directory)

b) Supporting Components:
- Configuration Management
- Audio System
- File Transfer System
- Theme Engine
- Notification System

##### Component Relationships

**[User Interface Layer]**
- ↑↓
**[Event Management System]**
- ↑↓
**[Data Management Layer] ←→ [Configuration System]**
- ↑↓                        ↑
**[IRC Protocol Handler] ←→ [IPC System]**
- ↑↓
**[Network Layer]**

##### Specific Implementation Details

- Rectangles: Core modules
- Rounded rectangles: Supporting services
- Hexagons: External interfaces

- Blue: UI components
- Green: Data management
- Red: Network/IRC components
- Yellow: Supporting services

##### Key Architectural Elements to Highlight

a) Frontend Layer:
- Dashboard UI (src/screen/dashboard)
- Buffer Management (src/buffer)
- Theme System (src/appearance)
- Widget System (src/widget)

b) Core Layer:
- IRC Protocol Implementation (irc/proto)
- Data Management (data/src)
- Event System (src/event.rs)

c) Backend Services:
- File Transfer System (data/src/file_transfer)
- Configuration Management (data/src/config)
- History Management (data/src/history)

##### Data Flow Indicators

- → Synchronous calls
- ⇢ Asynchronous operations
- ⟷ Bidirectional communication

##### External Integration Points

Connections to:
- IRC Servers
- File System (for configuration and logs)
- Operating System (for notifications)
- Audio System (for sound effects)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI["User Interface Layer"]
        Dashboard["Dashboard UI"]:::ui
        Widgets["Widget System"]:::ui
        BufferViews["Buffer Views"]:::ui
        ThemeUI["Theme UI"]:::ui
    end

    subgraph Core["Core Layer"]
        EventSystem["Event Management"]:::core
        DataMgmt["Data Management"]:::core
        IRCProto["IRC Protocol Handler"]:::core
        IPCSystem["IPC System"]:::core
    end

    subgraph Services["Supporting Services"]
        ThemeEngine["Theme Engine"]:::service
        FileTransfer["File Transfer System"]:::service
        AudioSystem["Audio System"]:::service
        NotifSystem["Notification System"]:::service
        ConfigMgmt["Configuration Management"]:::service
    end

    subgraph External["External Systems"]
        IRCServers["IRC Servers"]:::external
        FileSystem["File System"]:::external
        OS["Operating System"]:::external
    end

    %% Core Relationships
    Dashboard <--> EventSystem
    Widgets <--> EventSystem
    BufferViews <--> EventSystem
    ThemeUI <--> EventSystem
    
    EventSystem <--> DataMgmt
    DataMgmt <--> IRCProto
    IRCProto <--> IPCSystem
    
    %% Service Relationships
    DataMgmt <--> ConfigMgmt
    DataMgmt <--> FileTransfer
    DataMgmt <--> ThemeEngine
    
    %% External Relationships
    IRCProto <--> IRCServers
    ConfigMgmt <--> FileSystem
    NotifSystem <--> OS
    AudioSystem <--> OS

    %% Click Events
    click Dashboard "https://github.com/squidowl/halloy/tree/main/src/screen/dashboard"
    click BufferViews "https://github.com/squidowl/halloy/tree/main/src/buffer"
    click Widgets "https://github.com/squidowl/halloy/tree/main/src/widget"
    click ThemeUI "https://github.com/squidowl/halloy/tree/main/src/appearance/theme"
    click IRCProto "https://github.com/squidowl/halloy/tree/main/irc/proto/src"
    click DataMgmt "https://github.com/squidowl/halloy/tree/main/data/src"
    click IPCSystem "https://github.com/squidowl/halloy/tree/main/ipc/src"
    click ThemeEngine "https://github.com/squidowl/halloy/blob/main/data/src/appearance/theme.rs"
    click FileTransfer "https://github.com/squidowl/halloy/blob/main/data/src/file_transfer/manager.rs"
    click AudioSystem "https://github.com/squidowl/halloy/blob/main/data/src/audio.rs"
    click NotifSystem "https://github.com/squidowl/halloy/tree/main/src/notification"
    click ConfigMgmt "https://github.com/squidowl/halloy/tree/main/data/src/config"

    %% Styling
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef service fill:#f1c40f,stroke:#f39c12,color:black
    classDef external fill:#e74c3c,stroke:#c0392b,color:white

    %% Legend
    subgraph Legend
        UI_L["UI Component"]:::ui
        Core_L["Core Component"]:::core
        Service_L["Service"]:::service
        External_L["External System"]:::external
    end
```
