# vidyo/log-viewer architecture

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

- Interactive diagram: https://gitdiagram.com/vidyo/log-viewer
- Repository: https://github.com/vidyo/log-viewer

## Overview

##### What this project is (type + purpose)

**Project type:** Static, client-side web tool (single-page-ish HTML/CSS/JS) hosted via GitHub Pages.
**Purpose:** A **VidyoClient SDK log viewer** that:
- **Connects to a debug socket** opened by VidyoConnector/VidyoClient (default `localhost:7776`)
- **Streams/reads logs** and renders them in a browser in a more readable format
- Allows **manual paste** of a log file into the UI
- Provides **client-side filtering** of log output

There is **no backend service** in this repo; everything is delivered as static assets.

##### What the file tree tells you about architecture

Top-level files:
- `VidyoLog.html` — main UI entry point
- `VidyoLog.js` — core logic: socket connection + parsing + filtering + DOM updates
- `VidyoLog.css` — styling
- `_config.yml`, `CNAME` — GitHub Pages/Jekyll hosting configuration + custom domain
- `.github/workflows/deno.yml` — CI automation (likely lint/format/tests via Deno, or build checks)

So the architecture is essentially:
- **Browser UI** (HTML/CSS)
- **Client-side controller/logic** (JS)
- **External log source** (VidyoConnector/VidyoClient debug socket OR pasted log text)
- **Optional static hosting pipeline** (GitHub Pages + CI workflow)

##### Key interactions described by the README (important

From README “Usage with VidyoConnector”:
##### VidyoConnector calls `EnableDebug()` with
- a port (e.g., `7776`)
- log filters (e.g., `"warning all@VidyoClient info@VidyoConnector"`)
##### Viewer connects to
- `localhost:7776` (local debugging) OR
- `device-ip:7776` (remote iOS/Android device on same network)
##### Alternative input path
- user pastes contents of a log file (e.g., `VidyoClient.log`) into UI
##### Viewer provides a log filter UI to refine what is displayed.

These are the **core data flows** you want to show.

##### Vidyo Log Viewer Web App
- `VidyoLog.html` (UI shell)
- `VidyoLog.css` (presentation)
- `VidyoLog.js` (logic)
3. Inside `VidyoLog.js`, optionally subdivide into logical subcomponents (even if they’re in one file):
- **Connection Manager** (builds endpoint `host:port`, opens socket)
- **Log Ingestion** (socket stream reader + paste-text reader)
- **Parser/Formatter** (turns raw lines into structured display)
- **Filter Engine** (applies user filter string)
- **Renderer** (updates DOM/log window)

**External Runtime**
##### VidyoConnector / VidyoClient SDK
- “Debug Socket Server” (enabled via `EnableDebug()`)

**Hosting / Delivery (optional but useful)**
##### GitHub Pages (Static Hosting)
- `CNAME`, `_config.yml`
##### GitHub Actions CI
- `.github/workflows/deno.yml`

**Primary (live debug) flow**
- `User` → `VidyoConnector/VidyoClient` : “EnableDebug(port, filters)”
- `VidyoConnector Debug Socket Server` → `Vidyo Log Viewer (Connection Manager)` : “Log stream over socket (port 7776)”
- `Connection Manager` → `Log Ingestion` → `Parser/Formatter` → `Filter Engine` → `Renderer` : “Process & display”
- `User` → `Filter Engine` : “Enter filter string”
- `User` → `Renderer/UI` : “View, search/scroll (if supported)”

**Secondary (offline paste) flow**
- `User` → `Log Ingestion` : “Paste VidyoClient.log contents”
- Then same processing pipeline: `Parser/Filter/Render`

**Remote device scenario**
- `Browser` on “Developer Laptop” and `VidyoClient` on “Mobile Device”
- This makes the deployment/topology explicit.

