# tadanobutaaaaa/vrc_avatar_library architecture

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

- Interactive diagram: https://gitdiagram.com/tadanobutaaaaa/vrc_avatar_library
- Repository: https://github.com/tadanobutaaaaa/vrc_avatar_library

## Overview

##### Main Components
- Frontend User Interface:
- Located in the "frontend" directory.
- Contains entry points like index.html, main.jsx, and several React components and pages (e.g., home.jsx, manual.jsx, processing.jsx, result.jsx, setupProcess.jsx).
- Utilizes Vite as the build tool (see vite.config.js) with supporting configurations for integrating with the Wails runtime (notably in the "frontend/wailsjs" folder that contains Go API bindings and runtime scripts).

- Backend Service:
- Built using Go, as seen from files like app.go, githubAPI.go, goServer.go, and main.go.
- Go modules configured via go.mod and go.sum.
- The backend contains business logic that likely powers functionality related to handling avatar data or processing VRChat avatars.

- Wails Integration and Configuration:
- The presence of the wails.json file indicates configuration details for the Wails framework, providing the glue between the Go backend and the web-based frontend.
- This integration allows for seamless calling of Go functions from the frontend through JavaScript APIs, as evidenced by folders like "frontend/wailsjs".

- Build and Deployment Artifacts:
- The "build" directory has subdirectories for different platforms (darwin for macOS and windows for Windows), including installer scripts and manifest/installer files.
- This shows that the project includes a packaging pipeline for distributing the desktop application on multiple operating systems.

##### Relationships and Interactions
- Communication Flow:
- The frontend (React) communicates with the backend (Go) via the Wails framework. This is typically achieved through well-defined API calls which may use websockets or other inter-process communication methods (hinted at by frontend/src/hooks/goWebSocket.jsx).

- Build Pipeline:
- A component that represents the multi-platform build system. This involves separate build artifacts for macOS and Windows, perhaps showing them as output from the build process that compiles and packages the application.

##### Architectural Patterns and Technologies
- Wails Framework:
- That the system leverages Wails to integrate a Go backend with a modern web UI, bridging native OS features with a responsive frontend.
- Full-Stack (Desktop Application) Architecture:
- The separation of concerns is clear: the UI is independently developed in the frontend, while business and system logic lives in the Go backend.
- Use of Modern Web Technologies:
- React components, Vite build tool, and JavaScript modules are crucial to the functioning of the UI, along with the inclusion of helper libraries (as seen in the "frontend/src/components/ui" folder).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend (React/Vite)"
        FE_UI["UI (React Components & Vite)"]:::frontend
    end

    %% Wails Integration Layer
    subgraph "Wails Integration"
        WI_JSON["wails.json"]:::integration
        WI_JS["WailsJS Bindings"]:::integration
    end

    %% Backend Layer
    subgraph "Backend (Go)"
        BG_app["app.go"]:::backend
        BG_main["main.go"]:::backend
        BG_github["githubAPI.go"]:::backend
        BG_goServer["goServer.go"]:::backend
        BG_mod["go.mod & go.sum"]:::backend
    end

    %% Build & Deployment Layer
    subgraph "Build & Deployment"
        Build_darwin["build/darwin"]:::build
        Build_windows["build/windows"]:::build
    end

    %% Connections between layers
    FE_UI -->|"WailsAPICall"| WI_JSON
    WI_JSON -->|"Bridge"| WI_JS
    WI_JS -->|"Trigger Go functions"| BG_app
    %% Assuming backend components work together
    BG_app --> BG_main
    BG_app --> BG_github
    BG_app --> BG_goServer
    BG_app --> BG_mod

    %% Build process connections
    BG_main -->|"PackageApp"| Build_darwin
    BG_main -->|"PackageApp"| Build_windows
    FE_UI -->|"BundleAssets"| Build_darwin
    FE_UI -->|"BundleAssets"| Build_windows

    %% Click Events
    click FE_UI "https://github.com/tadanobutaaaaa/vrc_avatar_library/tree/main/frontend/"
    click BG_app "https://github.com/tadanobutaaaaa/vrc_avatar_library/blob/main/app.go"
    click BG_main "https://github.com/tadanobutaaaaa/vrc_avatar_library/blob/main/main.go"
    click BG_github "https://github.com/tadanobutaaaaa/vrc_avatar_library/blob/main/githubAPI.go"
    click BG_goServer "https://github.com/tadanobutaaaaa/vrc_avatar_library/blob/main/goServer.go"
    click BG_mod "https://github.com/tadanobutaaaaa/vrc_avatar_library/blob/main/go.mod"
    click WI_JSON "https://github.com/tadanobutaaaaa/vrc_avatar_library/blob/main/wails.json"
    click WI_JS "https://github.com/tadanobutaaaaa/vrc_avatar_library/tree/main/frontend/wailsjs"
    click Build_darwin "https://github.com/tadanobutaaaaa/vrc_avatar_library/tree/main/build/darwin"
    click Build_windows "https://github.com/tadanobutaaaaa/vrc_avatar_library/tree/main/build/windows"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef backend fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef integration fill:#FFD700,stroke:#000,stroke-width:2px;
    classDef build fill:#FFA500,stroke:#000,stroke-width:2px;
```
