# augustosavi/docker-manager architecture

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

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

## Overview

##### Main Components
- Docker Manager Application: At the center is the Spring Boot application (ManagerApplication.java). This is the entry point that configures and launches the entire backend service.
- Controllers: Two main controllers – DockerContainersController and DockerImagesController – expose RESTful endpoints (with API docs available via Swagger). They receive and process API requests.
- Service Layer: DockerService.java encapsulates business logic for operations such as querying Docker containers and images.
- Configuration Layer: DockerClientConfig.java establishes Docker client settings to communicate with the Docker daemon, ensuring that the application can send commands and receive responses.
- External Docker Service: Not part of the application but integrated externally; the Docker daemon (running on the host) is a critical component.
- API Documentation: Swagger UI and JSON endpoints (documented in the README) provide a self-documenting API interface for users.

##### Relationships and Interactions
- Client/API Requests: User requests (for example via the Swagger UI or other REST clients) hit the exposed endpoints.
- Controllers → Service Layer: Upon receiving a request, controllers delegate the operation to the DockerService.
- Service → Docker Client: The DockerService uses the configuration (from DockerClientConfig) to interact with the external Docker daemon.
- Data Flow: Results and status are returned (via the service, then controller) back to the client.

##### Architectural Patterns and Design Principles
- Layered Architecture: The project clearly separates concerns by using packages for configuration, controllers, and services.
- Well-defined API Interface: By exposing RESTful endpoints and using Swagger for documentation, the design ensures ease-of-use and clear interface boundaries.

##### Technology/Frameworks
- Java, Maven, and Spring Boot: Outline these to indicate that the backend is built robustly using industry-standard frameworks.
- Docker: Given that the application manages Docker entities, indicate the Docker daemon as an external service integrated into the system.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["REST Client / Swagger UI"]:::client
    B["Docker Manager Application (Spring Boot)"]:::app
    subgraph "API Layer"
        C1["DockerContainersController"]:::controller
        C2["DockerImagesController"]:::controller
    end
    D["DockerService"]:::service
    E["DockerClientConfig"]:::config
    F["Docker Daemon"]:::external

    A -->|"sendsAPIRequest"| B
    B -->|"exposesEndpoints"| C1
    B -->|"exposesEndpoints"| C2
    C1 -->|"delegates"| D
    C2 -->|"delegates"| D
    D -->|"usesConfig"| E
    E -->|"communicatesWith"| F

    click B "https://github.com/augustosavi/docker-manager/blob/master/src/main/java/com/docker/manager/ManagerApplication.java"
    click C1 "https://github.com/augustosavi/docker-manager/blob/master/src/main/java/com/docker/manager/controllers/DockerContainersController.java"
    click C2 "https://github.com/augustosavi/docker-manager/blob/master/src/main/java/com/docker/manager/controllers/DockerImagesController.java"
    click D "https://github.com/augustosavi/docker-manager/blob/master/src/main/java/com/docker/manager/services/DockerService.java"
    click E "https://github.com/augustosavi/docker-manager/blob/master/src/main/java/com/docker/manager/config/DockerClientConfig.java"

    classDef client fill:#AED6F1,stroke:#2980B9,stroke-width:2px;
    classDef app fill:#F9E79F,stroke:#D4AC0D,stroke-width:2px;
    classDef controller fill:#FAD7A0,stroke:#D35400,stroke-width:2px;
    classDef service fill:#ABEBC6,stroke:#239B56,stroke-width:2px;
    classDef config fill:#D2B4DE,stroke:#7D3C98,stroke-width:2px;
    classDef external fill:#F5B7B1,stroke:#C0392B,stroke-width:2px;
```
