# xrrca/creativecoding architecture

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

- Interactive diagram: https://gitdiagram.com/xrrca/creativecoding
- Repository: https://github.com/xrrca/creativecoding

## Overview

##### Project type and purpose
- This is an open-source, static content repository (“CreativeCoding”) serving as an online guide and resource collection for creative coding.
- It provides runnable examples in four main domains: JavaScript (p5.js & vanilla), PureData patches, Python scripts, and TouchDesigner projects.
- There is no dynamic backend or database; the site is hosted via GitHub Pages (static hosting), and the examples are either executed client-side in the browser or run locally by the user.

##### File structure
- Top-level folders:
- js/ – all browser-based demos (each subfolder is a self-contained HTML/CSS/JS sketch)
- puredata/ – .pd patch files and related assets or Python OSC handlers for PureData
- py/ – Python scripts with their own requirements.txt and example ZIPs
- touchdesigner/ – .toe project files (TouchDesigner) plus models, textures, or Python scripts
- Root files (README.md, LICENSE, CONTRIBUTING.md) describe the site, contribution process, and licensing.
- There are no build scripts or server code—this is purely static content.

##### README for additional insights
- The README confirms that you download or navigate to specific example folders and open the HTML, .pd, .py, or .toe files locally or via a live demo link.
- It links to a site (xrrca.github.io/CreativeCoding/) and a Wiki for more structured documentation.

a. Main components
- Repository (GitHub) – source of truth for content
- Build/Publish Pipeline – GitHub Pages (Jekyll or default Pages engine)
- Hosting – GitHub Pages serving static files via HTTPS CDN
- Content Categories – four logical groups: JS examples, PureData patches, Python scripts, TouchDesigner projects
- End Users – developers or learners who browse the site, clone/download the repo, and run examples
- External Dependencies – p5.js or other JS libraries (via CDN), Python packages (PyPI), PureData engine, TouchDesigner application

b. Relationships and interactions
- Developers push commits → GitHub repo
- On push → GitHub Pages automatically builds/updates the static site
- End user’s browser requests pages from GitHub Pages CDN → serves HTML/CSS/JS → loads JS examples in‐browser
- For PureData/Python/TouchDesigner examples, user downloads or clones repo → runs patches or scripts locally with required runtimes
- JS examples reference external libraries (p5.js CDN or local includes)

c. Architectural patterns or design principles
- Static site model (no backend, CDN-served assets)
- Content modularity: each example is self-contained in its own folder
- Separation of concerns: grouping by technology domain for discoverability

d. Key technologies/frameworks/libraries
- Git/GitHub for version control & hosting
- GitHub Pages for static site deployment (Jekyll or plain HTML)
- p5.js or vanilla JavaScript for browser sketches
- PureData for audio/visual patching
- Python + OpenCV/OSC libraries for scripting examples
- TouchDesigner for real-time visual projects

