# amir20/dozzle architecture

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

- Interactive diagram: https://gitdiagram.com/amir20/dozzle
- Repository: https://github.com/amir20/dozzle

## Overview

Dozzle is a live container-monitoring application: users connect to its web interface, select containers or hosts, and view streaming logs and resource statistics without searching a retained log archive. Its runtime gathers data through Docker-compatible, Kubernetes, Swarm, and remote-agent services; the web layer also exposes search, actions, authentication, and related APIs. Notifications and cloud/MCP integrations extend monitoring beyond interactive viewing. The map uses documented capabilities and the sampled entry points; several handler-to-service details are inferred from the product structure, so uncertain internal links are omitted.

Main entry points: [`internal/hostservice/multi_host.go`](https://github.com/amir20/dozzle/blob/master/internal/hostservice/multi_host.go) (Host Routing), [`internal/web/routes.go`](https://github.com/amir20/dozzle/blob/master/internal/web/routes.go) (Web API), [`internal/container/docker/service.go`](https://github.com/amir20/dozzle/blob/master/internal/container/docker/service.go) (Docker Runtime), [`internal/container/k8s/service.go`](https://github.com/amir20/dozzle/blob/master/internal/container/k8s/service.go) (Kubernetes Runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Web Interface"]
  node_web["Web API<br/>[routes.go]"]
  node_logsearch["Log Search<br/>[search.go]"]
  node_websse["Live Streams<br/>[sse.go]"]
end

subgraph group_collection["Host Collection"]
  node_hostsvc["Host Routing<br/>[multi_host.go]"]
  node_retryhosts["Agent Discovery"]
  node_swarmsvc["Swarm Discovery"]
  node_docker["Docker Runtime<br/>[service.go]"]
  node_k8s["Kubernetes Runtime<br/>[service.go]"]
  node_agentserver["Remote Agent<br/>[server.go]"]
  node_containerstate["Container State<br/>[store.go]"]
end

subgraph group_security["Access and State"]
  node_auth["Authentication<br/>[http.go]"]
end

subgraph group_extensions["Monitoring Extensions"]
  node_notifications["Notification Manager<br/>[manager.go]"]
  node_webhook["Webhook Dispatch<br/>[webhook.go]"]
  node_cloud["Cloud Services<br/>[client.go]"]
  node_mcp["MCP Tools<br/>[server.go]"]
end

node_user(("Operator"))
node_engine[("Container Engine")]
node_kubernetes[("Kubernetes API")]
node_browser(("Web Browser"))
node_webhooktarget(("Webhook Endpoint"))

node_user -->|"uses"| node_browser
node_browser -->|"requests"| node_web
node_web -->|"authorizes"| node_auth
node_web -->|"queries hosts"| node_hostsvc
node_web -->|"searches logs"| node_logsearch
node_web -->|"streams results"| node_websse
node_hostsvc -->|"routes requests"| node_docker
node_hostsvc -->|"routes requests"| node_k8s
node_hostsvc -->|"manages agents"| node_retryhosts
node_hostsvc -->|"discovers peers"| node_swarmsvc
node_docker -->|"reads logs and stats"| node_engine
node_k8s -->|"reads pod data"| node_kubernetes
node_retryhosts -->|"connects agents"| node_agentserver
node_swarmsvc -->|"connects peers"| node_agentserver
node_docker -->|"updates state"| node_containerstate
node_k8s -->|"updates state"| node_containerstate
node_notifications -->|"dispatches alerts"| node_webhook
node_webhook -->|"sends notification"| node_webhooktarget
node_cloud -.->|"requests host data"| node_hostsvc
node_mcp -.->|"queries containers"| node_hostsvc

click node_web "https://github.com/amir20/dozzle/blob/master/internal/web/routes.go"
click node_logsearch "https://github.com/amir20/dozzle/blob/master/internal/web/search/search.go"
click node_websse "https://github.com/amir20/dozzle/blob/master/internal/web/sse/sse.go"
click node_hostsvc "https://github.com/amir20/dozzle/blob/master/internal/hostservice/multi_host.go"
click node_retryhosts "https://github.com/amir20/dozzle/blob/master/internal/hostservice/retriable_client_manager.go"
click node_swarmsvc "https://github.com/amir20/dozzle/blob/master/internal/hostservice/swarm_client_manager.go"
click node_docker "https://github.com/amir20/dozzle/blob/master/internal/container/docker/service.go"
click node_k8s "https://github.com/amir20/dozzle/blob/master/internal/container/k8s/service.go"
click node_agentserver "https://github.com/amir20/dozzle/blob/master/internal/container/agent/server.go"
click node_auth "https://github.com/amir20/dozzle/blob/master/internal/auth/http.go"
click node_containerstate "https://github.com/amir20/dozzle/blob/master/internal/container/store.go"
click node_notifications "https://github.com/amir20/dozzle/blob/master/internal/notification/manager.go"
click node_webhook "https://github.com/amir20/dozzle/blob/master/internal/notification/dispatcher/webhook.go"
click node_cloud "https://github.com/amir20/dozzle/blob/master/internal/cloud/client.go"
click node_mcp "https://github.com/amir20/dozzle/blob/master/internal/mcp/server.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web,node_logsearch,node_websse,node_browser toneBlue
class node_hostsvc,node_retryhosts,node_swarmsvc,node_docker,node_k8s,node_agentserver,node_containerstate,node_engine,node_kubernetes toneAmber
class node_auth,node_webhooktarget toneMint
class node_notifications,node_webhook,node_cloud,node_mcp toneRose
class node_user toneIndigo
```

## Components

### Web Interface

- [Web API](https://github.com/amir20/dozzle/blob/master/internal/web/routes.go): `internal/web/routes.go`
- [Log Search](https://github.com/amir20/dozzle/blob/master/internal/web/search/search.go): `internal/web/search/search.go`
- [Live Streams](https://github.com/amir20/dozzle/blob/master/internal/web/sse/sse.go): `internal/web/sse/sse.go`

### Host Collection

- [Host Routing](https://github.com/amir20/dozzle/blob/master/internal/hostservice/multi_host.go): `internal/hostservice/multi_host.go`
- [Agent Discovery](https://github.com/amir20/dozzle/blob/master/internal/hostservice/retriable_client_manager.go): `internal/hostservice/retriable_client_manager.go`
- [Swarm Discovery](https://github.com/amir20/dozzle/blob/master/internal/hostservice/swarm_client_manager.go): `internal/hostservice/swarm_client_manager.go`
- [Docker Runtime](https://github.com/amir20/dozzle/blob/master/internal/container/docker/service.go): `internal/container/docker/service.go`
- [Kubernetes Runtime](https://github.com/amir20/dozzle/blob/master/internal/container/k8s/service.go): `internal/container/k8s/service.go`
- [Remote Agent](https://github.com/amir20/dozzle/blob/master/internal/container/agent/server.go): `internal/container/agent/server.go`
- [Container State](https://github.com/amir20/dozzle/blob/master/internal/container/store.go): `internal/container/store.go`

### Access and State

- [Authentication](https://github.com/amir20/dozzle/blob/master/internal/auth/http.go): `internal/auth/http.go`

### Monitoring Extensions

- [Notification Manager](https://github.com/amir20/dozzle/blob/master/internal/notification/manager.go): `internal/notification/manager.go`
- [Webhook Dispatch](https://github.com/amir20/dozzle/blob/master/internal/notification/dispatcher/webhook.go): `internal/notification/dispatcher/webhook.go`
- [Cloud Services](https://github.com/amir20/dozzle/blob/master/internal/cloud/client.go): `internal/cloud/client.go`
- [MCP Tools](https://github.com/amir20/dozzle/blob/master/internal/mcp/server.go): `internal/mcp/server.go`

### Other components

- **Operator**
- **Container Engine**
- **Kubernetes API**
- **Web Browser**
- **Webhook Endpoint**

## Connections

- Operator → Web Browser: uses
- Web Browser → Web API: requests
- Web API → Authentication: authorizes
- Web API → Host Routing: queries hosts
- Web API → Log Search: searches logs
- Web API → Live Streams: streams results
- Host Routing → Docker Runtime: routes requests
- Host Routing → Kubernetes Runtime: routes requests
- Host Routing → Agent Discovery: manages agents
- Host Routing → Swarm Discovery: discovers peers
- Docker Runtime → Container Engine: reads logs and stats
- Kubernetes Runtime → Kubernetes API: reads pod data
- Agent Discovery → Remote Agent: connects agents
- Swarm Discovery → Remote Agent: connects peers
- Docker Runtime → Container State: updates state
- Kubernetes Runtime → Container State: updates state
- Notification Manager → Webhook Dispatch: dispatches alerts
- Webhook Dispatch → Webhook Endpoint: sends notification
- Cloud Services → Host Routing: requests host data
- MCP Tools → Host Routing: queries containers
