# ryzetech/cider4obs architecture

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

- Interactive diagram: https://gitdiagram.com/ryzetech/cider4obs
- Repository: https://github.com/ryzetech/cider4obs

## Overview

Key Components to Include:

##### Main Components
- Cider Client (Music Player)
- Browser Source (OBS Integration)
- WebSocket Connection Layer

##### Architecture Overview

**[Cider Client (Apple Music)] <---> [WebSocket Connection] <---> [OBS Browser Source]**

##### Client Side (OBS)
- Inside it, show a "Browser Source" component
- HTML/CSS rendering component (index.html, style.css)

##### Connection Layer
- Reconnection logic (5-second intervals)

##### Music Player Side
- Apple Music integration
- WebSocket API endpoint

Visual Styling Guidelines:

##### Data Flow Indicators
- Music metadata flow
- Status updates
- Reconnection attempts

Important Features to Highlight:

##### Real-time Components
- WebSocket connection status
- Music playback status
- Progress bar updates

##### Configuration Options
- Custom CSS injection points
- Behavior settings
- Appearance customization

##### State Management
- Connection states
- Playback states
- Fade animations

Technical Details to Include:

##### Browser Source Properties
- Default dimensions (800x170)
- CSS customization point
- Real-time updates

##### Connection Details
- WebSocket protocol
- Reconnection logic
- Error handling

##### UI Components
- Progress bar
- Text elements (title, artist, album)
- Background container

- Component relationships
- Data flow direction
- Configuration points
- State changes
- User customization options

- Connection types
- State indicators

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Cider["Cider Client"]
        AM["Apple Music Integration"]
        CWS["WebSocket API Endpoint"]
    end

    subgraph Connection["Connection Layer"]
        WS["WebSocket Handler"]:::connector
        RL["Reconnection Logic<br>(5s intervals)"]:::connector
    end

    subgraph OBS["OBS Integration"]
        BS["Browser Source"]:::browser
        UI["UI Components"]:::ui
        CSS["Styling & Animations"]:::styling
    end

    AM --> CWS
    CWS <--> WS
    WS <--> RL
    WS <--> BS
    BS --> UI
    UI --> CSS

    classDef connector fill:#323330,color:white
    classDef browser fill:#f9f9f9,stroke:#333
    classDef ui fill:#e6e6e6,stroke:#333
    classDef styling fill:#9933CC,color:white

    click WS "https://github.com/ryzetech/cider4obs/blob/main/connector.js"
    click BS "https://github.com/ryzetech/cider4obs/blob/main/index.html"
    click CSS "https://github.com/ryzetech/cider4obs/blob/main/style.css"

    subgraph Legend
        L1["WebSocket Components"]:::connector
        L2["Browser Elements"]:::browser
        L3["UI Components"]:::ui
        L4["Styling Elements"]:::styling
    end
```
