# unhanded/enzo architecture

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

- Interactive diagram: https://gitdiagram.com/unhanded/enzo
- Repository: https://github.com/unhanded/enzo

## Overview

##### Main Components Identification

The system appears to be structured as a CLI tool with a client-server architecture. The key components to represent are:

a) Client Side (cmd/enzo):
- Main CLI interface
- Command handlers

b) Server Side (app/enzod):
- Daemon service
- Core processing logic

c) Core Components (internal/):
- Configuration management
- Network operations
- Item management
- Probing system
- Application logic

Use the following visual elements:

- Rectangles: Main components (Client, Server, Core Services)
- Hexagons: Command operations
- Rounded rectangles: Utility services

b) Connections:
- Double lines: API communications

- Blue: Client-side components
- Green: Server-side components
- Yellow: Core services
- Gray: Utility services
- Red: Critical paths or operations

##### Component Relationships

Key interactions:

a) Client-Server Communication:
- CLI (enzo) → Server (enzod)
- Command processing flow
- Response handling

b) Internal Operations:
- Configuration management flow
- Network operations
- Item management
- Probe system interactions

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        CLI["CLI Interface"]:::client
        CLI --> Commands
        
        subgraph Commands
            direction TB
            Apply["Apply Command"]:::command
            Delete["Delete Command"]:::command
            Get["Get Command"]:::command
            ProbeCmd["Probe Command"]:::command
        end
    end

    subgraph Server
        Daemon["Server Daemon"]:::server
        CoreServices["Core Services"]
        
        subgraph CoreServices
            Network["Network Operations"]:::core
            ItemMgmt["Item Management"]:::core
            Report["Reporting System"]:::core
        end
    end

    subgraph Infrastructure
        Config["Configuration Management"]:::infra
        
        subgraph Utils["Utility Services"]
            Marshal["Data Marshalling"]:::util
            Transmit["Transmission Handling"]:::util
        end
        
        subgraph Files["Configuration Files"]
            NodeConfig[".node.enzo files"]:::file
            ItemConfig[".item.enzo files"]:::file
        end
    end

    subgraph ProbeSystem["Probe System"]
        ProbeLogic["Probe Logic"]:::probe
        HealthCheck["Health Checks"]:::probe
    end

    %% Connections
    CLI --> Daemon
    Commands --> CoreServices
    CoreServices --> Utils
    CoreServices --> Config
    ProbeCmd --> ProbeSystem
    ProbeSystem --> Network
    Config --> Files

    %% Click Events
    click CLI "https://github.com/unhanded/enzo/blob/main/cmd/enzo/main.go"
    click Daemon "https://github.com/unhanded/enzo/blob/main/app/enzod/main.go"
    click Config "https://github.com/unhanded/enzo/blob/main/internal/cfg/config.go"
    click Network "https://github.com/unhanded/enzo/blob/main/internal/core/network.go"
    click ItemMgmt "https://github.com/unhanded/enzo/blob/main/internal/core/item.go"
    click Report "https://github.com/unhanded/enzo/blob/main/internal/core/reporting.go"
    click Apply "https://github.com/unhanded/enzo/blob/main/internal/apply/main.go"
    click Delete "https://github.com/unhanded/enzo/blob/main/internal/del/main.go"
    click Get "https://github.com/unhanded/enzo/blob/main/internal/get/main.go"
    click ProbeCmd "https://github.com/unhanded/enzo/blob/main/internal/probe/main.go"
    click ProbeLogic "https://github.com/unhanded/enzo/blob/main/internal/probe/main.go"
    click HealthCheck "https://github.com/unhanded/enzo/blob/main/internal/probe/checks.go"
    click Marshal "https://github.com/unhanded/enzo/blob/main/internal/utils/marshalling.go"
    click Transmit "https://github.com/unhanded/enzo/blob/main/internal/utils/transmit.go"
    click NodeConfig "https://github.com/unhanded/enzo/tree/main/enzofiles"
    click ItemConfig "https://github.com/unhanded/enzo/tree/main/enzofiles"

    %% Styles
    classDef client fill:#2374ab
    classDef server fill:#2a9d8f
    classDef core fill:#e9c46a
    classDef command fill:#f4a261
    classDef infra fill:#8d99ae
    classDef util fill:#bbb
    classDef probe fill:#e76f51
    classDef file fill:#ddd

    %% Legend
    subgraph Legend
        L1["Client Component"]:::client
        L2["Server Component"]:::server
        L3["Core Service"]:::core
        L4["Command"]:::command
        L5["Infrastructure"]:::infra
        L6["Utility"]:::util
        L7["Probe System"]:::probe
        L8["Configuration File"]:::file
    end
```
