# marcelpkg/docker-tui architecture

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

- Interactive diagram: https://gitdiagram.com/marcelpkg/docker-tui
- Repository: https://github.com/marcelpkg/docker-tui

## Overview

##### Main Application Components
- TUI Layer (Main Interface)
- Docker API Client Layer
- Docker Engine Integration Layer

##### External Dependencies
- Docker Engine (External System)
- Docker Socket/API

##### Component Relationships
- TUI Layer → Business Logic Layer (Command Flow)
- Business Logic Layer → Docker API Client (Docker Operations)
- Docker API Client → Docker Engine (External Communication)

##### Specific Implementation Details
- Key files/components from the project structure:
- main.go (Entry Point)
- api/docker.go (Docker API Integration)
- api/Dockerfile (Container Definition)

##### Technical Specifications
- Blue: Core application components
- Green: External systems (Docker Engine)
- Gray: Communication paths
- Yellow: Configuration elements

**┌─────────────────────────────────────────┐**
- docker-tui Application       │
- ┤

- ┌─────────────┐                      │
- TUI      │                      │
- Interface  │                      │
- ┬──────┘                      │
- ▼                             │
- ┌─────────────┐                      │
- Docker    │                      │
- Operations  │                      │
- ┬──────┘                      │
- ▼                             │
- ┌─────────────┐     ┌─────────────┐ │
- Docker API │ ──► │   Docker    │ │
- Client    │     │   Engine    │ │
- ┘     └─────────────┘ │

- ┘

##### Important Notes

- Unix socket or TCP connection between the application and Docker Engine
- That this is a local tool running on the same host as Docker Engine
- Error handling paths
- Configuration loading paths

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Docker TUI Application"
        subgraph "Presentation Layer"
            TUI[TUI Interface]:::ui
            click TUI "https://github.com/marcelpkg/docker-tui/blob/main/main.go"
        end

        subgraph "Business Logic Layer"
            DockerOps[Docker Operations]:::business
        end

        subgraph "Integration Layer"
            DockerAPI[Docker API Client]:::integration
            click DockerAPI "https://github.com/marcelpkg/docker-tui/blob/main/api/docker.go"
            DockerTest[Integration Tests]:::test
            click DockerTest "https://github.com/marcelpkg/docker-tui/blob/main/api/docker_test.go"
            Container[Container Definition]:::container
            click Container "https://github.com/marcelpkg/docker-tui/tree/main/api/Dockerfile"
        end
    end

    subgraph "External Systems"
        DockerEngine[Docker Engine]:::external
    end

    %% Connections
    TUI --> DockerOps
    DockerOps --> DockerAPI
    DockerAPI --> DockerEngine
    DockerTest -.-> DockerAPI
    Container -.-> DockerEngine

    %% Styling
    classDef ui fill:#2196F3,stroke:#1565C0,color:white
    classDef business fill:#4CAF50,stroke:#2E7D32,color:white
    classDef integration fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef external fill:#FF9800,stroke:#EF6C00,color:white
    classDef test fill:#795548,stroke:#4E342E,color:white
    classDef container fill:#607D8B,stroke:#37474F,color:white

    %% Legend
    subgraph Legend
        UI[User Interface]:::ui
        BL[Business Logic]:::business
        Int[Integration]:::integration
        Ext[External System]:::external
        Test[Tests]:::test
        Cont[Container]:::container
    end
```
