# guoyuhan/customizer architecture

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

- Interactive diagram: https://gitdiagram.com/guoyuhan/customizer
- Repository: https://github.com/guoyuhan/customizer

## Overview

##### Main System Components

A. Frontend Application Layer
- Vue.js Application Core
- Component Structure
- State Management (Vuex Store)
- 3D Rendering Engine

B. Asset Management Layer
- Static Resources
- 3D Models
- Decoders

C. Customization Engine Layer
- Image Processing
- Shader Management
- UV Mapping
- Model Manipulation

##### Component Relationships

a) Core Application Components (Top Level):
- Main App.vue component at the top level
- It to the store management system

b) Customizer Components (Second Level):
- Customizer components (CustomizerView, FontCustomizer, ImageCustomizer, WCustomizer)
- Their relationship to the 3D rendering system
- Connections to the Vuex store

c) Asset Management (Side Layer):
- Draco decoder integration
- To the loading utilities

d) Utilities and Services (Bottom Layer):
- Utility functions
- API services
- Shader and image processing tools

##### Specific Implementation Details

Use these visual elements:

- Blue containers for Vue.js components
- Green containers for 3D processing elements
- Yellow containers for utility services
- Red containers for asset management
- Purple containers for state management

##### Data Flow Indicators

Key interactions:

##### Technical Stack Highlights

Technology indicators:

- Vue.js framework
- Three.js (implied by GLB models)
- Draco decoder
- Custom shader system
- Image processing utilities

##### Key Architectural Patterns

Patterns:

- Component-based architecture
- Centralized state management
- Asset pipeline
- Custom shader system
- Image processing workflow

**┌─────────────────────────────────────────┐**
- Vue.js Application           │
- ┤
- Components  │  3D Renderer │   Store    │
- ┤
- Customization Engine                    │
- ┤
- Asset Management                        │
- ┘

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Frontend Application Layer"
        App["App.vue"]
        MainJS["main.js"]
        
        subgraph "Components"
            CV["CustomizerView"]
            FC["FontCustomizer"]
            IC["ImageCustomizer"]
            WC["WCustomizer"]
        end
        
        subgraph "State Management"
            Store["Vuex Store"]
            CStore["Customizer Store"]
        end
    end
    
    subgraph "Asset Management Layer"
        subgraph "3D Models"
            AC["Authentic Classic Model"]
            BS["Binding Stitches"]
            LS["Lining Stitches"]
            PM["Personalization Model"]
        end
        
        subgraph "Decoders"
            DD["Draco Decoder"]
            DW["Draco WASM"]
        end
    end
    
    subgraph "Customization Engine Layer"
        subgraph "Core Utils"
            CU["Customizer Utils"]
            IT["Image Tools"]
            LU["Loading Utils"]
        end
        
        subgraph "Shader System"
            CS["Custom Shader"]
            UV["UV Mapping"]
        end
        
        subgraph "Configuration"
            Env["Environment Config"]
            MD["Models Data"]
            OD["Options Data"]
        end
    end
    
    App --> MainJS
    App --> CV
    CV --> FC
    CV --> IC
    CV --> WC
    
    Store --> CStore
    CStore --> CV
    
    CV --> CU
    CU --> CS
    CU --> IT
    CU --> LU
    
    LU --> DD
    DD --> DW
    
    CS --> UV
    
    %% Click events for component mapping
    click App "https://github.com/GUOYUHAN/customizer/blob/master/src/App.vue"
    click MainJS "https://github.com/GUOYUHAN/customizer/blob/master/src/main.js"
    click CV "https://github.com/GUOYUHAN/customizer/blob/master/src/components/CustomizerView.vue"
    click FC "https://github.com/GUOYUHAN/customizer/blob/master/src/components/FontCustomizer.vue"
    click IC "https://github.com/GUOYUHAN/customizer/blob/master/src/components/ImageCustomizer.vue"
    click WC "https://github.com/GUOYUHAN/customizer/blob/master/src/components/WCustomizer.vue"
    click Store "https://github.com/GUOYUHAN/customizer/blob/master/src/store/index.js"
    click CStore "https://github.com/GUOYUHAN/customizer/blob/master/src/store/customizer/index.js"
    click AC "https://github.com/GUOYUHAN/customizer/blob/master/public/static/models/authentic-classic-9.0.glb"
    click BS "https://github.com/GUOYUHAN/customizer/blob/master/public/static/models/binding_stitches.glb"
    click LS "https://github.com/GUOYUHAN/customizer/blob/master/public/static/models/lining_stitches.glb"
    click PM "https://github.com/GUOYUHAN/customizer/blob/master/public/static/models/personalization.glb"
    click DD "https://github.com/GUOYUHAN/customizer/blob/master/public/static/decoder/draco_decoder.js"
    click DW "https://github.com/GUOYUHAN/customizer/blob/master/public/static/decoder/draco_decoder.wasm"
    click CU "https://github.com/GUOYUHAN/customizer/blob/master/src/utils/customizer/index.js"
    click CS "https://github.com/GUOYUHAN/customizer/blob/master/src/utils/customizer/customShader.js"
    click IT "https://github.com/GUOYUHAN/customizer/blob/master/src/utils/customizer/imageTools.js"
    click LU "https://github.com/GUOYUHAN/customizer/blob/master/src/utils/customizer/load.js"
    click UV "https://github.com/GUOYUHAN/customizer/blob/master/src/utils/customizer/shader_uv.json"
    click Env "https://github.com/GUOYUHAN/customizer/blob/master/src/config/env.js"
    click MD "https://github.com/GUOYUHAN/customizer/blob/master/src/data/models.json"
    click OD "https://github.com/GUOYUHAN/customizer/blob/master/src/data/options.json"

    classDef vue fill:#41B883,stroke:#35495E,color:white
    classDef store fill:#7957D5,stroke:#34495E,color:white
    classDef asset fill:#FF6B6B,stroke:#CC5959,color:white
    classDef util fill:#FFD93D,stroke:#CC8500,color:black
    classDef shader fill:#4FC08D,stroke:#3DA57A,color:white
    
    class App,MainJS,CV,FC,IC,WC vue
    class Store,CStore store
    class AC,BS,LS,PM,DD,DW asset
    class CU,IT,LU,Env,MD,OD util
    class CS,UV shader
```
