# konstructio/kubefirst architecture

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

- Interactive diagram: https://gitdiagram.com/konstructio/kubefirst
- Repository: https://github.com/konstructio/kubefirst

## Overview

##### Project type and purpose
- This is an open-source CLI tool (“Kubefirst CLI”) written in Go.
- Purpose: automate the end-to-end creation of GitOps platforms on various environments (k3d, AWS, Azure, Civo, DigitalOcean, Google Cloud, Vultr, k3s, Akamai).
- Key use cases: scaffolding Helm charts, initializing Git repos, provisioning clusters, wiring up GitOps pipelines, applying Terraform as needed.

##### File structure
- Top-level:
- cmd/… subdivided into one folder per provider (aws, azure, civo, digitalocean, google, vultr, akamai, k3d, k3s) plus common commands (info, version, logs, reset, launch, terraform, letsencrypt).
- internal/… packages implementing services and business logic:
– generate (scaffold files & directories)
– provision (cluster provisioning)
– provisionLogs (watch logs)
– cluster (cluster abstractions)
– gitShim (Git remotes & container registry auth)
– helm (Helm chart interactions)
– k3d, k3s (local cluster drivers)
– segment (analytics)
– progress (CLI progress bars)
– step (task orchestration)
– types & utilities (shared flags, config).
- config.yaml (CLI default configuration).
- build/Dockerfile, .devcontainer (developer/workspace).

