# manusa/helm-java architecture

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

- Interactive diagram: https://gitdiagram.com/manusa/helm-java
- Repository: https://github.com/manusa/helm-java

## Overview

- Start from Java application
- Through Helm class
- To specific command implementations

- From Java commands to JNI layer
- Through platform-specific implementations
- To native Go code

- Connection to Kubernetes clusters
- Interaction with Helm repositories
- Chart storage and retrieval

##### Key Components to Detail

a. Command Pattern Implementation
- Available commands (Create, Install, Uninstall, etc.)
- To their respective native implementations

b. Platform Support
- How different platform libraries are loaded
- Dynamic selection mechanism

c. Configuration Management
- How Helm configuration is handled
- Repository management
- Credential handling

##### Additional Elements

- Component type definitions

b. Version Information (Top Right)
- Current version
- Supported Helm versions
- Platform compatibility

##### Implementation Details

a. Use clear hierarchical layout
- Top: Java API layer
- Middle: JNI bridge
- Bottom: Native implementation

b. Related components
- Command implementations
- Platform-specific code
- Configuration handling

c. Important interfaces
- Native library interface
- Command interfaces
- External system interfaces

##### External Systems

a. Connections to:
- Kubernetes clusters
- Helm repositories
- Chart storage
- Authentication services

Remember to maintain a balance between showing enough detail to understand the system's architecture while keeping it clean and readable. The focus should be on the interaction between the Java wrapper, the native bridge, and the underlying Helm functionality.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Java_Layer
        Helm["Helm (Entry Point)"]:::java
        HelmCommand["HelmCommand Interface"]:::java
        InstallCmd["Install Command"]:::java
        UninstallCmd["Uninstall Command"]:::java
        RepoCmd["Repository Command"]:::java
    end

    subgraph JNI_Bridge
        HelmLib["HelmLib Interface"]:::jni
        NativeLib["NativeLibrary Interface"]:::jni
        RemoteJar["Remote Jar Loader"]:::jni
        NativeConfig["Native Library Config"]:::jni
    end

    subgraph Platform_Libraries
        DarwinAMD64["Darwin AMD64"]:::platform
        DarwinARM64["Darwin ARM64"]:::platform
        LinuxAMD64["Linux AMD64"]:::platform
        LinuxARM64["Linux ARM64"]:::platform
        WindowsAMD64["Windows AMD64"]:::platform
    end

    subgraph Native_Go_Layer
        GoHelm["Helm Go Implementation"]:::go
        InstallGo["Install Implementation"]:::go
        UninstallGo["Uninstall Implementation"]:::go
        RepoGo["Repository Implementation"]:::go
    end

    subgraph External_Systems
        K8s["Kubernetes Clusters"]:::external
        HelmRepo["Helm Repositories"]:::external
        ChartStorage["Chart Storage"]:::external
    end

    %% Connections
    Helm --> HelmCommand
    HelmCommand --> InstallCmd & UninstallCmd & RepoCmd
    InstallCmd & UninstallCmd & RepoCmd --> HelmLib
    HelmLib --> NativeLib
    RemoteJar --> NativeLib
    NativeLib --> DarwinAMD64 & DarwinARM64 & LinuxAMD64 & LinuxARM64 & WindowsAMD64
    DarwinAMD64 & DarwinARM64 & LinuxAMD64 & LinuxARM64 & WindowsAMD64 --> GoHelm
    GoHelm --> InstallGo & UninstallGo & RepoGo
    InstallGo & UninstallGo & RepoGo -.-> K8s & HelmRepo & ChartStorage

    %% Click Events
    click Helm "https://github.com/manusa/helm-java/blob/main/helm-java/src/main/java/com/marcnuri/helm/Helm.java"
    click HelmCommand "https://github.com/manusa/helm-java/blob/main/helm-java/src/main/java/com/marcnuri/helm/HelmCommand.java"
    click InstallCmd "https://github.com/manusa/helm-java/blob/main/helm-java/src/main/java/com/marcnuri/helm/InstallCommand.java"
    click UninstallCmd "https://github.com/manusa/helm-java/blob/main/helm-java/src/main/java/com/marcnuri/helm/UninstallCommand.java"
    click RepoCmd "https://github.com/manusa/helm-java/blob/main/helm-java/src/main/java/com/marcnuri/helm/RepoCommand.java"
    click HelmLib "https://github.com/manusa/helm-java/blob/main/lib/api/src/main/java/com/marcnuri/helm/jni/HelmLib.java"
    click NativeLib "https://github.com/manusa/helm-java/blob/main/lib/api/src/main/java/com/marcnuri/helm/jni/NativeLibrary.java"
    click RemoteJar "https://github.com/manusa/helm-java/blob/main/lib/api/src/main/java/com/marcnuri/helm/jni/RemoteJarLoader.java"
    click NativeConfig "https://github.com/manusa/helm-java/blob/main/lib/api/src/main/resources-filtered/META-INF/native-libraries.properties"
    click DarwinAMD64 "https://github.com/manusa/helm-java/blob/main/lib/darwin-amd64/src/main/java/com/marcnuri/helm/jni/darwin/amd64/DarwinAmd64NativeLibrary.java"
    click DarwinARM64 "https://github.com/manusa/helm-java/blob/main/lib/darwin-arm64/src/main/java/com/marcnuri/helm/jni/darwin/arm64/DarwinArm64NativeLibrary.java"
    click LinuxAMD64 "https://github.com/manusa/helm-java/blob/main/lib/linux-amd64/src/main/java/com/marcnuri/helm/jni/linux/amd64/LinuxAmd64NativeLibrary.java"
    click LinuxARM64 "https://github.com/manusa/helm-java/blob/main/lib/linux-arm64/src/main/java/com/marcnuri/helm/jni/linux/arm64/LinuxArm64NativeLibrary.java"
    click WindowsAMD64 "https://github.com/manusa/helm-java/blob/main/lib/windows-amd64/src/main/java/com/marcnuri/helm/jni/windows/amd64/WindowsAmd64NativeLibrary.java"
    click GoHelm "https://github.com/manusa/helm-java/blob/main/native/internal/helm/helm.go"
    click InstallGo "https://github.com/manusa/helm-java/blob/main/native/internal/helm/install.go"
    click UninstallGo "https://github.com/manusa/helm-java/blob/main/native/internal/helm/uninstall.go"
    click RepoGo "https://github.com/manusa/helm-java/blob/main/native/internal/helm/repo.go"

    %% Styles
    classDef java fill:#4b77be,color:#fff
    classDef jni fill:#f1c40f,color:#000
    classDef platform fill:#95a5a6,color:#fff
    classDef go fill:#2ecc71,color:#fff
    classDef external fill:#e74c3c,color:#fff

    %% Legend
    subgraph Legend
        Java["Java Layer"]:::java
        JNI["JNI Bridge"]:::jni
        Platform["Platform Libraries"]:::platform
        Go["Go Native Layer"]:::go
        Ext["External Systems"]:::external
    end
```
