# rizkif-com/tiktok-live-chat-overlay architecture

> Architecture diagram of the GitHub repository rizkif-com/tiktok-live-chat-overlay, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rizkif-com/tiktok-live-chat-overlay
- Repository: https://github.com/rizkif-com/tiktok-live-chat-overlay

## Overview

TikTok Live Overlay is a Windows Electron overlay for monitoring public TikTok LIVE activity. The main workflow is: a streamer enters a host name or LIVE URL, the renderer requests a connection through the preload bridge, and the Electron main process connects to TikTok and forwards events for display. The renderer presents chat, activity, viewer and like statistics, top viewers, and join notices; it also exposes overlay controls such as size, always-on-top, and click-through. Source excerpts show the IPC and event paths; feature-to-view details are grouped where the renderer implements them together.

Main entry points: [`src/main.js`](https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/main.js) (Electron main process), [`src/preload.cjs`](https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/preload.cjs) (Secure IPC bridge), [`src/renderer.js`](https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/renderer.js) (Overlay UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_live["LIVE connection"]
  node_main["Electron main process<br/>[main.js]"]
  node_connection["LIVE event connection<br/>[main.js]"]
end

subgraph group_interface["Overlay interface"]
  node_renderer["Overlay UI<br/>[renderer.js]"]
  node_live_views["Chat and activity<br/>[renderer.js]"]
  node_stats_views["Stats and joins<br/>[renderer.js]"]
  node_preload["Secure IPC bridge<br/>[preload.cjs]"]
end

subgraph group_window["Window controls"]
  node_window["Overlay window<br/>[main.js]"]
  node_window_controls["Window controls<br/>[renderer.js]"]
end

node_streamer(("Streamer"))
node_tiktok["TikTok LIVE"]

node_streamer -->|"enters host"| node_renderer
node_renderer -->|"requests connection"| node_preload
node_preload -->|"invokes IPC"| node_main
node_main -->|"creates and connects"| node_connection
node_main -->|"connects to"| node_tiktok
node_tiktok -->|"sends LIVE events"| node_main
node_main -->|"sends event IPC"| node_preload
node_preload -->|"delivers chat and activity"| node_live_views
node_preload -->|"delivers stats and joins"| node_stats_views
node_renderer -->|"renders"| node_live_views
node_renderer -->|"renders"| node_stats_views
node_main -->|"creates window"| node_window
node_window -->|"loads UI"| node_renderer
node_window_controls -->|"sends control IPC"| node_preload
node_preload -->|"forwards window controls"| node_main
node_renderer -->|"presents controls"| node_window_controls

click node_renderer "https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/renderer.js"
click node_live_views "https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/renderer.js"
click node_stats_views "https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/renderer.js"
click node_preload "https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/preload.cjs"
click node_main "https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/main.js"
click node_connection "https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/main.js"
click node_window "https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/main.js"
click node_window_controls "https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/renderer.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_connection toneBlue
class node_renderer,node_live_views,node_stats_views,node_preload toneAmber
class node_window,node_window_controls toneMint
class node_streamer,node_tiktok toneIndigo
```

## Components

### LIVE connection

- [Electron main process](https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/main.js): `src/main.js`
- [LIVE event connection](https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/main.js): `src/main.js`

### Overlay interface

- [Overlay UI](https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/renderer.js): `src/renderer.js`
- [Chat and activity](https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/renderer.js): `src/renderer.js`
- [Stats and joins](https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/renderer.js): `src/renderer.js`
- [Secure IPC bridge](https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/preload.cjs): `src/preload.cjs`

### Window controls

- [Overlay window](https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/main.js): `src/main.js`
- [Window controls](https://github.com/rizkif-com/tiktok-live-chat-overlay/blob/main/src/renderer.js): `src/renderer.js`

### Other components

- **Streamer**
- **TikTok LIVE**

## Connections

- Streamer → Overlay UI: enters host (evidence: `src/renderer.js`)
- Overlay UI → Secure IPC bridge: requests connection (evidence: `src/renderer.js`)
- Secure IPC bridge → Electron main process: invokes IPC (evidence: `src/preload.cjs`)
- Electron main process → LIVE event connection: creates and connects (evidence: `src/main.js`)
- Electron main process → TikTok LIVE: connects to (evidence: `README.md`)
- TikTok LIVE → Electron main process: sends LIVE events (evidence: `src/main.js`)
- Electron main process → Secure IPC bridge: sends event IPC (evidence: `src/main.js`)
- Secure IPC bridge → Chat and activity: delivers chat and activity (evidence: `src/preload.cjs`)
- Secure IPC bridge → Stats and joins: delivers stats and joins (evidence: `src/preload.cjs`)
- Overlay UI → Chat and activity: renders (evidence: `src/renderer.js`)
- Overlay UI → Stats and joins: renders (evidence: `src/renderer.js`)
- Electron main process → Overlay window: creates window (evidence: `src/main.js`)
- Overlay window → Overlay UI: loads UI (evidence: `src/main.js`)
- Window controls → Secure IPC bridge: sends control IPC (evidence: `src/preload.cjs`)
- Secure IPC bridge → Electron main process: forwards window controls (evidence: `src/preload.cjs`)
- Overlay UI → Window controls: presents controls (evidence: `src/renderer.js`)