##### README for additional insights
- Confirms GitOps Infrastructure & Application Delivery Platform.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User"] 
    User --> CLIEntrypoint["CLI Entrypoint"]:::go
    click CLIEntrypoint "https://github.com/konstructio/kubefirst/blob/main/main.go"

    CLIEntrypoint --> CommandLayer["Command Layer (cmd/)"]:::go
    click CommandLayer "https://github.com/konstructio/kubefirst/tree/main/cmd/"

    subgraph "Command Layer"
      direction TB
      CLIaws["AWS Commands"]:::go
      click CLIaws "https://github.com/konstructio/kubefirst/blob/main/cmd/aws/command.go"
      click CLIaws "https://github.com/konstructio/kubefirst/blob/main/cmd/aws/create.go"
      click CLIaws "https://github.com/konstructio/kubefirst/blob/main/cmd/aws/quota.go"

      CLIAzure["Azure Commands"]:::go
      click CLIAzure "https://github.com/konstructio/kubefirst/blob/main/cmd/azure/command.go"
      click CLIAzure "https://github.com/konstructio/kubefirst/blob/main/cmd/azure/create.go"

      CLIcivo["Civo Commands"]:::go
      click CLIcivo "https://github.com/konstructio/kubefirst/blob/main/cmd/civo/command.go"
      click CLIcivo "https://github.com/konstructio/kubefirst/blob/main/cmd/civo/create.go"
      click CLIcivo "https://github.com/konstructio/kubefirst/blob/main/cmd/civo/backup.go"
      click CLIcivo "https://github.com/konstructio/kubefirst/blob/main/cmd/civo/quota.go"

      CLIDO["DigitalOcean Commands"]:::go
      click CLIDO "https://github.com/konstructio/kubefirst/blob/main/cmd/digitalocean/command.go"
      click CLIDO "https://github.com/konstructio/kubefirst/blob/main/cmd/digitalocean/create.go"

      CLIGoogle["Google Cloud Commands"]:::go
      click CLIGoogle "https://github.com/konstructio/kubefirst/blob/main/cmd/google/command.go"
      click CLIGoogle "https://github.com/konstructio/kubefirst/blob/main/cmd/google/create.go"

      CLIVultr["Vultr Commands"]:::go
      click CLIVultr "https://github.com/konstructio/kubefirst/blob/main/cmd/vultr/command.go"
      click CLIVultr "https://github.com/konstructio/kubefirst/blob/main/cmd/vultr/create.go"

      CLIAkamai["Akamai Commands"]:::go
      click CLIAkamai "https://github.com/konstructio/kubefirst/blob/main/cmd/akamai/command.go"
      click CLIAkamai "https://github.com/konstructio/kubefirst/blob/main/cmd/akamai/create.go"

      CLIk3d["k3d Commands"]:::go
      click CLIk3d "https://github.com/konstructio/kubefirst/blob/main/cmd/k3d/command.go"
      click CLIk3d "https://github.com/konstructio/kubefirst/blob/main/cmd/k3d/create.go"
      click CLIk3d "https://github.com/konstructio/kubefirst/blob/main/cmd/k3d/destroy.go"
      click CLIk3d "https://github.com/konstructio/kubefirst/blob/main/cmd/k3d/mkcert.go"
      click CLIk3d "https://github.com/konstructio/kubefirst/blob/main/cmd/k3d/root-credentials.go"
      click CLIk3d "https://github.com/konstructio/kubefirst/blob/main/cmd/k3d/vault.go"

      CLIk3s["k3s Commands"]:::go
      click CLIk3s "https://github.com/konstructio/kubefirst/blob/main/cmd/k3s/command.go"
      click CLIk3s "https://github.com/konstructio/kubefirst/blob/main/cmd/k3s/create.go"

      CLICommon["Common Commands"]:::go
      click CLICommon "https://github.com/konstructio/kubefirst/blob/main/cmd/generate.go"
      click CLICommon "https://github.com/konstructio/kubefirst/blob/main/cmd/launch.go"
      click CLICommon "https://github.com/konstructio/kubefirst/blob/main/cmd/letsencrypt.go"
      click CLICommon "https://github.com/konstructio/kubefirst/blob/main/cmd/logs.go"
      click CLICommon "https://github.com/konstructio/kubefirst/blob/main/cmd/reset.go"
      click CLICommon "https://github.com/konstructio/kubefirst/blob/main/cmd/terraform.go"
      click CLICommon "https://github.com/konstructio/kubefirst/blob/main/cmd/info.go"
      click CLICommon "https://github.com/konstructio/kubefirst/blob/main/cmd/version.go"
      click CLICommon "https://github.com/konstructio/kubefirst/blob/main/cmd/root.go"
    end

    CommandLayer --> ServiceLayer["Service Layer (internal/*)"]:::go
    click ServiceLayer "https://github.com/konstructio/kubefirst/tree/main/internal/"

    subgraph "Service Layer"
      direction TB
      Gen["Scaffold Generation"]:::go
      click Gen "https://github.com/konstructio/kubefirst/blob/main/internal/generate/files.go"
      click Gen "https://github.com/konstructio/kubefirst/blob/main/internal/generate/scaffold.go"
      click Gen "https://github.com/konstructio/kubefirst/tree/main/internal/generate/scaffold/"
      click Gen "https://github.com/konstructio/kubefirst/blob/main/internal/generate/scaffold/{{ .AppName }}.yaml"

      Cluster["Cluster Abstractions"]:::go
      click Cluster "https://github.com/konstructio/kubefirst/blob/main/internal/cluster/cluster.go"

      Prov["Provisioning Engine"]:::go
      click Prov "https://github.com/konstructio/kubefirst/blob/main/internal/provision/provision.go"
      click Prov "https://github.com/konstructio/kubefirst/blob/main/internal/provision/provisionWatcher.go"

      ProvLogs["Provisioning Logs"]:::go
      click ProvLogs "https://github.com/konstructio/kubefirst/blob/main/internal/provisionLogs/command.go"
      click ProvLogs "https://github.com/konstructio/kubefirst/blob/main/internal/provisionLogs/provisionLogs.go"
      click ProvLogs "https://github.com/konstructio/kubefirst/blob/main/internal/provisionLogs/types.go"

      GitShim["Git Shim"]:::go
      click GitShim "https://github.com/konstructio/kubefirst/blob/main/internal/gitShim/init.go"
      click GitShim "https://github.com/konstructio/kubefirst/blob/main/internal/gitShim/containerRegistryAuth.go"

      Helm["Helm Client"]:::go
      click Helm "https://github.com/konstructio/kubefirst/blob/main/internal/helm/types.go"

      LocalK3d["Local k3d Driver"]:::go
      click LocalK3d "https://github.com/konstructio/kubefirst/blob/main/internal/k3d/menu.go"

      Launch["Launch Subcommands"]:::go
      click Launch "https://github.com/konstructio/kubefirst/blob/main/internal/launch/cmd.go"
      click Launch "https://github.com/konstructio/kubefirst/blob/main/internal/launch/constants.go"

      Progress["Progress & Feedback"]:::go
      click Progress "https://github.com/konstructio/kubefirst/blob/main/internal/progress/progress.go"
      click Progress "https://github.com/konstructio/kubefirst/blob/main/internal/progress/command.go"
      click Progress "https://github.com/konstructio/kubefirst/blob/main/internal/progress/message.go"
      click Progress "https://github.com/konstructio/kubefirst/blob/main/internal/progress/styles.go"
      click Progress "https://github.com/konstructio/kubefirst/blob/main/internal/progress/constants.go"
      click Progress "https://github.com/konstructio/kubefirst/blob/main/internal/progress/types.go"

      Analytics["Analytics (Segment)"]:::go
      click Analytics "https://github.com/konstructio/kubefirst/blob/main/internal/segment/segment.go"

      Stepper["Step Orchestration"]:::go
      click Stepper "https://github.com/konstructio/kubefirst/blob/main/internal/step/stepper.go"

      Types["Shared Types & Flags"]:::go
      click Types "https://github.com/konstructio/kubefirst/blob/main/internal/types/flags.go"
      click Types "https://github.com/konstructio/kubefirst/blob/main/internal/types/proxy.go"

      Utils["Utilities"]:::go
      click Utils "https://github.com/konstructio/kubefirst/blob/main/internal/common/common.go"
      click Utils "https://github.com/konstructio/kubefirst/blob/main/internal/utilities/utilities.go"
      click Utils "https://github.com/konstructio/kubefirst/blob/main/internal/utilities/flags.go"

      Catalog["Catalog Metadata"]:::go
      click Catalog "https://github.com/konstructio/kubefirst/blob/main/internal/catalog/catalog.go"
    end

    ServiceLayer --> External["External Integrations"]:::external

    subgraph "External Integrations"
      direction TB
      Cloud["Cloud Provider APIs"]:::external
      Kube["Kubernetes Cluster"]:::external
      GitHub["GitHub"]:::external
      Registry["Container Registry"]:::external
      HelmRepo["Helm Chart Repo"]:::external
      TerraformBE["Terraform State Backend"]:::external
    end

    CLICommon --> ProvLogs
    Prov --> Kube
    Helm --> Kube
    GitShim --> GitHub
    GitShim --> Registry
    Stepper --> Gen
    Stepper --> GitShim
    Stepper --> Prov
    Stepper --> Helm
    Stepper --> Cloud
    Stepper --> Analytics
    ProvLogs --> CLICommon
    Progress --> CLICommon

    classDef go fill:#E6FFFA,stroke:#2C7A7B,stroke-width:1px
    classDef external fill:#FEFCBF,stroke:#D69E2E,stroke-width:1px
```
