# ektogamat/webgi-jewelry architecture

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

- Interactive diagram: https://gitdiagram.com/ektogamat/webgi-jewelry
- Repository: https://github.com/ektogamat/webgi-jewelry

## Overview

##### Project Type & Purpose
- This is a front-end, single-page, scroll-driven landing page template built in TypeScript using Parcel as a bundler. It leverages the WebGi 3D engine (a wrapper around Three.js), GSAP’s ScrollTrigger plugin for scroll-based animations, and SCSS for styling. There is no backend or database—everything is static and runs in the browser.

##### File Structure Analysis
- Top-level config and metadata:
- package.json / package-lock.json – dependency management and build scripts
- tsconfig.json / .sassrc – TypeScript and Sass configurations
- .gitignore / LICENSE.md / Readme.md
- Assets folder:
- GLB models (3D ring objects)
- Images, favicons, and audio files
- src folder:
- index.ts – application entry point, initializes WebGi scene and GSAP animations
- styles.scss / _variables.scss – global and variable-based styling
- index.html – the HTML scaffold that loads the JS bundle and stylesheet

a. Developer Machine & Build Pipeline
- Parcel Bundler (dev server and build step)
- TypeScript compiler + Babel (if used)
- Sass preprocessor
- Outputs: bundle.js, styles.css, asset copies
b. Runtime Environment (Browser)
- index.html loads bundle.js & styles.css
- WebGi Engine: sets up 3D WebGL context, loads .glb models from assets
- GSAP + ScrollTrigger: listens to scroll events, drives animations on the WebGi scene and DOM elements
- Audio module: loads and loops music
c. Static Asset Hosting
- Bundled files and assets served either by Parcel during dev or any static file server/CDN in production

##### Relationships & Data Flow
1. Developer writes TS and SCSS → Parcel
2. Parcel watches files (dev) or bundles (build) → emits JS/CSS + copies assets
3. Browser requests index.html → loads JS/CSS
4. JS initializes WebGi scene → fetches 3D models + textures/audio from `/assets`
5. GSAP ScrollTrigger listens for scroll → updates camera, object transforms, CSS properties
6. Browser renders frames continuously via WebGi’s Three.js loop

##### Architectural Patterns & Principles
- Modular code separation: rendering (WebGi), animation (GSAP), styling (SCSS)
- Build-time vs. runtime separation: bundling/preprocessing happens ahead of user interaction
- Single Responsibility: each TS module handles a distinct concern (scene setup, controls, UI)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Environment
    Developer["Developer (IDE)"]:::build

    %% Build Pipeline
    subgraph "Build Pipeline" 
        direction TB
        Parcel["Parcel Bundler\n(dev server & build)"]:::build
        TSC["TypeScript Compiler\n(tsconfig.json)"]:::build
        Sass["Sass Preprocessor\n(.sassrc)"]:::build
        Parcel -->|"compile & bundle"| TSC
        Parcel -->|"process styles"| Sass
    end

    %% Build Outputs & Config
    subgraph "Build Outputs & Config" 
        direction TB
        BundleJS["bundle.js"]:::build
        StylesCSS["styles.css"]:::build
        AssetsCopy["assets/*"]:::assets
        Parcel -->|"emit"| BundleJS
        Parcel -->|"emit"| StylesCSS
        Parcel -->|"copy"| AssetsCopy
    end

    %% Static Hosting
    StaticHost["Static Host / CDN"]:::runtime

    %% Browser Runtime
    subgraph "Browser / Runtime Environment"
        direction TB
        HTML["index.html"]:::runtime
        BundleJS -->|"load"| HTML
        StylesCSS -->|"load"| HTML

        subgraph "Runtime Components"
            direction TB
            WebGi["WebGi Engine"]:::runtime
            GSAP["GSAP ScrollTrigger"]:::runtime
            Audio["Audio Player"]:::runtime
            RenderLoop["Rendering Loop (Three.js)"]:::runtime
            HTML -->|"initialize"| WebGi
            HTML -->|"initialize"| GSAP
            HTML -->|"initialize"| Audio
            WebGi -->|"render frames"| RenderLoop
            GSAP -->|"on scroll"| RenderLoop
        end

        HTML -->|"GET /assets/*"| AssetsCopy
    end

    Developer -->|"writes TS & SCSS"| Parcel
    BundleJS -->|"serve"| StaticHost
    StylesCSS -->|"serve"| StaticHost
    AssetsCopy -->|"serve"| StaticHost
    StaticHost -->|"HTTP GET"| HTML

    %% Component Mapping Click Events
    click Parcel "https://github.com/ektogamat/webgi-jewelry/blob/main/package.json"
    click TSC "https://github.com/ektogamat/webgi-jewelry/blob/main/tsconfig.json"
    click Sass "https://github.com/ektogamat/webgi-jewelry/blob/main/.sassrc"
    click HTML "https://github.com/ektogamat/webgi-jewelry/blob/main/index.html"
    click BundleJS "https://github.com/ektogamat/webgi-jewelry/blob/main/src/index.ts"
    click StylesCSS "https://github.com/ektogamat/webgi-jewelry/blob/main/src/styles.scss"
    click Sass "https://github.com/ektogamat/webgi-jewelry/blob/main/src/_variables.scss"
    click AssetsCopy "https://github.com/ektogamat/webgi-jewelry/blob/main/assets/*.glb"
    click AssetsCopy "https://github.com/ektogamat/webgi-jewelry/tree/main/assets/images/"
    click AssetsCopy "https://github.com/ektogamat/webgi-jewelry/tree/main/assets/favicons/"
    click Audio "https://github.com/ektogamat/webgi-jewelry/blob/main/assets/sounds/music_loop.mp3"
    click Parcel "https://github.com/ektogamat/webgi-jewelry/blob/main/package-lock.json"
    click Parcel "https://github.com/ektogamat/webgi-jewelry/blob/main/package.json"
    click Developer "https://github.com/ektogamat/webgi-jewelry/blob/main/.gitignore"
    click Developer "https://github.com/ektogamat/webgi-jewelry/blob/main/Readme.md"
    click Developer "https://github.com/ektogamat/webgi-jewelry/blob/main/LICENSE.md"

    %% Styles
    classDef build fill:#bbdefb,stroke:#1e88e5,color:#0d47a1;
    classDef runtime fill:#c8e6c9,stroke:#43a047,color:#1b5e20;
    classDef assets fill:#fff9c4,stroke:#fdd835,color:#f57f17;
```
