# juliangarnier/3d-hartwig-chess-set architecture

> Architecture diagram of the GitHub repository juliangarnier/3d-hartwig-chess-set, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/juliangarnier/3d-hartwig-chess-set
- Repository: https://github.com/juliangarnier/3d-hartwig-chess-set

## Overview

##### Project type and purpose
- This is a front-end only, browser-based 3D chess game implemented in HTML, CSS, and JavaScript.
- It has no backend or database; it runs entirely in WebKit-based browsers.
- It uses two external JavaScript libraries: Photon (for 3D rendering/physics) and Chess.js (for chess rules and move validation).

##### File structure
- Top-level files:
- index.html – main HTML entry point
- README.md, LICENSE.txt, .gitignore – metadata
- Directories:
- css/ – contains styles.css for layout and visual styling
- img/ – image assets, textures for the board and pieces
- js/ – application logic and bundled libraries
– js/libraries.js aggregates Photon.js and Chess.js
– js/app.js contains the game initialization, event handling, and rendering glue
- mckps/ – (likely additional assets or placeholders; treat as static assets)

##### README for additional insights
- Confirms it’s a 3D chess game demo hosted via CodePen.
- Mentions dependencies:
- Photon (3D engine)
- Chess.js (game rules)
- No server-side components or API layers.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Actors
    User["User (Player)"]
    Browser["Web Browser (WebKit)"]

    %% Browser Container
    subgraph "Browser Environment"
        direction TB
        HTML["index.html: Entry Point"]:::entry
        CSS["styles.css: Presentation Layer"]:::asset
        subgraph "Static Assets"
            direction TB
            IMG["Image Assets (textures/sprites)"]:::asset
            MCKPS["mckps/: Static Assets"]:::asset
        end
        Canvas["WebGL Canvas"]:::asset
        subgraph "JavaScript Layer"
            direction TB
            LIB["libraries.js: External Libraries"]:::external
            APP["app.js: Game Controller"]:::custom
        end
        subgraph "Engine & Rules"
            direction TB
            CHESS["Chess.js: Game Rules"]:::external
            PHOT["Photon Engine: 3D Rendering"]:::external
        end
    end

    %% Metadata Container
    subgraph "Project Metadata"
        README["README.md"]:::metadata
        LICENSE["LICENSE.txt"]:::metadata
        GIT[".gitignore"]:::metadata
    end

    %% Interactions
    User -->|"interacts with UI"| Canvas
    Browser --> HTML
    HTML -->|"loads stylesheet"| CSS
    HTML -->|"loads scripts"| LIB
    HTML -->|"loads scripts"| APP
    CSS -->|"references textures"| IMG
    APP -->|"validates moves"| CHESS
    APP -->|"renders scene"| PHOT
    PHOT -->|"uses textures/models"| IMG
    PHOT -->|"uses assets"| MCKPS
    APP -->|"draws on"| Canvas

    %% Click Events
    click HTML "https://github.com/juliangarnier/3d-hartwig-chess-set/blob/master/index.html"
    click CSS "https://github.com/juliangarnier/3d-hartwig-chess-set/blob/master/css/styles.css"
    click APP "https://github.com/juliangarnier/3d-hartwig-chess-set/blob/master/js/app.js"
    click LIB "https://github.com/juliangarnier/3d-hartwig-chess-set/blob/master/js/libraries.js"
    click IMG "https://github.com/juliangarnier/3d-hartwig-chess-set/tree/master/img/"
    click MCKPS "https://github.com/juliangarnier/3d-hartwig-chess-set/tree/master/mckps/"
    click README "https://github.com/juliangarnier/3d-hartwig-chess-set/blob/master/README.md"
    click LICENSE "https://github.com/juliangarnier/3d-hartwig-chess-set/blob/master/LICENSE.txt"
    click GIT "https://github.com/juliangarnier/3d-hartwig-chess-set/blob/master/.gitignore"

    %% Styles
    classDef entry fill:#e0f7fa,stroke:#006064,color:#006064;
    classDef asset fill:#eceff1,stroke:#90a4ae,color:#455a64;
    classDef external fill:#e3f2fd,stroke:#1e88e5,color:#0d47a1;
    classDef custom fill:#e8f5e9,stroke:#43a047,color:#1b5e20;
    classDef metadata fill:#fff8e1,stroke:#ffb300,color:#ff6f00;
```
