# cloudgeometry/cg-devx-core architecture

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

- Interactive diagram: https://gitdiagram.com/cloudgeometry/cg-devx-core
- Repository: https://github.com/cloudgeometry/cg-devx-core

## Overview

##### Project Type and Purpose
- CG DevX is an application‐delivery and infrastructure‐as‐code platform. It combines:
- A CLI tool (Python) for developers to scaffold, provision, and manage cloud resources and GitOps pipelines.
- A set of Terraform modules to stand up cloud infrastructure (EKS/AKS/GKE, VPC, IAM, storage, Vault, Harbor, SonarQube, etc.).
- A “platform” directory containing GitOps templates and manifests (ArgoCD, Atlantis, monitoring, trace, security, autoscaling, developer portals).
- The goal is to automate cluster provisioning, platform bootstrapping, and workload delivery via GitOps.

##### File‐Structure Highlights
- Top‐level:
- .github – CI/CD workflows for releases.
- platform – templating for GitOps pipelines, multi‐cluster delivery manifests.
- platform/terraform – IaC modules grouped by cloud provider, secrets, users, VCS integration.
- tools/cli – the Python CLI with subcommands (setup, destroy, workload create/delete) and service layers (cloud, DNS, k8s, VCS, tf).
- Architectural patterns:
- CLI uses a service‐layer pattern to interact with cloud providers, DNS, Kubernetes, VCS, and Terraform.
- GitOps pattern: a central Git repository drives cluster state via ArgoCD; Atlantis handles Terraform pull requests.
- Modular Terraform modules for reuse across clouds (AWS/Azure/GCP).

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% Developer Layer
  subgraph "Developer Layer"
    DevCLI["CLI Tool (Python)"]:::developer
  end

  %% Git Layer
  subgraph "Git Layer"
    GitRepos["Git Providers (GitHub/GitLab)"]:::git
    CoreServicesManifests["Core Services Manifests"]:::git
    WorkloadsManifests["Workloads Manifests"]:::git
  end

  %% Provisioning Layer
  subgraph "Provisioning Layer"
    TerraformCore["Terraform Core Services Module"]:::terraform
    TerraformHosting["Terraform Hosting Provider Module"]:::terraform
    TerraformCloudAws["Terraform AWS Module"]:::terraform
    TerraformCloudAzure["Terraform Azure Module"]:::terraform
    TerraformCloudGcp["Terraform GCP Module"]:::terraform
    TerraformAdditional["Additional Terraform Modules"]:::terraform
    Atlantis["Atlantis"]:::kubernetes
    ArgoCD["ArgoCD Controller"]:::kubernetes
  end

  %% Cloud Layer
  subgraph "Cloud Layer"
    RemoteState["Remote State Backend"]:::storage
    CloudAPIs["Cloud Provider APIs"]:::cloud
    VaultService["Vault Service (Terraform)"]:::storage
  end

  %% Kubernetes Layer
  subgraph "Kubernetes Layer"
    subgraph "Cluster"
      CoreServices["Core Platform Services"]:::kubernetes
      AdditionalServices["Additional Platform Services"]:::kubernetes
      Workloads["Applications / Workloads"]:::kubernetes
    end
  end

  %% Relationships
  DevCLI -->|"initializes repos"| GitRepos
  DevCLI -->|"invokes Terraform"| TerraformCore
  TerraformCore -->|"uses modules"| TerraformCloudAws
  TerraformCore -->|"uses modules"| TerraformCloudAzure
  TerraformCore -->|"uses modules"| TerraformCloudGcp
  TerraformCore -->|"uses modules"| TerraformHosting
  TerraformCore -->|stores state| RemoteState
  TerraformCore -->|"provisions infra"| CloudAPIs
  TerraformCore -->|"provisions Vault"| VaultService

  GitRepos -->|"syncs manifests"| ArgoCD
  GitRepos -.->|"triggers PRs"| Atlantis

  ArgoCD -->|"deploys manifests"| CoreServices
  Atlantis -->|"applies Terraform"| CloudAPIs

  VaultService -->|"provides secrets"| TerraformCore
  VaultService -->|"provides secrets"| CoreServices

  CoreServices -->|"hosts workloads"| AdditionalServices
  AdditionalServices -->|"runs workloads"| Workloads

  %% Click Events
  click DevCLI "https://github.com/cloudgeometry/cg-devx-core/tree/main/tools/cli"
  click TerraformCore "https://github.com/cloudgeometry/cg-devx-core/blob/main/platform/terraform/core_services/main.tf"
  click TerraformHosting "https://github.com/cloudgeometry/cg-devx-core/blob/main/platform/terraform/hosting_provider/main.tf"
  click TerraformCloudAws "https://github.com/cloudgeometry/cg-devx-core/tree/main/platform/terraform/modules/cloud_aws"
  click TerraformCloudAzure "https://github.com/cloudgeometry/cg-devx-core/tree/main/platform/terraform/modules/cloud_azure"
  click TerraformCloudGcp "https://github.com/cloudgeometry/cg-devx-core/tree/main/platform/terraform/modules/cloud_gcp"
  click TerraformAdditional "https://github.com/cloudgeometry/cg-devx-core/tree/main/platform/terraform/modules/code_quality_sonarqube"
  click TerraformAdditional "https://github.com/cloudgeometry/cg-devx-core/tree/main/platform/terraform/modules/registry_harbor"
  click TerraformAdditional "https://github.com/cloudgeometry/cg-devx-core/tree/main/platform/terraform/modules/secrets_vault"
  click TerraformAdditional "https://github.com/cloudgeometry/cg-devx-core/tree/main/platform/terraform/modules/users_github"
  click TerraformAdditional "https://github.com/cloudgeometry/cg-devx-core/tree/main/platform/terraform/modules/vcs_github"
  click CoreServicesManifests "https://github.com/cloudgeometry/cg-devx-core/tree/main/platform/gitops-pipelines/delivery/clusters/cc-cluster/core-services"
  click WorkloadsManifests "https://github.com/cloudgeometry/cg-devx-core/tree/main/platform/gitops-pipelines/delivery/clusters/cc-cluster/workloads"
  click Atlantis "https://github.com/cloudgeometry/cg-devx-core/blob/main/platform/atlantis.yaml"
  click ArgoCD "https://github.com/cloudgeometry/cg-devx-core/blob/main/platform/installation-manifests/argocd/argocd-namespace.yaml"

  %% Styles
  classDef developer fill:#D0E8FF,stroke:#4A90E2;
  classDef git fill:#E6F9E6,stroke:#2CA02C;
  classDef terraform fill:#FFE5CC,stroke:#FF7F0E;
  classDef cloud fill:#F0F8FF,stroke:#1F77B4;
  classDef storage fill:#F2F2F2,stroke:#7F7F7F,stroke-dasharray: 5 5;
  classDef kubernetes fill:#F3E5FF,stroke:#9467BD;
```
