# chanyavrc/vrcosclib architecture

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

- Interactive diagram: https://gitdiagram.com/chanyavrc/vrcosclib
- Repository: https://github.com/chanyavrc/vrcosclib

## Overview

##### Main Components
- Core Library (VRCOscLib): This is the heart of the project. It contains multiple sub-modules:
- Avatar Module: Classes in BuildSoft.VRChat.Osc.Avatar (e.g., OscAvatarConfig, OscAvatar, OscAvatarParameter, etc.).
- Input Module: Handling button and axis inputs via BuildSoft.VRChat.Osc.Input (OscAxisInput and OscButtonInput).
- Chatbox Module: For sending messages using BuildSoft.VRChat.Osc.Chatbox.
- Utility and Collections: Helpers, event handlers, and delegates along with utility functions used across the scope.
- Sample Applications: These illustrate how consumers can use the library. They are separate applications that either use a user interface (via XAML-based apps) or console-based programs.
- Test Suite: Located under src/VRCOscLib/Tests – providing unit and performance tests to verify functionality.
- Documentation and CI/CD: The docs folder and Github workflows (e.g., dotnet, nuget, publish-docs) indicate automated build, testing, and deployment pipelines.

##### Relationships & Interactions
- Core Library Modules Interactions: Components within the core (e.g., Avatar module sending parameters to Chatbox module or using Utility functions) interact with each other; highlight these inter-module dependencies.
- Tests → Core Library: The test suite validates core functionality using various test cases. Show that tests “depend on” core components.

##### Architectural Patterns and Design Principles
- Modular Design: The core library is broken into logical modules (Avatar, Input, Chatbox), demonstrating separation of concerns.
- Event-Driven Architecture: With various event delegates and utility functions (e.g., OscValueChangedEventHandler), the design hints at event-driven interactions.
- Dependency Inversion: The samples and tests depend on the core library which abstracts the VRChat OSC actions, making the system modular and testable.
- Extensibility: The library’s structure (including various namespaces and utility classes) suggests it is built for easy extension and integration, as well as reuse in different contexts.

##### Putting It All Together
- If desired, add a layer for the “Test Suite” that interacts with the core library.
- Don’t forget to annotate the CI/CD workflows and documentation processes to reflect the automated build and deployment processes.
- Finally, label external systems like the NuGet Package Manager and VRChat itself, clarifying that VRCOscLib eventually interfaces with VRChat OSC endpoints.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Library and its Modules
    CL["VRCOscLib Core Library"]:::library
    subgraph "Core Modules"
        AV["Avatar Module"]:::module
        IN["Input Module"]:::module
        CB["Chatbox Module"]:::module
        UT["Utility"]:::module
        CO["Collections"]:::module
    end
    CL -->|"includes"| AV
    CL -->|"includes"| IN
    CL -->|"includes"| CB
    CL -->|"includes"| UT
    CL -->|"includes"| CO

    %% Internal module interactions
    AV -->|"utilizes"| UT
    IN -->|"utilizes"| UT
    CB -->|"utilizes"| UT
    UT -->|"manages"| CO

    %% Sample Applications consuming the Core Library Modules
    subgraph "Sample Applications"
        SP["AvatarParameterSender"]:::sample
        CS["ChatboxSender"]:::sample
        EA["ExpressionAvatarChanger"]:::sample
        GC["GuiController"]:::sample
        LA["LogAvatarParametars"]:::sample
    end
    SP -->|"uses"| AV
    CS -->|"uses"| CB
    EA -->|"uses"| AV
    GC -->|"uses"| IN
    LA -->|"uses"| AV

    %% Test Suite
    TS["Test Suite"]:::test
    TS -->|"tests"| CL

    %% CI/CD and Documentation
    subgraph "CI/CD & Documentation"
        DOC["Documentation"]:::cicd
        CI["CI/CD Workflows"]:::cicd
    end
    DOC -->|"documents"| CL
    CI -->|"builds/tests/deploys"| CL

    %% External Dependency
    External["VRChat Application"]:::external
    CL -->|"sends_OSC"| External

    %% Click Events
    click CL "https://github.com/chanyavrc/vrcosclib/tree/main/src/VRCOscLib/VRCOscLib"
    click AV "https://github.com/chanyavrc/vrcosclib/tree/main/src/VRCOscLib/VRCOscLib/Avatar"
    click IN "https://github.com/chanyavrc/vrcosclib/tree/main/src/VRCOscLib/VRCOscLib/Input"
    click CB "https://github.com/chanyavrc/vrcosclib/tree/main/src/VRCOscLib/VRCOscLib/Chatbox"
    click UT "https://github.com/chanyavrc/vrcosclib/tree/main/src/VRCOscLib/VRCOscLib/Utility"
    click CO "https://github.com/chanyavrc/vrcosclib/tree/main/src/VRCOscLib/VRCOscLib/Collections"
    click SP "https://github.com/chanyavrc/vrcosclib/tree/main/src/Sample/AvatarParameterSender"
    click CS "https://github.com/chanyavrc/vrcosclib/tree/main/src/Sample/ChatboxSender"
    click EA "https://github.com/chanyavrc/vrcosclib/tree/main/src/Sample/ExpressionAvatarChanger"
    click GC "https://github.com/chanyavrc/vrcosclib/tree/main/src/Sample/GuiController"
    click LA "https://github.com/chanyavrc/vrcosclib/tree/main/src/Sample/LogAvatarParametars"
    click TS "https://github.com/chanyavrc/vrcosclib/tree/main/src/VRCOscLib/Tests"
    click DOC "https://github.com/chanyavrc/vrcosclib/tree/main/docs folder"
    click CI "https://github.com/chanyavrc/vrcosclib/tree/main/.github/workflows"

    %% Styles
    classDef library fill:#f9c74f,stroke:#000,stroke-width:2px;
    classDef module fill:#90be6d,stroke:#000,stroke-width:2px;
    classDef sample fill:#f8961e,stroke:#000,stroke-width:2px;
    classDef test fill:#f94144,stroke:#000,stroke-width:2px;
    classDef cicd fill:#577590,stroke:#000,stroke-width:2px;
    classDef external fill:#277da1,stroke:#000,stroke-width:2px;
```
