# usamaabdulkader/dockyard architecture

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

- Interactive diagram: https://gitdiagram.com/usamaabdulkader/dockyard
- Repository: https://github.com/usamaabdulkader/dockyard

## Overview

Dockyard accepts Docker artifact or image inputs in its dashboard, queues selected analyses, runs them in a background worker, stores graded results, and streams status updates back to connected browsers. The graph also preserves the separate linting, Compose validation, base-image advice, image-size, security, history, and live-stats capabilities documented in the README. Runtime wiring is grounded in the supplied Flask, worker, and tool excerpts; some capability details and proxy routing come from the README and tree rather than sampled implementation.

Main entry points: [`app/app.py`](https://github.com/usamaabdulkader/dockyard/blob/main/app/app.py) (Flask API and Socket.IO), [`app/tools/__init__.py`](https://github.com/usamaabdulkader/dockyard/blob/main/app/tools/__init__.py) (Tool dispatcher), [`app/static/js/dashboard.js`](https://github.com/usamaabdulkader/dockyard/blob/main/app/static/js/dashboard.js) (Browser dashboard), [`app/redis_keys.py`](https://github.com/usamaabdulkader/dockyard/blob/main/app/redis_keys.py) (Redis queue and state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_browser["Browser dashboard<br/>[dashboard.js]"]
  node_template["Dashboard template<br/>[index.html]"]
  node_webapp["Flask API and Socket.IO<br/>[app.py]"]
end

subgraph group_jobs["Scan processing"]
  node_worker["Scan worker<br/>[scanner.py]"]
end

subgraph group_analysis["Analysis tools"]
  node_toolregistry["Tool dispatcher<br/>[__init__.py]"]
  node_linter["Dockerfile linter<br/>[linter.py]"]
  node_compose["Compose validator<br/>[compose.py]"]
  node_baseimage["Base image advisor<br/>[image.py]"]
  node_imagesize["Image size analyzer<br/>[image_size.py]"]
  node_security["Security scanner<br/>[security.py]"]
end

subgraph group_services["Runtime services"]
  node_nginx["Nginx proxy<br/>[nginx.conf]"]
  node_redis[("Redis queue and state<br/>[redis_keys.py]")]
end

node_developer(("Developer"))
node_dockerdaemon["Docker daemon"]
node_hadolint["Hadolint"]
node_trivy["Trivy"]
node_registry["Container registries"]

node_developer -->|"uses"| node_browser
node_browser -->|"sends requests"| node_nginx
node_nginx -->|"proxies traffic"| node_webapp
node_webapp -->|"renders dashboard"| node_template
node_browser -->|"submits scans"| node_webapp
node_webapp -->|"queues and stores"| node_redis
node_webapp -->|"emits pending updates"| node_browser
node_browser -->|"fetches history and stats"| node_webapp
node_webapp -->|"reads history and stats"| node_redis
node_worker -->|"dequeues jobs"| node_redis
node_worker -->|"dispatches tool"| node_toolregistry
node_toolregistry -->|"runs lint"| node_linter
node_toolregistry -->|"validates compose"| node_compose
node_toolregistry -->|"advises image"| node_baseimage
node_toolregistry -->|"analyzes size"| node_imagesize
node_toolregistry -->|"scans image"| node_security
node_linter -.->|"invokes when available"| node_hadolint
node_compose -.->|"validates with CLI"| node_dockerdaemon
node_imagesize -->|"inspects image"| node_dockerdaemon
node_security -->|"scans image"| node_trivy
node_baseimage -->|"fetches tag metadata"| node_registry
node_worker -->|"writes results and publishes events"| node_redis
node_webapp -->|"listens for events"| node_redis
node_webapp -->|"pushes scan updates"| node_browser

click node_browser "https://github.com/usamaabdulkader/dockyard/blob/main/app/static/js/dashboard.js"
click node_template "https://github.com/usamaabdulkader/dockyard/blob/main/app/templates/index.html"
click node_nginx "https://github.com/usamaabdulkader/dockyard/blob/main/nginx/nginx.conf"
click node_webapp "https://github.com/usamaabdulkader/dockyard/blob/main/app/app.py"
click node_worker "https://github.com/usamaabdulkader/dockyard/blob/main/app/scanner.py"
click node_toolregistry "https://github.com/usamaabdulkader/dockyard/blob/main/app/tools/__init__.py"
click node_linter "https://github.com/usamaabdulkader/dockyard/blob/main/app/tools/linter.py"
click node_compose "https://github.com/usamaabdulkader/dockyard/blob/main/app/tools/compose.py"
click node_baseimage "https://github.com/usamaabdulkader/dockyard/blob/main/app/tools/image.py"
click node_imagesize "https://github.com/usamaabdulkader/dockyard/blob/main/app/tools/image_size.py"
click node_security "https://github.com/usamaabdulkader/dockyard/blob/main/app/tools/security.py"
click node_redis "https://github.com/usamaabdulkader/dockyard/blob/main/app/redis_keys.py"

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_browser,node_template,node_webapp toneBlue
class node_worker toneAmber
class node_toolregistry,node_linter,node_compose,node_baseimage,node_imagesize,node_security toneMint
class node_nginx,node_redis toneRose
class node_developer,node_dockerdaemon,node_hadolint,node_trivy,node_registry toneIndigo
```

## Components

### Web experience

- [Browser dashboard](https://github.com/usamaabdulkader/dockyard/blob/main/app/static/js/dashboard.js): `app/static/js/dashboard.js`
- [Dashboard template](https://github.com/usamaabdulkader/dockyard/blob/main/app/templates/index.html): `app/templates/index.html`
- [Flask API and Socket.IO](https://github.com/usamaabdulkader/dockyard/blob/main/app/app.py): `app/app.py`

### Scan processing

- [Scan worker](https://github.com/usamaabdulkader/dockyard/blob/main/app/scanner.py): `app/scanner.py`

### Analysis tools

- [Tool dispatcher](https://github.com/usamaabdulkader/dockyard/blob/main/app/tools/__init__.py): `app/tools/__init__.py`
- [Dockerfile linter](https://github.com/usamaabdulkader/dockyard/blob/main/app/tools/linter.py): `app/tools/linter.py`
- [Compose validator](https://github.com/usamaabdulkader/dockyard/blob/main/app/tools/compose.py): `app/tools/compose.py`
- [Base image advisor](https://github.com/usamaabdulkader/dockyard/blob/main/app/tools/image.py): `app/tools/image.py`
- [Image size analyzer](https://github.com/usamaabdulkader/dockyard/blob/main/app/tools/image_size.py): `app/tools/image_size.py`
- [Security scanner](https://github.com/usamaabdulkader/dockyard/blob/main/app/tools/security.py): `app/tools/security.py`

### Runtime services

- [Nginx proxy](https://github.com/usamaabdulkader/dockyard/blob/main/nginx/nginx.conf): `nginx/nginx.conf`
- [Redis queue and state](https://github.com/usamaabdulkader/dockyard/blob/main/app/redis_keys.py): `app/redis_keys.py`

### Other components

- **Developer**
- **Docker daemon**
- **Hadolint**
- **Trivy**
- **Container registries**

## Connections

- Developer → Browser dashboard: uses
- Browser dashboard → Nginx proxy: sends requests
- Nginx proxy → Flask API and Socket.IO: proxies traffic
- Flask API and Socket.IO → Dashboard template: renders dashboard
- Browser dashboard → Flask API and Socket.IO: submits scans
- Flask API and Socket.IO → Redis queue and state: queues and stores
- Flask API and Socket.IO → Browser dashboard: emits pending updates
- Browser dashboard → Flask API and Socket.IO: fetches history and stats
- Flask API and Socket.IO → Redis queue and state: reads history and stats
- Scan worker → Redis queue and state: dequeues jobs
- Scan worker → Tool dispatcher: dispatches tool
- Tool dispatcher → Dockerfile linter: runs lint
- Tool dispatcher → Compose validator: validates compose
- Tool dispatcher → Base image advisor: advises image
- Tool dispatcher → Image size analyzer: analyzes size
- Tool dispatcher → Security scanner: scans image
- Dockerfile linter → Hadolint: invokes when available
- Compose validator → Docker daemon: validates with CLI
- Image size analyzer → Docker daemon: inspects image
- Security scanner → Trivy: scans image
- Base image advisor → Container registries: fetches tag metadata
- Scan worker → Redis queue and state: writes results and publishes events
- Flask API and Socket.IO → Redis queue and state: listens for events
- Flask API and Socket.IO → Browser dashboard: pushes scan updates
