# acidburn0zzz/uassetscdn architecture

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

- Interactive diagram: https://gitdiagram.com/acidburn0zzz/uassetscdn
- Repository: https://github.com/acidburn0zzz/uassetscdn

## Overview

##### Main Components Identification

The system should be represented with these key components:

a) Source Repository Layer
- GitHub repository (uAssetsCDN)
- Version control components

b) Content Distribution Layer
- Multiple CDN endpoints (mirrors)
- Distribution nodes

c) Filter Lists Organization
- Primary filters directory
- Thirdparties directory
- Patches directory

**[Source Repository] → [CDN Distribution Layer] → [End Users]**

##### Specific Details

a) File Organization:
- Hierarchical structure of filters
- Separation between uBlock's own filters and third-party lists
- Patch management system

b) Update Flow:
- How updates propagate from source to CDN endpoints
- Version control mechanism
- Demonstrate patch application process

##### Implementation Notes

- Core filter lists (default)
- Annoyance filters (optional)
- Third-party lists
- Patch management system

##### The redundancy provided by multiple mirrors

Keep the abstraction level focused on the CDN architecture while maintaining enough detail to show the filter list organization and distribution mechanism. This will provide a clear understanding of both the infrastructure and the content management aspects of the system.

Remember to indicate the relationship between the source repository and the various CDN endpoints, showing how updates flow through the system and eventually reach end users through multiple distribution points.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Source["Source Repository Layer"]
        GH[GitHub Repository]
        GA["GitHub Actions"]
        VC["Version Control"]:::version
    end

    subgraph Distribution["Content Distribution Layer"]
        direction TB
        CDN["CDN Distribution System"]
        subgraph Mirrors["CDN Mirrors"]
            direction TB
            GHP["GitHub Pages"]
            CFP["Cloudflare Pages"]
            JSD["jsDelivr"]
            STC["Statically.io"]
        end
    end

    subgraph Content["Content Organization"]
        direction TB
        subgraph Filters["Filter Lists"]
            direction TB
            CF["Core Filters"]:::core
            AF["Annoyance Filters"]:::annoyance
            PF["Privacy Filters"]:::privacy
            MF["Mobile Filters"]:::mobile
            RA["Resource Abuse"]:::resource
            UB["Unbreak Rules"]:::unbreak
            QF["Quick Fixes"]:::quickfix
        end

        subgraph ThirdParty["Third-party Lists"]
            direction TB
            EL["EasyList"]:::thirdparty
            EP["EasyPrivacy"]:::thirdparty
        end

        subgraph Config["Configuration"]
            direction TB
            AJ["assets.json"]:::config
            ADJ["assets.dev.json"]:::config
        end

        PM["Patch Management"]:::patch
    end

    GH --> GA
    GA --> VC
    VC --> CDN
    CDN --> Mirrors
    GHP --> EndUsers[("End Users")]
    CFP --> EndUsers
    JSD --> EndUsers
    STC --> EndUsers
    
    Filters --> CDN
    ThirdParty --> CDN
    PM --> CDN
    Config --> CDN

    %% Click Events
    click GA "https://github.com/acidburn0zzz/uAssetsCDN/blob/main//.github/workflows/main.yml"
    click CF "https://github.com/acidburn0zzz/uAssetsCDN/tree/main//filters/"
    click ThirdParty "https://github.com/acidburn0zzz/uAssetsCDN/tree/main//thirdparties/"
    click PM "https://github.com/acidburn0zzz/uAssetsCDN/tree/main//patches/"
    click AJ "https://github.com/acidburn0zzz/uAssetsCDN/blob/main//ublock/assets.json"
    click ADJ "https://github.com/acidburn0zzz/uAssetsCDN/blob/main//ublock/assets.dev.json"
    click VC "https://github.com/acidburn0zzz/uAssetsCDN/tree/main//version"
    click AF "https://github.com/acidburn0zzz/uAssetsCDN/blob/main//filters/annoyances.txt"
    click PF "https://github.com/acidburn0zzz/uAssetsCDN/blob/main//filters/privacy.txt"
    click EL "https://github.com/acidburn0zzz/uAssetsCDN/blob/main//thirdparties/easylist.txt"
    click EP "https://github.com/acidburn0zzz/uAssetsCDN/blob/main//thirdparties/easyprivacy.txt"
    click RA "https://github.com/acidburn0zzz/uAssetsCDN/blob/main//filters/resource-abuse.txt"
    click MF "https://github.com/acidburn0zzz/uAssetsCDN/blob/main//filters/filters-mobile.txt"
    click QF "https://github.com/acidburn0zzz/uAssetsCDN/blob/main//filters/quick-fixes.txt"
    click UB "https://github.com/acidburn0zzz/uAssetsCDN/blob/main//filters/unbreak.txt"

    %% Styles
    classDef core fill:#a8e6cf
    classDef annoyance fill:#dcedc1
    classDef privacy fill:#ffd3b6
    classDef mobile fill:#ffaaa5
    classDef resource fill:#ff8b94
    classDef unbreak fill:#98ddca
    classDef quickfix fill:#d4f0f0
    classDef thirdparty fill:#ffd700
    classDef config fill:#87ceeb
    classDef patch fill:#dda0dd
    classDef version fill:#b19cd9

    %% Legend
    subgraph Legend
        L1["Core Filters"]:::core
        L2["Annoyance Filters"]:::annoyance
        L3["Privacy Filters"]:::privacy
        L4["Mobile Filters"]:::mobile
        L5["Resource Protection"]:::resource
        L6["Unbreak Rules"]:::unbreak
        L7["Quick Fixes"]:::quickfix
        L8["Third-party Lists"]:::thirdparty
        L9["Configuration Files"]:::config
        L10["Patch System"]:::patch
        L11["Version Control"]:::version
    end
```
