# aksarav/confmap architecture

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

- Interactive diagram: https://gitdiagram.com/aksarav/confmap
- Repository: https://github.com/aksarav/confmap

## Overview

##### Project type and purpose
- ConfMap is an open-source, single-page web application (SPA) that visualizes YAML/JSON/YML configuration files as interactive mind maps.
- It is built with TypeScript, ECharts (for charting), Tailwind CSS (for styling), and is deployed as a static site (via Netlify and/or Cloudflare Workers).

##### File structure
Top-level directories and files:
- src/
– main.ts, main-simple.ts, counter.ts: entry points and demo logic
– input.css, style.css: UI styles
– vite-env.d.ts, tsconfig.json, vite.config.ts: TypeScript and Vite build configs
- public/
– images, robots.txt, sitemap.xml: static assets for production
- cloudflare-worker.js & wrangler.toml
– definitions for a Cloudflare Workers–based deployment option
- netlify.toml & build-for-netlify.sh
– Netlify deployment settings and helper script
- Dockerfile & docker-compose.yml
– containerized development/production presets
- DEPLOYMENT.md, deploy-worker.sh
– additional deployment guidance
- package.json & package-lock.json
– NPM scripts (“dev”, “build”) and dependencies
Patterns & choices:
- SPA built with Vite (modern bundler), TypeScript, Tailwind.
- Static‐site hosting (Netlify / Cloudflare), optionally containerized.

##### README for additional insights
- Tech stack: TypeScript, ECharts, Tailwind CSS.
- Use cases: Kubernetes / IaC configs, documentation, troubleshooting.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer Environment
    subgraph "Developer Environment"
        subgraph "Source Code"
            Main["main.ts"]:::code
            MainS["main-simple.ts"]:::code
            Counter["counter.ts"]:::code
            InputCSS["input.css"]:::frontend
            StyleCSS["style.css"]:::frontend
            TailwindCfg["tailwind.config.js"]:::infra
            PostCSS["postcss.config.js"]:::infra
            ViteCfgTS["vite.config.ts"]:::infra
            TSConfig["tsconfig.json"]:::infra
            ViteEnv["vite-env.d.ts"]:::infra
        end
        PackageJSON["package.json"]:::infra
        PackageLock["package-lock.json"]:::infra
    end

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        GH["GitHub Actions"]:::deployment
        Build["Vite Build"]:::deployment
    end

    %% Deployment Targets
    subgraph "Deployment"
        subgraph "Netlify"
            NetlifyToml["netlify.toml"]:::deployment
            BuildSh["build-for-netlify.sh"]:::deployment
        end
        subgraph "Cloudflare Workers"
            Wrangler["wrangler.toml"]:::deployment
            WorkerJS["cloudflare-worker.js"]:::deployment
            DeployWorker["deploy-worker.sh"]:::deployment
        end
        subgraph "Containerized"
            Dockerfile["Dockerfile"]:::deployment
            DockerCompose["docker-compose.yml"]:::deployment
            NGINX["nginx.conf"]:::deployment
        end
    end

    %% Runtime Flow
    subgraph "Client Runtime"
        Browser["Client Browser"]:::browser
        subgraph "SPA Assets"
            Index["index.html"]:::frontend
            Map["map.html"]:::frontend
            ConfMapHTML["confmap.html"]:::frontend
            Public["public/"]:::infra
        end
        subgraph "In-Browser Processing"
            Parser["YAML/JSON Parser"]:::frontend
            ECharts["ECharts Renderer"]:::frontend
        end
    end

    %% Flows
    Main -->|imports| MainS
    Main --> Counter
    Main --> InputCSS
    Main --> StyleCSS
    Main --> TailwindCfg
    Main --> PostCSS
    Main --> ViteCfgTS
    Main --> TSConfig
    Main --> ViteEnv
    Main --> PackageJSON
    Main --> PackageLock

    Main -->|push code| GH
    GH -->|runs build| Build
    Build --> NetlifyToml
    Build --> BuildSh
    Build --> Wrangler
    Build --> WorkerJS
    Build --> DeployWorker
    Build --> Dockerfile
    Build --> DockerCompose
    Build --> NGINX

    Build --> Index
    Build --> Map
    Build --> ConfMapHTML
    Build --> Public

    Browser -->|GET assets| Index
    Browser -->|GET assets| Map
    Browser -->|GET assets| ConfMapHTML
    Browser -->|loads static| Public
    Browser -->|upload file| Parser
    Parser -->|data model| ECharts
    ECharts -->|render mindmap| Browser

    %% Click Events
    click Main "https://github.com/aksarav/confmap/blob/main/src/main.ts"
    click MainS "https://github.com/aksarav/confmap/blob/main/src/main-simple.ts"
    click Counter "https://github.com/aksarav/confmap/blob/main/src/counter.ts"
    click InputCSS "https://github.com/aksarav/confmap/blob/main/src/input.css"
    click StyleCSS "https://github.com/aksarav/confmap/blob/main/src/style.css"
    click TailwindCfg "https://github.com/aksarav/confmap/blob/main/tailwind.config.js"
    click PostCSS "https://github.com/aksarav/confmap/blob/main/postcss.config.js"
    click ViteCfgTS "https://github.com/aksarav/confmap/blob/main/vite.config.ts"
    click TSConfig "https://github.com/aksarav/confmap/blob/main/tsconfig.json"
    click ViteEnv "https://github.com/aksarav/confmap/blob/main/src/vite-env.d.ts"
    click PackageJSON "https://github.com/aksarav/confmap/blob/main/package.json"
    click PackageLock "https://github.com/aksarav/confmap/blob/main/package-lock.json"
    click GH "https://github.com/aksarav/confmap/tree/main/.github/"
    click NetlifyToml "https://github.com/aksarav/confmap/blob/main/netlify.toml"
    click BuildSh "https://github.com/aksarav/confmap/blob/main/build-for-netlify.sh"
    click Wrangler "https://github.com/aksarav/confmap/blob/main/wrangler.toml"
    click WorkerJS "https://github.com/aksarav/confmap/blob/main/cloudflare-worker.js"
    click DeployWorker "https://github.com/aksarav/confmap/blob/main/deploy-worker.sh"
    click Dockerfile "https://github.com/aksarav/confmap/tree/main/Dockerfile"
    click DockerCompose "https://github.com/aksarav/confmap/blob/main/docker-compose.yml"
    click NGINX "https://github.com/aksarav/confmap/blob/main/nginx.conf"
    click Index "https://github.com/aksarav/confmap/blob/main/index.html"
    click Map "https://github.com/aksarav/confmap/blob/main/map.html"
    click ConfMapHTML "https://github.com/aksarav/confmap/blob/main/confmap.html"
    click Public "https://github.com/aksarav/confmap/tree/main/public/"

    %% Styles
    classDef frontend fill:#e2f7e1,stroke:#2d8f2d,color:#2d8f2d;
    classDef infra fill:#e1ecf7,stroke:#2a5c9f,color:#2a5c9f;
    classDef code fill:#f5f0e1,stroke:#9f772a,color:#9f772a;
    classDef deployment fill:#fff2e1,stroke:#d18c2a,color:#d18c2a;
    classDef browser fill:#f0e1f7,stroke:#7a2a9f,color:#7a2a9f;
```