##### Detail
- Every critical step: commit, build, deploy, host, serve, run.
- Four content domains individually so reviewers can see parallel example tracks.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Users
    Developer["Developer"]:::user
    Browser["Browser"]:::user
    UserLocal["End User Local Environment"]:::user

    %% Repository & Docs
    subgraph "GitHub Repository" 
        Repo["Source of Truth"]:::repo
        subgraph "Documentation & Guidelines"
            README["README.md"]:::repo
            CONTRIBUTING["CONTRIBUTING.md"]:::repo
            LICENSE["LICENSE"]:::repo
        end
    end

    %% Build & Hosting
    Build["GitHub Pages Build"]:::build
    Hosting["GitHub Pages CDN"]:::hosting

    %% Content Categories
    subgraph "JavaScript Examples" 
        jsExamples["js/"]:::content
        subgraph "audio-reactive-simple"
            ARS["audio-reactive-simple"]:::content
        end
        subgraph "nodejs-arduino"
            NA["nodejs-arduino"]:::content
        end
    end

    subgraph "PureData Patches"
        puredata["puredata/"]:::content
        subgraph "arduino_serial"
            ArduinoSerial["arduino_serial_patch.pd"]:::content
        end
        subgraph "data_sonification"
            DataSon["data_sonification_patch.pd"]:::content
        end
    end

    subgraph "Python Scripts"
        pythonScripts["py/"]:::content
        subgraph "api-weather"
            Weather["api-weather.py"]:::content
        end
        subgraph "opencv-handtracking-osc"
            HandTrack["opencv-handtracking-osc.py"]:::content
        end
        subgraph "stable-diffusion"
            SD["main.py"]:::content
        end
    end

    subgraph "TouchDesigner Projects"
        touchProj["touchdesigner/"]:::content
        subgraph "3d-simple"
            Simple3D["3d-simple.toe"]:::content
        end
        subgraph "opencv-background-removal"
            BGRemToe["opencv-background-removal.toe"]:::content
        end
    end

    %% External Dependencies
    p5cdn["p5.js CDN"]:::external
    PyPI["PyPI"]:::external
    PDengine["PureData Engine"]:::external
    TDapp["TouchDesigner App"]:::external

    %% Flows
    Developer -->|"git push"| Repo
    Repo -->|on push| Build
    Build -->|deploy| Hosting
    Hosting -->|HTTP GET| Browser
    Browser -->|"loads examples in-browser"| jsExamples
    Browser -->|"loads examples in-browser"| jsExamples
    Hosting -->|"serves static files"| puredata
    Hosting -->|"serves static files"| pythonScripts
    Hosting -->|"serves static files"| touchProj

    Browser -->|"load library"| p5cdn
    puredata -->|"run patch"| PDengine
    pythonScripts -->|"install packages"| PyPI
    touchProj -->|"run project"| TDapp

    Browser -->|"download & run locally"| UserLocal
    UserLocal -->|run locally| puredata
    UserLocal -->|run locally| pythonScripts
    UserLocal -->|run locally| touchProj

    %% Relationships inside Content
    jsExamples --> ARS
    jsExamples --> NA

    puredata --> ArduinoSerial
    puredata --> DataSon

    pythonScripts --> Weather
    pythonScripts --> HandTrack
    pythonScripts --> SD

    touchProj --> Simple3D
    touchProj --> BGRemToe

    %% Click Events
    click Repo "https://github.com/xrrca/creativecoding/tree/main/./"
    click README "https://github.com/xrrca/creativecoding/blob/main/README.md"
    click CONTRIBUTING "https://github.com/xrrca/creativecoding/blob/main/CONTRIBUTING.md"
    click LICENSE "https://github.com/xrrca/creativecoding/tree/main/LICENSE"
    click jsExamples "https://github.com/xrrca/creativecoding/tree/main/js/"
    click ARS "https://github.com/xrrca/creativecoding/tree/main/js/audio-reactive-simple/"
    click NA "https://github.com/xrrca/creativecoding/tree/main/js/nodejs-arduino/"
    click ArduinoSerial "https://github.com/xrrca/creativecoding/tree/main/puredata/arduino_serial/"
    click DataSon "https://github.com/xrrca/creativecoding/tree/main/puredata/data_sonification/"
    click Weather "https://github.com/xrrca/creativecoding/blob/main/py/api-weather/api-weather.py"
    click HandTrack "https://github.com/xrrca/creativecoding/blob/main/py/opencv-handtracking-osc/opencv-handtracking-osc.py"
    click SD "https://github.com/xrrca/creativecoding/blob/main/py/stable-diffusion/main.py"
    click Simple3D "https://github.com/xrrca/creativecoding/blob/main/touchdesigner/3d-simple/3d-simple.toe"
    click BGRemToe "https://github.com/xrrca/creativecoding/blob/main/touchdesigner/opencv-background-removal/opencv-background-removal.toe"

    %% Styles
    classDef repo fill:#D0E4F5,stroke:#1E70BF,color:#1E70BF
    classDef build fill:#B3D9FF,stroke:#1E57D0,color:#1E57D0
    classDef hosting fill:#D0F5D6,stroke:#2E8B2E,color:#2E8B2E
    classDef content fill:#FFF3BF,stroke:#E1A100,color:#E1A100
    classDef user fill:#FFE5B4,stroke:#E69500,color:#E69500
    classDef external fill:#E8E8E8,stroke:#7A7A7A,color:#7A7A7A
```
