# neurekadev/docker-manager architecture

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

- Interactive diagram: https://gitdiagram.com/neurekadev/docker-manager
- Repository: https://github.com/neurekadev/docker-manager

## Overview

Docker Manager is a self-hosted web control plane paired with outbound-connected agents that operate Docker Engine on managed servers. The main workflow is browser request → manager API and durable job handling → agent session → Docker operation → job/result surfaced to the browser. The README also documents distinct stacks, file management, updates, backups, migrations, templates, and access-control capabilities. Some subsystem paths and connections come from the tree and README; unsampled implementation details are not asserted.

Main entry points: [`internal/manager/api`](https://github.com/neurekadev/docker-manager/tree/main/internal/manager/api) (HTTP API), [`internal/manager/app/app.go`](https://github.com/neurekadev/docker-manager/blob/main/internal/manager/app/app.go) (Application wiring), [`internal/manager/jobs/engine.go`](https://github.com/neurekadev/docker-manager/blob/main/internal/manager/jobs/engine.go) (Durable jobs), [`internal/manager/agents`](https://github.com/neurekadev/docker-manager/tree/main/internal/manager/agents) (Agent sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_manager["Manager Core"]
  node_manager_entry["Manager process<br/>[main.go]"]
  node_app["Application wiring<br/>[app.go]"]
  node_api["HTTP API"]
  node_jobs["Durable jobs<br/>[engine.go]"]
  node_agents["Agent sessions"]
  node_store[("Manager persistence")]
end

subgraph group_agent["Agent Runtime"]
  node_agent_process["Agent process<br/>[main.go]"]
  node_agent_runtime["Agent runtime<br/>[runtime.go]"]
  node_engine["Docker Engine adapter<br/>[engine.go]"]
end

subgraph group_operations["Operations"]
  node_stacks["Compose stacks"]
  node_files["File management"]
  node_backups["Backup and restore"]
  node_updates["Image updates"]
  node_migrations["Environment migration"]
  node_templates["Stack templates"]
end

subgraph group_web["Web Interface"]
  node_web_ui["Web application<br/>[routes.ts]"]
  node_file_ui["Browser file manager<br/>[FileManager.svelte]"]
  node_backup_ui["Backup interface<br/>[model.ts]"]
end

subgraph group_security["Identity and Access"]
  node_auth["Sign-in and sessions<br/>[service.go]"]
  node_permissions["Authorization<br/>[authz.go]"]
end

node_operator(("Browser operator"))
node_docker["Docker Engine"]

node_operator -->|"uses"| node_web_ui
node_web_ui -.->|"requests"| node_api
node_manager_entry -->|"starts"| node_app
node_app -->|"wires"| node_api
node_app -->|"initializes"| node_agents
node_app -->|"opens"| node_store
node_api -.->|"enqueues"| node_jobs
node_jobs -->|"persists"| node_store
node_jobs -.->|"dispatches"| node_agents
node_agent_process -->|"runs"| node_agent_runtime
node_agent_runtime -.->|"uses"| node_engine
node_engine -->|"controls"| node_docker
node_agents -->|"connects outbound"| node_agent_process
node_api -.->|"serves"| node_stacks
node_api -.->|"serves"| node_files
node_api -->|"serves"| node_backups
node_api -.->|"serves"| node_updates
node_api -->|"serves"| node_migrations
node_api -.->|"serves"| node_templates
node_file_ui -.->|"renders in"| node_web_ui
node_file_ui -->|"calls file routes"| node_api
node_backup_ui -.->|"requests history"| node_api
node_operator -->|"signs in"| node_auth
node_api -.->|"checks access"| node_permissions
node_app -->|"registers resources"| node_permissions

click node_manager_entry "https://github.com/neurekadev/docker-manager/blob/main/cmd/docker-manager/main.go"
click node_app "https://github.com/neurekadev/docker-manager/blob/main/internal/manager/app/app.go"
click node_api "https://github.com/neurekadev/docker-manager/tree/main/internal/manager/api"
click node_jobs "https://github.com/neurekadev/docker-manager/blob/main/internal/manager/jobs/engine.go"
click node_agents "https://github.com/neurekadev/docker-manager/tree/main/internal/manager/agents"
click node_store "https://github.com/neurekadev/docker-manager/tree/main/internal/manager/store"
click node_agent_process "https://github.com/neurekadev/docker-manager/blob/main/cmd/docker-agent/main.go"
click node_agent_runtime "https://github.com/neurekadev/docker-manager/blob/main/internal/agent/runtime/runtime.go"
click node_engine "https://github.com/neurekadev/docker-manager/blob/main/internal/agent/engine/engine.go"
click node_stacks "https://github.com/neurekadev/docker-manager/tree/main/internal/manager/stacks"
click node_files "https://github.com/neurekadev/docker-manager/tree/main/internal/manager/files"
click node_backups "https://github.com/neurekadev/docker-manager/tree/main/internal/manager/backups"
click node_updates "https://github.com/neurekadev/docker-manager/tree/main/internal/manager/updates"
click node_migrations "https://github.com/neurekadev/docker-manager/tree/main/internal/manager/app"
click node_templates "https://github.com/neurekadev/docker-manager/tree/main/internal/manager/templates"
click node_web_ui "https://github.com/neurekadev/docker-manager/blob/main/web/src/lib/routes.ts"
click node_file_ui "https://github.com/neurekadev/docker-manager/blob/main/web/src/lib/features/files/FileManager.svelte"
click node_backup_ui "https://github.com/neurekadev/docker-manager/blob/main/web/src/lib/features/backups/model.ts"
click node_auth "https://github.com/neurekadev/docker-manager/blob/main/internal/manager/auth/service.go"
click node_permissions "https://github.com/neurekadev/docker-manager/blob/main/internal/manager/authz/authz.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_manager_entry,node_app,node_api,node_jobs,node_agents,node_store,node_operator toneBlue
class node_agent_process,node_agent_runtime,node_engine toneAmber
class node_stacks,node_files,node_backups,node_updates,node_migrations,node_templates toneMint
class node_web_ui,node_file_ui,node_backup_ui toneRose
class node_auth,node_permissions,node_docker toneIndigo
```

## Components

### Manager Core

- [Manager process](https://github.com/neurekadev/docker-manager/blob/main/cmd/docker-manager/main.go): `cmd/docker-manager/main.go`
- [Application wiring](https://github.com/neurekadev/docker-manager/blob/main/internal/manager/app/app.go): `internal/manager/app/app.go`
- [HTTP API](https://github.com/neurekadev/docker-manager/tree/main/internal/manager/api): `internal/manager/api`
- [Durable jobs](https://github.com/neurekadev/docker-manager/blob/main/internal/manager/jobs/engine.go): `internal/manager/jobs/engine.go`
- [Agent sessions](https://github.com/neurekadev/docker-manager/tree/main/internal/manager/agents): `internal/manager/agents`
- [Manager persistence](https://github.com/neurekadev/docker-manager/tree/main/internal/manager/store): `internal/manager/store`

### Agent Runtime

- [Agent process](https://github.com/neurekadev/docker-manager/blob/main/cmd/docker-agent/main.go): `cmd/docker-agent/main.go`
- [Agent runtime](https://github.com/neurekadev/docker-manager/blob/main/internal/agent/runtime/runtime.go): `internal/agent/runtime/runtime.go`
- [Docker Engine adapter](https://github.com/neurekadev/docker-manager/blob/main/internal/agent/engine/engine.go): `internal/agent/engine/engine.go`

### Operations

- [Compose stacks](https://github.com/neurekadev/docker-manager/tree/main/internal/manager/stacks): `internal/manager/stacks`
- [File management](https://github.com/neurekadev/docker-manager/tree/main/internal/manager/files): `internal/manager/files`
- [Backup and restore](https://github.com/neurekadev/docker-manager/tree/main/internal/manager/backups): `internal/manager/backups`
- [Image updates](https://github.com/neurekadev/docker-manager/tree/main/internal/manager/updates): `internal/manager/updates`
- [Environment migration](https://github.com/neurekadev/docker-manager/tree/main/internal/manager/app): `internal/manager/app`
- [Stack templates](https://github.com/neurekadev/docker-manager/tree/main/internal/manager/templates): `internal/manager/templates`

### Web Interface

- [Web application](https://github.com/neurekadev/docker-manager/blob/main/web/src/lib/routes.ts): `web/src/lib/routes.ts`
- [Browser file manager](https://github.com/neurekadev/docker-manager/blob/main/web/src/lib/features/files/FileManager.svelte): `web/src/lib/features/files/FileManager.svelte`
- [Backup interface](https://github.com/neurekadev/docker-manager/blob/main/web/src/lib/features/backups/model.ts): `web/src/lib/features/backups/model.ts`

### Identity and Access

- [Sign-in and sessions](https://github.com/neurekadev/docker-manager/blob/main/internal/manager/auth/service.go): `internal/manager/auth/service.go`
- [Authorization](https://github.com/neurekadev/docker-manager/blob/main/internal/manager/authz/authz.go): `internal/manager/authz/authz.go`

### Other components

- **Browser operator**
- **Docker Engine**

## Connections

- Browser operator → Web application: uses
- Web application → HTTP API: requests
- Manager process → Application wiring: starts (evidence: `cmd/docker-manager/main.go`)
- Application wiring → HTTP API: wires (evidence: `internal/manager/app/app.go`)
- Application wiring → Agent sessions: initializes (evidence: `internal/manager/app/app.go`)
- Application wiring → Manager persistence: opens (evidence: `internal/manager/app/app.go`)
- HTTP API → Durable jobs: enqueues
- Durable jobs → Manager persistence: persists (evidence: `internal/manager/jobs/engine.go`)
- Durable jobs → Agent sessions: dispatches
- Agent process → Agent runtime: runs (evidence: `cmd/docker-agent/main.go`)
- Agent runtime → Docker Engine adapter: uses
- Docker Engine adapter → Docker Engine: controls (evidence: `internal/agent/engine/engine.go`)
- Agent sessions → Agent process: connects outbound
- HTTP API → Compose stacks: serves
- HTTP API → File management: serves
- HTTP API → Backup and restore: serves (evidence: `internal/manager/api/backup_storage.go`)
- HTTP API → Image updates: serves
- HTTP API → Environment migration: serves (evidence: `internal/manager/api/managermove.go`)
- HTTP API → Stack templates: serves
- Browser file manager → Web application: renders in
- Browser file manager → HTTP API: calls file routes
- Backup interface → HTTP API: requests history
- Browser operator → Sign-in and sessions: signs in
- HTTP API → Authorization: checks access
- Application wiring → Authorization: registers resources (evidence: `internal/manager/app/app.go`)
