# dhrjklt/diracx-charts architecture

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

- Interactive diagram: https://gitdiagram.com/dhrjklt/diracx-charts
- Repository: https://github.com/dhrjklt/diracx-charts

## Overview

##### Main Components
- Helm Chart & Templates – The “diracx” folder and its “templates” subdirectory contain all the Kubernetes YAML templates (Deployments, Services, Ingress, ConfigMaps, Jobs, etc.) for deploying the DiracX services.
- Core Application Components – This includes the DiracX API (main back-end service) and the DiracX Web frontend (“diracx-web”). Represent these as separate deployment blocks.
- Dependent Services & Infrastructure – The chart includes dependencies for:
- MySQL (for the database)
- OpenSearch/Elasticsearch (for logs or other data storage)
- Dex (for identity and authentication)
- Minio (as an object store)
- RabbitMQ (for messaging)
- Additional telemetry and monitoring components: OpenTelemetry Collector, Prometheus, Jaeger, Grafana
- The cert-manager issuer (via packaged subchart) which handles certificate management.
- Development/Demo Components – Note the “demo” directory and the “run_demo.sh” script, which set up a local Kubernetes cluster using tools like Docker and Kind.
- CI/CD and GitHub Workflows – Under the “.github” directory, workflows (like main.yml) manage testing and integration, showing that automated deployment and testing are on the roadmap.

##### Out Relationships and Interactions
- At the top level, illustrate the Kubernetes cluster as the overarching environment where all deployments run.
- Within the cluster, separate the deployment of DiracX into its two major components:
- The API/back-end (diracx)
- The Web frontend (diracx-web)
- Surround these with their dependent services:
- Communication with Dex for authentication.
- Minio for object storage interactions.
- RabbitMQ for messaging between microservices.
- For telemetry, show the OpenTelemetry collector gathering traces/metrics from various components, with outputs directed to Prometheus (for metrics), Jaeger (for tracing), and Grafana (for visualization). Note the conditional nature of these components (experimental use when enabled).
- Overall dependency management by Helm. This includes the templating system itself and the managed dependencies (most provided as packaged tgz files inside the “diracx/charts” directory).

##### Architectural Patterns and Principles
- GitOps/Declarative approach deployed in Kubernetes with Helm charts.
- The use of sub-charts to manage dependencies indicates a microservices-inspired, loosely coupled architecture.
- Separation of concerns: infrastructure (Helm/Kubernetes objects), middleware (RabbitMQ, Dex, etc.), persistent layers (MySQL, OpenSearch), and observability (OpenTelemetry, Prometheus, Jaeger, Grafana).
- That the deployment strategy supports both development with live reloading and production setups by toggling initialization steps via configuration values.

##### Technologies and Frameworks
- Kubernetes for orchestration.
- Helm for templating configurations.
- Docker/Kind for local development setups (referenced by run_demo.sh).
- OpenTelemetry and related observability tools.
- GitHub Actions as part of your CI/CD pipeline.

##### Final Detailing
- Including a secondary, simplified “demo” view that highlights how the run_demo.sh script sets environment variables and mounts volumes for local development.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Kubernetes Cluster"
        subgraph "Helm Chart Deployments"
            A["Helm Chart & Templates"]:::helm
            B["DiracX API Deployment"]:::app
            C["DiracX Web Deployment"]:::app
            A -->|"deploys"| B
            A -->|"deploys"| C
        end

        D["Ingress Controller"]:::external

        subgraph "Dependent Services"
            E["MySQL Database"]:::infra
            F["OpenSearch"]:::infra
            G["Elasticsearch"]:::infra
            H["Dex Identity Provider"]:::infra
            I["Minio Object Storage"]:::infra
            J["RabbitMQ Messaging"]:::infra
            K["Cert-manager Issuer"]:::infra
        end

        subgraph "Telemetry & Monitoring"
            L["OpenTelemetry Collector"]:::telemetry
            M["Prometheus"]:::telemetry
            N["Jaeger"]:::telemetry
            O["Grafana"]:::telemetry
        end
    end

    P["CI/CD Pipeline (GitHub Workflows)"]:::cicd
    Q["Development/Demo Environment"]:::demo

    %% Connections within Kubernetes Cluster
    D -->|"routes"| B
    D -->|"routes"| C
    B -->|"queries"| E
    B -->|"logs_to"| F
    B -->|"logs_to"| G
    B -->|"auth_with"| H
    B -->|"stores_in"| I
    B -->|"messages_to"| J
    D -->|"secures_with"| K
    B -->|"metrics_to"| L
    C -->|"metrics_to"| L
    L -->|"sends"| M
    L -->|"sends"| N
    L -->|"sends"| O

    %% External connections
    P -->|"triggers"| A
    Q -->|"deploys via"| A

    %% Click Events
    click A "https://github.com/dhrjklt/diracx-charts/tree/master/diracx/"
    click B "https://github.com/dhrjklt/diracx-charts/tree/master/diracx/templates/diracx/"
    click C "https://github.com/dhrjklt/diracx-charts/tree/master/diracx/templates/diracx-web/"
    click E "https://github.com/dhrjklt/diracx-charts/blob/master/diracx/charts/mysql-9.11.0.tgz"
    click F "https://github.com/dhrjklt/diracx-charts/blob/master/diracx/charts/opensearch-2.13.1.tgz"
    click G "https://github.com/dhrjklt/diracx-charts/blob/master/diracx/charts/elasticsearch-8.5.1.tgz"
    click H "https://github.com/dhrjklt/diracx-charts/blob/master/diracx/charts/dex-0.14.2.tgz"
    click I "https://github.com/dhrjklt/diracx-charts/blob/master/diracx/charts/minio-5.0.11.tgz"
    click J "https://github.com/dhrjklt/diracx-charts/blob/master/diracx/charts/rabbitmq-12.0.10.tgz"
    click K "https://github.com/dhrjklt/diracx-charts/tree/master/diracx/charts/cert-manager-issuer/"
    click L "https://github.com/dhrjklt/diracx-charts/blob/master/diracx/charts/opentelemetry-collector-0.68.0.tgz"
    click M "https://github.com/dhrjklt/diracx-charts/blob/master/diracx/charts/prometheus-25.0.0.tgz"
    click N "https://github.com/dhrjklt/diracx-charts/blob/master/diracx/charts/jaeger-0.71.14.tgz"
    click O "https://github.com/dhrjklt/diracx-charts/blob/master/diracx/charts/grafana-6.59.4.tgz"
    click Q "https://github.com/dhrjklt/diracx-charts/tree/master/demo/"
    click P "https://github.com/dhrjklt/diracx-charts/tree/master/.github/"

    %% Styles
    classDef helm fill:#E8DAEF,stroke:#6C3483,stroke-width:2px;
    classDef app fill:#D4E6F1,stroke:#1B4F72,stroke-width:2px;
    classDef infra fill:#FAD7A0,stroke:#D35400,stroke-width:2px;
    classDef telemetry fill:#D5F5E3,stroke:#28B463,stroke-width:2px;
    classDef external fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef cicd fill:#F6DDCC,stroke:#784212,stroke-width:2px;
    classDef demo fill:#D6EAF8,stroke:#2874A6,stroke-width:2px;
```
