# errornointernet/errornowatcher architecture

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

- Interactive diagram: https://gitdiagram.com/errornointernet/errornowatcher
- Repository: https://github.com/errornointernet/errornowatcher

## Overview

##### Main Components

a) Core Components:
- Minecraft Bot Core (main.rs)
- Bot Command Handler (bot.rs)
- Matrix Integration (matrix.rs)
- Logging System (logging.rs)

b) External Components:
- Minecraft Server
- Matrix Server (optional, based on configuration)
- Alert System (HTTP endpoints for notifications)

##### Component Relationships

**Top Layer: External Services**
- Minecraft Server
- Matrix Server
- Alert HTTP Endpoints (e.g., ntfy.sh)

**Middle Layer: ErrorNoWatcher Core**
- Main Bot Controller
- Command Handler
- Matrix Integration
- Logging System

**Bottom Layer: Configuration & Storage**
- TOML Configuration

##### Key Features to Highlight

- Player Detection System
- Pathfinding System
- Command Processing
- Alert System
- Script Execution
- Entity Management

##### Data Flow Indicators

- Bidirectional communication with Minecraft server
- Command flow from Matrix server
- Alert notifications to HTTP endpoints
- Configuration data flow to components

##### Specific Implementation Details

- The bot's connection to the Minecraft server using Azalea
- Command input sources (both Minecraft chat and Matrix)
- Alert system workflow (player detection → notification)
- Configuration influence on all components

##### Additional Elements

- Player detection radius
- Pathfinding capabilities
- Block interaction points
- Script execution flow

## Diagram (Mermaid)

```mermaid
graph TB
    %% External Services Layer
    subgraph External
        MC[Minecraft Server]:::external
        MX[Matrix Server]:::external
        HTTP[Alert HTTP Endpoints]:::external
    end

    %% Core Layer
    subgraph Core
        Main[Main Bot Controller]:::core
        click Main "https://github.com/ErrorNoInternet/ErrorNoWatcher/blob/main/src/main.rs"
        CMD[Command Handler]:::command
        click CMD "https://github.com/ErrorNoInternet/ErrorNoWatcher/blob/main/src/bot.rs"
        MTX[Matrix Integration]:::matrix
        click MTX "https://github.com/ErrorNoInternet/ErrorNoWatcher/blob/main/src/matrix.rs"
        LOG[Logging System]:::logging
        click LOG "https://github.com/ErrorNoInternet/ErrorNoWatcher/blob/main/src/logging.rs"
    end

    %% Features Layer
    subgraph Features
        PD[Player Detection]:::feature
        PF[Pathfinding System]:::feature
        CP[Command Processing]:::feature
        AS[Alert System]:::feature
        SE[Script Execution]:::feature
        EM[Entity Management]:::feature
    end

    %% Configuration Layer
    subgraph Config
        TOML[TOML Configuration]:::config
        click TOML "https://github.com/ErrorNoInternet/ErrorNoWatcher/blob/main/.cargo/config.toml"
    end

    %% Relationships
    MC <--> Main
    MX <--> MTX
    MTX --> CMD
    Main --> LOG
    CMD --> LOG
    HTTP <-- AS
    
    Main --> PD
    Main --> PF
    Main --> CP
    Main --> AS
    Main --> SE
    Main --> EM
    
    TOML --> Main
    TOML --> CMD
    TOML --> MTX
    TOML --> LOG

    %% Styles
    classDef external fill:#90EE90,stroke:#333,stroke-width:2px
    classDef core fill:#87CEEB,stroke:#333,stroke-width:2px
    classDef command fill:#FFD700,stroke:#333,stroke-width:2px
    classDef matrix fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef logging fill:#A9A9A9,stroke:#333,stroke-width:2px
    classDef feature fill:#B0C4DE,stroke:#333,stroke-width:2px
    classDef config fill:#D3D3D3,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1[External Services]:::external
        L2[Core Components]:::core
        L3[Command Processing]:::command
        L4[Matrix Integration]:::matrix
        L5[Logging]:::logging
        L6[Features]:::feature
        L7[Configuration]:::config
    end
```
