# theabbie/doublependulum architecture

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

- Interactive diagram: https://gitdiagram.com/theabbie/doublependulum
- Repository: https://github.com/theabbie/doublependulum

## Overview

##### Project type and purpose
- This is a single-page, client-side web application (“Double Pendulum Playground”) that runs entirely in the browser.
- Purpose: let users experiment with a double-pendulum physics simulation rendered via SVG, with real-time visualization and user‐controlled parameters.

##### File structure
- Top level:
- index.html – entry point containing all HTML, CSS, and JavaScript.
- .nojekyll – signals GitHub Pages to bypass Jekyll processing.
- .github/, CODE_OF_CONDUCT.md, CONTRIBUTING.md, LICENSE – repository metadata.
- No separate “src” or “backend” directories → the entire logic (ODE integration, UI, rendering) lives in the browser.

##### README for additional insights
- Describes the governing differential equations and user interaction.
- Mentions hosting on GitHub Pages: static-site deployment.
- No server-side components or microservices.

##### Main components and their interactions
a. Static Host (GitHub Pages)
- Hosts index.html and assets; serves them over HTTPS.
b. Browser / Client Application
- Module: Physics Engine
- Reads user inputs (masses, lengths, initial angles).
- Numerically integrates the double-pendulum ODEs each animation frame.
- Module: Renderer (SVG)
- Draws pendulum arms and bobs in an SVG tree.
- Updates positions on each simulation tick.
- Module: User Interface
- Sliders or input fields for parameters.
- “Play/Pause” controls.
c. User
- Interacts with UI controls in the browser.

##### Architectural patterns and design principles
- Single-Page Application (SPA) pattern, though minimal: separation of concerns between Model (physics), View (SVG), and Controller (input handlers).
- Event-driven design: user events trigger state updates → re-render cycle.

- Clear labels on each node (e.g., “Physics Engine”, “SVG Renderer”).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User
    User((User)):::user

    %% Static Host
    StaticHost["Static Host<br>(GitHub Pages)"]:::external

    %% Browser Client Modules
    subgraph "Browser (Client)"
        UIController["UI Controller"]:::modules
        PhysicsEngine["Physics Engine<br>(Runge-Kutta 4)"]:::modules
        SVGRenderer["SVG Renderer"]:::modules
    end

    %% Repository Metadata
    subgraph "Repository Metadata"
        MetadataGh[".github/"]:::metadata
        CODE["CODE_OF_CONDUCT.md"]:::metadata
        CONTRIB["CONTRIBUTING.md"]:::metadata
        LICENSE["LICENSE"]:::metadata
        README["README.md"]:::metadata
    end

    %% Connections
    StaticHost -->|"HTTP GET index.html"| UIController
    User -->|"mouse/keyboard events"| UIController
    UIController -->|"parameter updates"| PhysicsEngine
    PhysicsEngine -->|"position data"| SVGRenderer

    %% Click Events
    click StaticHost "https://github.com/theabbie/doublependulum/blob/master/index.html"
    click StaticHost "https://github.com/theabbie/doublependulum/blob/master/.nojekyll"
    click UIController "https://github.com/theabbie/doublependulum/blob/master/index.html"
    click PhysicsEngine "https://github.com/theabbie/doublependulum/blob/master/index.html"
    click SVGRenderer "https://github.com/theabbie/doublependulum/blob/master/index.html"
    click MetadataGh "https://github.com/theabbie/doublependulum/tree/master/.github/"
    click CODE "https://github.com/theabbie/doublependulum/blob/master/CODE_OF_CONDUCT.md"
    click CONTRIB "https://github.com/theabbie/doublependulum/blob/master/CONTRIBUTING.md"
    click LICENSE "https://github.com/theabbie/doublependulum/tree/master/LICENSE"
    click README "https://github.com/theabbie/doublependulum/blob/master/README.md"

    %% Styles
    classDef external fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef modules fill:#90EE90,stroke:#000,stroke-width:1px,stroke-dasharray: 2 2;
    classDef user fill:#FFFACD,stroke:#000,stroke-width:1px;
    classDef metadata fill:#D3D3D3,stroke:#000,stroke-width:1px;
```
