# johnwongapi/helm-decode architecture

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

- Interactive diagram: https://gitdiagram.com/johnwongapi/helm-decode
- Repository: https://github.com/johnwongapi/helm-decode

## Overview

##### Project Type & Purpose
- This is a single-page, client-only React/TypeScript application packaged with Webpack, served statically (GitHub Pages).
- Purpose: Offline, in-browser decoding of Helm3 Kubernetes secrets; no server or backend calls.

##### Core Components
a. Frontend React Application
- Entry point: public/index.html → src/index.tsx → App.tsx
- UI Components:
- HelmDecode.tsx: input/output area and decoding logic hooks
- Ref.tsx: reference/help panel
- Utilities: helmDecoder.ts (actual decode algorithm), defaultInput constant
- Styles: App.css
b. Build & Deployment Pipeline
- Webpack (webpack.config.js) bundles TSX/JS, CSS, assets
- TypeScript compiler (tsconfig.json)
- NPM scripts (package.json) for “start”, “build”
- GitHub Actions workflow (deploy-to-gh-pages.yml) pushes build to GitHub Pages
c. Hosting & Delivery
- GitHub Pages serves the static files from the “build”/“public” output
- Users access via https://helm-decode.jojo.hk

##### Relationships & Data Flows
- Developer → (git push) → GitHub Actions CI → Webpack build → GH Pages
- End-User Browser → fetch static assets → executes React app
- In-Browser → user inputs secret → helmDecoder util runs client-side → output displayed immediately

##### Architectural Patterns & Principles
- Single-Page Application (SPA)
- Client-side only processing (zero-trust of network)
- Component-based UI (React)
- Continuous Deployment via GitHub Actions
- Strict separation:
- Source code (src/)
- Public assets (public/)
- Build config & scripts

##### Essential Elements Checklist
- [ ] Components: React App, CI/CD, GitHub Pages, Browser
- [ ] Sub-components: UI modules, util functions
- [ ] Build & runtime axes (e.g., left side build pipeline, right side client runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Build & Deployment"
        Dev["Developer"]:::external
        GitHubCI["GitHub Actions CI"]:::build
        Workflow["deploy-to-gh-pages.yml"]:::build
        Package["package.json\nNPM Scripts"]:::gray
        TS["TypeScript\n(tsconfig.json)"]:::gray
        Webpack["Webpack\n(webpack.config.js)"]:::build
        PublicDir["public/ folder"]:::gray
        Fallback404[".github/404.html"]:::gray
        GitHubPages["GitHub Pages\nStatic Host"]:::build
    end

    subgraph "Client Runtime"
        Browser["Browser"]:::runtime
        IndexHTML["public/index.html"]:::runtime
        ReactApp["React App"]:::runtime
        IndexTS["src/index.tsx"]:::runtime
        AppTS["src/App.tsx"]:::runtime
        HelmDecode["HelmDecode.tsx"]:::runtime
        RefComp["Ref.tsx"]:::runtime
        HelmUtil["helmDecoder.ts"]:::runtime
        DefaultInput["defaultInput.ts"]:::runtime
        Styles["App.css"]:::runtime
    end

    Dev -->|"git push"| GitHubCI
    GitHubCI -->|runs workflow| Workflow
    Workflow -->|triggers build| Webpack
    Package -->|npm run build| Webpack
    TS -->|compile| Webpack
    Webpack -->|outputs| PublicDir
    PublicDir -->|includes fallback| Fallback404
    GitHubCI -->|deploys| GitHubPages

    Browser -->|"HTTP GET index.html"| GitHubPages
    GitHubPages --> IndexHTML
    IndexHTML --> ReactApp
    ReactApp --> IndexTS
    IndexTS --> AppTS
    AppTS --> HelmDecode
    AppTS --> RefComp
    AppTS --> Styles
    HelmDecode --> HelmUtil
    HelmDecode --> DefaultInput

    click IndexHTML "https://github.com/johnwongapi/helm-decode/blob/main/public/index.html"
    click IndexTS "https://github.com/johnwongapi/helm-decode/blob/main/src/index.tsx"
    click AppTS "https://github.com/johnwongapi/helm-decode/blob/main/src/App.tsx"
    click HelmDecode "https://github.com/johnwongapi/helm-decode/blob/main/src/components/HelmDecode.tsx"
    click RefComp "https://github.com/johnwongapi/helm-decode/blob/main/app/components/Ref.tsx"
    click HelmUtil "https://github.com/johnwongapi/helm-decode/blob/main/src/utils/helmDecoder.ts"
    click DefaultInput "https://github.com/johnwongapi/helm-decode/blob/main/src/constants/defaultInput.ts"
    click Styles "https://github.com/johnwongapi/helm-decode/blob/main/src/App.css"
    click Webpack "https://github.com/johnwongapi/helm-decode/blob/main/webpack.config.js"
    click TS "https://github.com/johnwongapi/helm-decode/blob/main/tsconfig.json"
    click Package "https://github.com/johnwongapi/helm-decode/blob/main/package.json"
    click Workflow "https://github.com/johnwongapi/helm-decode/blob/main/.github/workflows/deploy-to-gh-pages.yml"
    click PublicDir "https://github.com/johnwongapi/helm-decode/tree/main/public/"
    click Fallback404 "https://github.com/johnwongapi/helm-decode/blob/main/.github/404.html"

    classDef build fill:#add8e6,stroke:#000,stroke-width:1px
    classDef runtime fill:#90ee90,stroke:#000,stroke-width:1px
    classDef gray fill:#d3d3d3,stroke:#000,stroke-width:1px
    classDef external fill:#f0e68c,stroke:#000,stroke-width:1px
```
