# notnonex/cdn architecture

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

- Interactive diagram: https://gitdiagram.com/notnonex/cdn
- Repository: https://github.com/notnonex/cdn

## Overview

##### Main Components
- CDN Repository: The core repository that hosts all the resources (static HTML, CSS, JS, and images).
- DockerProxy Component: Represented by the DockerProxy directory and its index.html. This could serve as a specialized endpoint or proxy for Docker-related resource access.
- GitHubProxy Component: Represented by the GitHubProxy directory and its index.html, catering to GitHub-related proxy functions.
- External CDN Infrastructure: Although not directly part of the repository, the usage instructions show that the repository is accessed and refreshed via CDN endpoints (jsdelivr, statically, and purge endpoints).

##### Relationships and Interactions
- The CDN Repository is central, with DockerProxy and GitHubProxy being subcomponents that offer specific functionalities or proxy pages.
- Static resources (HTML, CSS, JS, IMG) interact by being loaded into web pages that are accessed through the CDN.
- That there is an update/refresh mechanism (the purge endpoint) that invalidates cached content on CDN servers.

##### Architectural Patterns and Design Principles
- Simple static resource delivery with a focus on separation of concerns: Each proxy (DockerProxy and GitHubProxy) is isolated in its own directory to handle its specific domain.
- Emphasis on resource decoupling: The central repository is used as a source of truth for content that is propagated via the CDN.
- Use of clear naming conventions which convey the purpose of each component (e.g., “Proxy” in DockerProxy and GitHubProxy).

##### Relevant Technologies and Frameworks (Inferred from Context)
- HTML, CSS, JS for the frontend.
- CDN services provided through jsDelivr and Statically.
- GitHub as the version-controlled source for the repository.
- Although not explicitly mentioned, backend components are minimal since the project is entirely static.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Entities
    EU("End Users"):::external

    %% CDN Service Components
    CDN("CDN Infrastructure (jsDelivr/Stally)"):::external
    PE("Purge Endpoint (Cache Invalidation)"):::purge

    %% Repository and its Subcomponents
    REPO("CDN Repository (Static Resources)"):::cdnRepository
    DP("DockerProxy: index.html"):::proxy
    GP("GitHubProxy: index.html"):::proxy
    IMG("IMG Assets"):::imgAssets

    %% IMG Asset Categories
    IMG_avatar("avatar"):::imgAssets
    IMG_box("box"):::imgAssets
    IMG_bthl("bthl"):::imgAssets
    IMG_geometry("geometry"):::imgAssets
    IMG_pay("pay"):::imgAssets
    IMG_star("star"):::imgAssets

    %% Connections
    EU -->|"requests"| CDN
    CDN -->|"fetches"| REPO
    REPO -->|"serves"| DP
    REPO -->|"serves"| GP
    REPO -->|"contains"| IMG
    IMG -->|"includes"| IMG_avatar
    IMG -->|"includes"| IMG_box
    IMG -->|"includes"| IMG_bthl
    IMG -->|"includes"| IMG_geometry
    IMG -->|"includes"| IMG_pay
    IMG -->|"includes"| IMG_star
    REPO -->|"triggers"| PE
    PE -->|"invalidates-cache"| CDN
    CDN -->|"delivers"| EU

    %% Click Events
    click REPO "https://github.com/notnonex/cdn/blob/master/."
    click DP "https://github.com/notnonex/cdn/blob/master/DockerProxy/index.html"
    click GP "https://github.com/notnonex/cdn/blob/master/GitHubProxy/index.html"
    click IMG "https://github.com/notnonex/cdn/tree/master/img"

    %% Styles
    classDef cdnRepository fill:#F2D7D5,stroke:#C0392B,stroke-width:2px;
    classDef proxy fill:#D5F5E3,stroke:#27AE60,stroke-width:2px;
    classDef imgAssets fill:#D6EAF8,stroke:#2980B9,stroke-width:2px;
    classDef external fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef purge fill:#FAD7A0,stroke:#E67E22,stroke-width:2px;
```
