# cresscendoll/creamline architecture

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

- Interactive diagram: https://gitdiagram.com/cresscendoll/creamline
- Repository: https://github.com/cresscendoll/creamline

## Overview

##### Project type and purpose
- CreamLine is a desktop application built on Electron for real-time screen sharing and streaming.
- It leverages WebRTC for peer-to-peer media transport and includes a built-in signaling server (WebSocket) for connection coordination.
- Primary use case: allow multiple clients to join a default “room-1” and share screens with minimal latency, with auto-update support via electron-updater.

##### File structure
- Top-level files
- package.json / package-lock.json: dependencies and scripts
- electron-builder.yml: packaging configuration
- config.js: default signaling URL and room settings
- README.md / .gitignore
- Electron app
- main.js: main process entry point (window life cycle, update checks, can launch local signaling server)
- preload.js: sets up context bridge between main and renderer
- renderer.js: UI logic, WebRTC API calls, DOM interactions
- index.html: renderer UI layout
- Signaling server
- signaling-server.js: exports functions to start a WebSocket signaling server
- server.js: CLI entry point for running a standalone signaling server
- Supporting scripts
- run_app.ps1: Windows launch script

##### Key insights from the README
- Core components: Electron main process, renderer process, standalone or embedded signaling server.
- Dependencies: electron, ws (WebSocket), electron-updater, electron-builder.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Configuration Layer
    Config["Configuration Layer\n(config.js)"]:::config
    click Config "https://github.com/cresscendoll/creamline/blob/main/config.js"

    %% Electron Main Process
    subgraph "Electron Main Process"
        Main["Electron Main"]:::electronProcesses
        Preload["Preload Bridge"]:::electronProcesses
    end
    click Main "https://github.com/cresscendoll/creamline/blob/main/main.js"
    click Preload "https://github.com/cresscendoll/creamline/blob/main/preload.js"

    %% Renderer Process
    subgraph "Renderer Process"
        UI["Renderer UI\n(index.html)"]:::electronProcesses
        Logic["WebRTC & UI Logic\n(renderer.js)"]:::electronProcesses
    end
    click UI "https://github.com/cresscendoll/creamline/blob/main/index.html"
    click Logic "https://github.com/cresscendoll/creamline/blob/main/renderer.js"

    %% Signaling Server
    subgraph "Signaling Server"
        Embedded["Embedded Server Module\n(signaling-server.js)"]:::server
        Standalone["Standalone Server CLI\n(server.js)"]:::server
    end
    click Embedded "https://github.com/cresscendoll/creamline/blob/main/signaling-server.js"
    click Standalone "https://github.com/cresscendoll/creamline/blob/main/server.js"

    %% P2P Media Peers
    subgraph "WebRTC Peers"
        PeerA["Peer A"]:::p2p
        PeerB["Peer B"]:::p2p
    end

    %% Auto-Update
    Main -->|"initiate update"| AutoUpdate["Auto-Update\n(electron-updater)"]:::update
    click AutoUpdate "https://github.com/cresscendoll/creamline/blob/main/package.json"
    AutoUpdate -->|"fetch releases"| UpdateServer["Update Service\n(GitHub/Update Server)"]:::external

    %% Media and Signaling Flows
    Logic -->|"WebSocket Signaling"| Embedded
    Logic -->|"WebSocket Signaling"| Standalone
    Main -->|"start embedded server"| Embedded
    Config -->|"provides settings"| Main
    Config -->|"provides settings"| Logic
    Preload -->|"IPC Bridge"| Logic
    Main -->|"load UI via BrowserWindow"| UI

    %% P2P media
    PeerA <-->|"WebRTC Media Channel"| PeerB

    %% Supporting Files
    subgraph "Supporting Files"
        YML["Build Config\n(electron-builder.yml)"]:::config
        PKG["Project Config\n(package.json)"]:::config
        LOCK["Dependencies Lock\n(package-lock.json)"]:::config
        GITIGNORE[".gitignore"]:::config
        README["README.md"]:::config
        Script["Windows Launch Script\n(run_app.ps1)"]:::config
    end
    click YML "https://github.com/cresscendoll/creamline/blob/main/electron-builder.yml"
    click PKG "https://github.com/cresscendoll/creamline/blob/main/package.json"
    click LOCK "https://github.com/cresscendoll/creamline/blob/main/package-lock.json"
    click GITIGNORE "https://github.com/cresscendoll/creamline/blob/main/.gitignore"
    click README "https://github.com/cresscendoll/creamline/blob/main/README.md"
    click Script "https://github.com/cresscendoll/creamline/blob/main/run_app.ps1"

    %% Styling
    classDef electronProcesses fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef server fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef p2p fill:#FFD700,stroke:#000,stroke-width:1px;
    classDef config fill:#FFB6C1,stroke:#000,stroke-width:1px;
    classDef update fill:#FFA500,stroke:#000,stroke-width:1px;
    classDef external fill:#D3D3D3,stroke:#000,stroke-width:1px;
```
