# antonkad/wobucket architecture

> Architecture diagram of the GitHub repository antonkad/wobucket, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/antonkad/wobucket
- Repository: https://github.com/antonkad/wobucket

## Overview

##### Main Components Identification

a) Application Components:
- WoBucket Server (Go-based service)
- WoBucket CLI (Python-based client)
- Container Registry (for Docker images)
- Kubernetes Cluster
- ArgoCD (for GitOps deployments)

##### Architectural Patterns
The system follows modern cloud-native patterns:
- Microservices architecture
- GitOps deployment model
- Multi-environment deployment strategy
- Container-based deployment

##### Core Components Layer
- [WoBucket CLI] → [WoBucket Server] → [Storage Backend]

##### Infrastructure Layer
- [Docker Container] → [Kubernetes Cluster]
- ↓
- [Helm Charts]
- How the application is containerized
- Kubernetes infrastructure
- Helm deployment configuration

##### CI/CD Pipeline
- [GitHub] → [GitHub Actions] → [Container Registry] → [ArgoCD] → [K8s Cluster]
- Flow from code to deployment
- Branching strategy visualization

##### Environment Structure
- [Helm Charts]
- ↓
- [Environments]
- Production
- Qualification
- Country-specific configs
- Multi-environment setup
- Configuration inheritance

- Blue: Application components (CLI, Server)
- Green: Infrastructure components (K8s, Helm)
- Orange: CI/CD components
- Purple: Storage/Database components

Important Elements to Include:
##### Handler Routes
- DELETE endpoint
- Endpoint
- UPLOAD endpoint

##### Configuration Management
- How values flow from common → variants → environment-specific

##### Deployment Flow
- How ArgoCD watches for changes
- Automated deployment triggers from tags

Key Relationships to Highlight:
- CLI to Server communication
- Server to Storage interaction
- GitOps automation flow
- Configuration inheritance in Helm

Level of Detail:
1. Detailed handler flow
2. Helm chart structure
3. Environment configuration inheritance

##### The separation between client and server components

- Environment inheritance patterns

This system design should provide a clear understanding of both the application architecture and its deployment strategy while maintaining the right balance between detail and clarity.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        CLI["WoBucket CLI"]:::client
    end

    subgraph Server
        WS["WoBucket Server"]:::server
        subgraph Handlers
            DH["Delete Handler"]:::handler
            LH["List Handler"]:::handler
            UH["Upload Handler"]:::handler
        end
        RT["Server Routes"]:::routes
        WS --> DH & LH & UH
        DH & LH & UH --> RT
    end

    subgraph Infrastructure
        DR["Docker Container"]:::infra
        K8S["Kubernetes Cluster"]:::infra
        HLM["Helm Charts"]:::infra
        DR --> K8S
        HLM --> K8S
    end

    subgraph "CI/CD Pipeline"
        GH["GitHub"]:::cicd
        GHA["GitHub Actions"]:::cicd
        CR["Container Registry"]:::cicd
        ARGO["ArgoCD"]:::cicd
        GH --> GHA
        GHA --> CR
        CR --> ARGO
        ARGO --> K8S
    end

    subgraph "Environment Configuration"
        CC["Common Config"]:::config
        NPV["Non-Prod Variant"]:::config
        PROD["Production"]:::config
        QLF["Qualification"]:::config
        CC --> NPV
        NPV --> PROD & QLF
    end

    subgraph "K8S Resources"
        DEP["Deployment"]:::k8s
        SVC["Service"]:::k8s
        HPA["HPA"]:::k8s
    end

    CLI --> WS
    WS --> SB[("Storage Backend")]:::storage

    %% Click Events
    click CLI "https://github.com/antonkad/wobucket/blob/main/wobucket-cli/wb.py"
    click WS "https://github.com/antonkad/wobucket/blob/main/wobucket-server/main.go"
    click DH "https://github.com/antonkad/wobucket/blob/main/wobucket-server/handlers/delete.go"
    click LH "https://github.com/antonkad/wobucket/blob/main/wobucket-server/handlers/list.go"
    click UH "https://github.com/antonkad/wobucket/blob/main/wobucket-server/handlers/upload.go"
    click RT "https://github.com/antonkad/wobucket/blob/main/wobucket-server/routes/routes.go"
    click DR "https://github.com/antonkad/wobucket/tree/main/wobucket-server/Dockerfile"
    click GHA "https://github.com/antonkad/wobucket/blob/main/.github/workflows/docker_build.yml"
    click HLM "https://github.com/antonkad/wobucket/blob/main/k8s/Chart.yaml"
    click PROD "https://github.com/antonkad/wobucket/blob/main/k8s/envs/country/prod/values-api-external.yaml"
    click QLF "https://github.com/antonkad/wobucket/blob/main/k8s/envs/country/qlf/values-api-external.yaml"
    click DEP "https://github.com/antonkad/wobucket/blob/main/k8s/templates/deployment.yaml"
    click SVC "https://github.com/antonkad/wobucket/blob/main/k8s/templates/service.yaml"
    click HPA "https://github.com/antonkad/wobucket/blob/main/k8s/templates/hpa.yaml"
    click CC "https://github.com/antonkad/wobucket/blob/main/k8s/common/values-api-external.yaml"
    click NPV "https://github.com/antonkad/wobucket/blob/main/k8s/variants/values-non-prod.yaml"

    %% Styling
    classDef client fill:#2196F3,stroke:#1565C0,color:white
    classDef server fill:#4CAF50,stroke:#2E7D32,color:white
    classDef handler fill:#81C784,stroke:#4CAF50,color:white
    classDef routes fill:#A5D6A7,stroke:#81C784,color:black
    classDef infra fill:#FF9800,stroke:#F57C00,color:white
    classDef cicd fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef config fill:#00BCD4,stroke:#0097A7,color:white
    classDef k8s fill:#FFC107,stroke:#FFA000,color:black
    classDef storage fill:#607D8B,stroke:#455A64,color:white
```