**Hosting flow**
- `GitHub Pages` → `User Browser` : “Serve static HTML/CSS/JS”
- `GitHub Actions` → `Repo` : “CI checks (Deno workflow)”
(If the Deno workflow produces artifacts, show that; otherwise just show quality gates.)

##### Architectural patterns/principles present

- **Pure client-side web app** (no backend in repo)
- **Event-driven streaming ingestion** (socket messages appended/processed as they arrive)
- **Separation of concerns** (even if not separated into files):
- ingestion vs parsing vs filtering vs rendering
- **External dependency boundary**:
- the tool depends on **VidyoClient debug socket protocol**, but that server is outside the repo

##### Relevant technologies

- **Browser runtime** (HTML/CSS/JavaScript)
- **Network**: “Socket to `host:port` (default 7776)”
- **GitHub Pages** for hosting
- **GitHub Actions** for CI
- **Deno** in CI (from `deno.yml`)

- Developer Browser (this tool)
- VidyoConnector/VidyoClient (debug socket server)
- Network boundary (localhost vs LAN)
- GitHub Pages as distribution

- Data flow between them

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% =========================
  %% Context / Deployment View
  %% =========================
  subgraph "Context & Deployment (Static Web Tool)"
    direction TB

    User["User / Developer"]:::actor

    subgraph "Distribution (GitHub)"
      direction TB
      Repo["GitHub Repository"]:::repo
      GHP["GitHub Pages (Static Hosting)"]:::hosting
      JekyllCfg["_config.yml (Jekyll/GitHub Pages config)"]:::config
      CNAMEcfg["CNAME (Custom Domain)"]:::config
      CI["GitHub Actions CI (Deno workflow)"]:::ci
      Readme["README (Usage & Architecture)"]:::doc
    end

    subgraph "Client Runtime"
      direction TB
      Browser["Developer Browser"]:::browser
      App["Vidyo Log Viewer Web App"]:::app
    end

    subgraph "External Runtime (Outside Repo)"
      direction TB
      VidyoSDK["VidyoConnector / VidyoClient SDK"]:::external
      DebugSocket["Debug Socket Server (enabled via EnableDebug)"]:::external
    end

    subgraph "Network Topology"
      direction TB
      Localhost["Local Debug Endpoint\nlocalhost:7776"]:::network
      RemoteIP["Remote Device Endpoint\n&lt;device-ip&gt;:7776 (LAN)"]:::network
    end
  end

  %% Hosting + delivery
  Repo -->|"published_as"| GHP
  JekyllCfg -->|"configures"| GHP
  CNAMEcfg -->|"custom_domain"| GHP
  CI -->|"CI_checks"| Repo
  Readme -->|"documents_usage"| Repo
  GHP -->|"serves_static_assets"| Browser
  Browser -->|"loads"| App

  %% External interactions
  User -->|"EnableDebug(port,filters)"| VidyoSDK
  VidyoSDK -->|"opens"| DebugSocket

  %% Socket targets (local vs remote)
  Browser -->|"connects_to"| Localhost
  Browser -->|"connects_to"| RemoteIP
  Localhost -->|"routes_to"| DebugSocket
  RemoteIP -->|"routes_to"| DebugSocket

  %% =========================
  %% Component View (In-Browser)
  %% =========================
  subgraph "In-Browser Components (Client-side Only)"
    direction TB

    subgraph "Static Assets"
      direction TB
      HTML["VidyoLog.html (UI shell)"]:::frontend
      CSS["VidyoLog.css (styling)"]:::frontend
      JS["VidyoLog.js (core logic)"]:::logic
    end

    subgraph "VidyoLog.js - Logical Modules"
      direction TB
      ConnMgr["Connection Manager\n(builds host:port, opens debug socket)"]:::module
      Ingest["Log Ingestion\n(socket stream reader + paste-text reader)"]:::module
      ParseFmt["Parser / Formatter\n(raw lines -> structured display)"]:::module
      Filter["Filter Engine\n(client-side filter string)"]:::module
      Render["Renderer\n(DOM updates / log window)"]:::module
    end

    subgraph "UI Controls"
      direction TB
      EndpointUI["Endpoint Input (host:port)\n(default localhost:7776)"]:::ui
      PasteUI["Paste Log Input\n(VidyoClient.log contents)"]:::ui
      FilterUI["Log Filter UI\n(refine displayed output)"]:::ui
      LogView["Log Output View"]:::ui
    end
  end

  %% App composition
  App -->|"contains"| HTML
  App -->|"styles_with"| CSS
  App -->|"runs"| JS

  %% UI -> logic
  User -->|"enter_host:port"| EndpointUI
  EndpointUI -->|"configures"| ConnMgr

  User -->|"paste_log_text"| PasteUI
  PasteUI -->|"provides_text"| Ingest

  User -->|"enter_filter"| FilterUI
  FilterUI -->|"updates_filter"| Filter

  %% Live debug flow (socket stream)
  DebugSocket -->|"streams_logs_over_debug_socket"| ConnMgr
  ConnMgr -->|"forwards_stream"| Ingest

  %% Common processing pipeline
  Ingest -->|"raw_log_lines"| ParseFmt
  ParseFmt -->|"structured_entries"| Filter
  Filter -->|"filtered_entries"| Render
  Render -->|"updates_DOM"| LogView
  User -->|"view/scroll"| LogView

  %% Emphasize "no backend"
  NoteNoBackend["No backend service in this repo\nAll processing runs in the browser"]:::note
  App -.->|"architecture_note"| NoteNoBackend

  %% =========================
  %% Click Events (from mapping)
  %% =========================
  click HTML "https://github.com/vidyo/log-viewer/blob/master/VidyoLog.html"
  click CSS "https://github.com/vidyo/log-viewer/blob/master/VidyoLog.css"
  click JS "https://github.com/vidyo/log-viewer/blob/master/VidyoLog.js"
  click JekyllCfg "https://github.com/vidyo/log-viewer/blob/master/_config.yml"
  click CNAMEcfg "https://github.com/vidyo/log-viewer/tree/master/CNAME"
  click CI "https://github.com/vidyo/log-viewer/blob/master/.github/workflows/deno.yml"
  click Readme "https://github.com/vidyo/log-viewer/blob/master/README.md"

  %% =========================
  %% Styles
  %% =========================
  classDef actor fill:#1f2937,stroke:#111827,color:#ffffff,stroke-width:1px
  classDef repo fill:#0b1220,stroke:#334155,color:#e5e7eb,stroke-width:1px
  classDef hosting fill:#0ea5e9,stroke:#075985,color:#ffffff,stroke-width:1px
  classDef ci fill:#a855f7,stroke:#6b21a8,color:#ffffff,stroke-width:1px
  classDef doc fill:#fde68a,stroke:#b45309,color:#1f2937,stroke-width:1px
  classDef config fill:#93c5fd,stroke:#1d4ed8,color:#0b1220,stroke-width:1px

  classDef browser fill:#22c55e,stroke:#166534,color:#052e16,stroke-width:1px
  classDef app fill:#10b981,stroke:#065f46,color:#052e16,stroke-width:1px
  classDef frontend fill:#34d399,stroke:#065f46,color:#052e16,stroke-width:1px
  classDef logic fill:#16a34a,stroke:#14532d,color:#052e16,stroke-width:1px

  classDef module fill:#60a5fa,stroke:#1d4ed8,color:#0b1220,stroke-width:1px
  classDef ui fill:#a7f3d0,stroke:#047857,color:#052e16,stroke-width:1px

  classDef external fill:#fb7185,stroke:#9f1239,color:#ffffff,stroke-width:1px
  classDef network fill:#f97316,stroke:#9a3412,color:#ffffff,stroke-width:1px

  classDef note fill:#fef3c7,stroke:#d97706,color:#111827,stroke-width:1px,stroke-dasharray: 4 3
```
