# cyclotruc/clickplanet architecture

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

- Interactive diagram: https://gitdiagram.com/cyclotruc/clickplanet
- Repository: https://github.com/cyclotruc/clickplanet

## Overview

##### Project type and purpose
- This is a client-side single-page application (SPA) that renders an interactive world map (clickplanet) entirely in the browser.
- It’s served as a static website (GitHub Pages), with no dynamic backend or database.

##### File structure
- Top level:
- README.md – project overview and GitHub Pages link
- index.html – entry point for the SPA
- assets/ – compiled JavaScript and CSS bundles (hashed filenames indicate a bundler like Vite or Webpack)
- static/ – geo-data and image assets (coordinates.json, countries/*.json, PNG/SVG tiles, earth textures)
- Pattern: a build step packages JS/CSS into the assets folder; static data lives in its own directory for client-side fetch.

##### README for additional insights
- The README only points to the live GitHub Pages site, confirming it’s purely front-end.
- No backend or cloud services are mentioned.

##### Detail
- Do not overcomplicate—focus on the SPA hosting pattern and client-side data flow

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Static Hosting
    subgraph "Static Hosting" 
        GH["GitHub Pages CDN"]:::infrastructure
        README["README.md"]:::infrastructure
    end

    %% Build Pipeline
    subgraph "Build Pipeline"
        Pipeline["Bundler (Vite/Webpack)"]:::infrastructure
        AssetsDir["assets/ (output)"]:::infrastructure
    end

    %% Client Browser
    subgraph "Browser Client"
        Browser["Browser"]:::infrastructure
        Entry["index.html"]:::module
        subgraph "Client-Side Application"
            UI["UI Module (HTML/CSS)"]:::module
            Loader["Loader Module (fetch JSON/images)"]:::module
            Renderer["Renderer Module (WebGL/Canvas)"]:::module
        end
    end

    %% Bundled Code Assets
    subgraph "Bundled Assets" 
        JS1["index-20_mA51c.js"]:::code
        JS2["index-D1XawkcN.js"]:::code
        JS3["index-DnMbTTy9.js"]:::code
        CSS["index-BXB-jvQ7.css"]:::code
    end

    %% Static Data Store
    subgraph "Static Data" 
        Geo["coordinates.json"]:::data
        Atlas["countries/atlas.json"]:::data
        CountriesList["countries/countries.json"]:::data
        CustomDir["countries/custom"]:::data
        PNGDir["countries/png100px"]:::data
        SVGDir["countries/svg"]:::data
        EarthTex["earth textures"]:::data
    end

    %% Connections
    GH -->|"HTTP GET index.html"| Entry
    Entry -->|"loads CSS"| CSS
    Entry -->|"loads JS bundles"| JS1
    Entry -->|"loads JS bundles"| JS2
    Entry -->|"loads JS bundles"| JS3

    JS1 -->|"initializes UI"| UI
    JS2 -->|"calls Loader"| Loader
    JS3 -->|"sets up Renderer"| Renderer

    Loader -->|"fetch static data"| Geo
    Loader -->|"fetch static data"| Atlas
    Loader -->|"fetch static data"| CountriesList
    Loader -->|"fetch static data"| CustomDir
    Loader -->|"fetch static data"| PNGDir
    Loader -->|"fetch static data"| SVGDir
    Loader -->|"fetch static data"| EarthTex

    Pipeline -->|"outputs to"| AssetsDir
    AssetsDir --> GH

    Browser --> Entry
    Entry --> UI
    UI --> Renderer
    Renderer --> UI

    %% Click Events
    click Entry "https://github.com/cyclotruc/clickplanet/blob/main/index.html"
    click JS1 "https://github.com/cyclotruc/clickplanet/blob/main/assets/index-20_mA51c.js"
    click JS2 "https://github.com/cyclotruc/clickplanet/blob/main/assets/index-D1XawkcN.js"
    click JS3 "https://github.com/cyclotruc/clickplanet/blob/main/assets/index-DnMbTTy9.js"
    click CSS "https://github.com/cyclotruc/clickplanet/blob/main/assets/index-BXB-jvQ7.css"
    click Geo "https://github.com/cyclotruc/clickplanet/blob/main/static/coordinates.json"
    click Atlas "https://github.com/cyclotruc/clickplanet/blob/main/static/countries/atlas.json"
    click CountriesList "https://github.com/cyclotruc/clickplanet/blob/main/static/countries/countries.json"
    click CustomDir "https://github.com/cyclotruc/clickplanet/tree/main/static/countries/custom"
    click PNGDir "https://github.com/cyclotruc/clickplanet/tree/main/static/countries/png100px"
    click SVGDir "https://github.com/cyclotruc/clickplanet/tree/main/static/countries/svg"
    click EarthTex "https://github.com/cyclotruc/clickplanet/tree/main/static/earth"
    click README "https://github.com/cyclotruc/clickplanet/blob/main/README.md"

    %% Styles
    classDef infrastructure fill:#D0E8FF,stroke:#0366d6;
    classDef module fill:#E6FFEA,stroke:#28a745;
    classDef code fill:#FFF5E6,stroke:#D69E00;
    classDef data fill:#FFF0F0,stroke:#d73a49;
```
