# ylg-ctrl/lolping architecture

> Architecture diagram of the GitHub repository ylg-ctrl/lolping, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ylg-ctrl/lolping
- Repository: https://github.com/ylg-ctrl/lolping

## Overview

lolPing is a desktop overlay for placing League-style pings and emotes over any application, with optional rooms for sharing activity. The main flow is a user gesture captured by the native input helper, routed through the Electron main process, and rendered in transparent overlay windows; settings configure triggers and presentation. Room sharing adds peer discovery/transport, encrypted protocol messages, room text, votes, and emote transfer. The README also documents fullscreen-game pausing, custom emotes, tray controls, and updates. Edges are limited to sampled references or README statements; unsampled subsystems are represented only where documented.

Main entry points: [`src/main/roomManager.ts`](https://github.com/ylg-ctrl/lolping/blob/main/src/main/roomManager.ts) (Room manager), [`src/renderer/overlay/main.ts`](https://github.com/ylg-ctrl/lolping/blob/main/src/renderer/overlay/main.ts) (Overlay renderer), [`src/main/index.ts`](https://github.com/ylg-ctrl/lolping/blob/main/src/main/index.ts) (Electron main), [`src/renderer/settings/App.tsx`](https://github.com/ylg-ctrl/lolping/blob/main/src/renderer/settings/App.tsx) (Settings window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Input and orchestration"]
  node_helper["Native input helper"]
  node_main["Electron main<br/>[index.ts]"]
  node_bridge["Input bridge<br/>[inputBridge.ts]"]
end

subgraph group_overlay["Desktop overlay"]
  node_overmgr["Overlay manager<br/>[overlayManager.ts]"]
  node_overlayui["Overlay renderer<br/>[main.ts]"]
end

subgraph group_rooms["Room collaboration"]
  node_panel["Room panel<br/>[main.ts]"]
  node_textui["Room text window<br/>[main.ts]"]
  node_manager["Room manager<br/>[roomManager.ts]"]
  node_crypto["Room cryptography<br/>[roomCrypto.ts]"]
  node_transport["Room transport<br/>[transport.ts]"]
  node_lan["LAN transport<br/>[lanTransport.ts]"]
  node_relay["Relay transport<br/>[relayTransport.ts]"]
  node_emotetransfer["Emote transfer<br/>[emoteTransfer.ts]"]
end

subgraph group_settings["Configuration and assets"]
  node_settingsui["Settings window<br/>[App.tsx]"]
  node_settingsipc["Settings IPC<br/>[settingsIpc.ts]"]
  node_settingsstore[("Settings store<br/>[settingsStore.ts]")]
  node_emotelib[("Emote library<br/>[emoteLibrary.ts]")]
end

subgraph group_shared["Shared domain"]
  node_pings["Ping definitions<br/>[pings.ts]"]
  node_emotes["Emote catalog and model<br/>[emotes.ts]"]
  node_settingsmodel["Settings model<br/>[settings.ts]"]
  node_features["Feature switches<br/>[features.ts]"]
  node_roomprotocol["Room protocol<br/>[roomProtocol.ts]"]
  node_ipc["IPC contracts<br/>[ipc.ts]"]
end

node_user(("Desktop user"))
node_peer(("Room peers"))
node_internet{{"Internet relays"}}
node_desktop["Other applications"]

node_user -->|"gestures"| node_helper
node_helper -.->|"sends input"| node_bridge
node_main -.->|"configures"| node_bridge
node_bridge -.->|"forwards events"| node_main
node_main -->|"starts"| node_overmgr
node_overmgr -->|"loads overlay"| node_overlayui
node_overmgr -->|"uses channels"| node_ipc
node_overlayui -->|"looks up pings"| node_pings
node_overlayui -->|"resolves emotes"| node_emotes
node_user -->|"configures"| node_settingsui
node_settingsui -.->|"updates settings"| node_settingsipc
node_settingsipc -.->|"persists"| node_settingsstore
node_settingsui -->|"edits"| node_settingsmodel
node_settingsmodel -->|"normalizes"| node_features
node_main -->|"coordinates rooms"| node_manager
node_manager -->|"seals messages"| node_crypto
node_manager -->|"encodes messages"| node_roomprotocol
node_manager -->|"sends room data"| node_transport
node_transport -.->|"selects LAN"| node_lan
node_transport -.->|"selects relay"| node_relay
node_lan -.->|"exchanges data"| node_peer
node_relay -.->|"relays messages"| node_internet
node_manager -.->|"coordinates transfer"| node_emotetransfer
node_emotetransfer -->|"uses library"| node_emotelib
node_manager -.->|"updates room view"| node_panel
node_manager -.->|"displays room text"| node_textui
node_main -->|"uses channels"| node_ipc
node_ipc -->|"defines overlay events"| node_overlayui
node_ipc -->|"defines settings API"| node_settingsui
node_user -->|"views effects"| node_overlayui
node_overlayui -->|"renders above"| node_desktop
node_manager -->|"shares room activity"| node_peer

click node_helper "https://github.com/ylg-ctrl/lolping/tree/main/native/hook-helper/src"
click node_main "https://github.com/ylg-ctrl/lolping/blob/main/src/main/index.ts"
click node_bridge "https://github.com/ylg-ctrl/lolping/blob/main/src/main/inputBridge.ts"
click node_overmgr "https://github.com/ylg-ctrl/lolping/blob/main/src/main/overlayManager.ts"
click node_overlayui "https://github.com/ylg-ctrl/lolping/blob/main/src/renderer/overlay/main.ts"
click node_panel "https://github.com/ylg-ctrl/lolping/blob/main/src/renderer/panel/main.ts"
click node_textui "https://github.com/ylg-ctrl/lolping/blob/main/src/renderer/text/main.ts"
click node_manager "https://github.com/ylg-ctrl/lolping/blob/main/src/main/roomManager.ts"
click node_crypto "https://github.com/ylg-ctrl/lolping/blob/main/src/main/roomCrypto.ts"
click node_transport "https://github.com/ylg-ctrl/lolping/blob/main/src/main/transport.ts"
click node_lan "https://github.com/ylg-ctrl/lolping/blob/main/src/main/lanTransport.ts"
click node_relay "https://github.com/ylg-ctrl/lolping/blob/main/src/main/relayTransport.ts"
click node_emotetransfer "https://github.com/ylg-ctrl/lolping/blob/main/src/main/emoteTransfer.ts"
click node_settingsui "https://github.com/ylg-ctrl/lolping/blob/main/src/renderer/settings/App.tsx"
click node_settingsipc "https://github.com/ylg-ctrl/lolping/blob/main/src/main/settingsIpc.ts"
click node_settingsstore "https://github.com/ylg-ctrl/lolping/blob/main/src/main/settingsStore.ts"
click node_emotelib "https://github.com/ylg-ctrl/lolping/blob/main/src/main/emoteLibrary.ts"
click node_pings "https://github.com/ylg-ctrl/lolping/blob/main/src/shared/pings.ts"
click node_emotes "https://github.com/ylg-ctrl/lolping/blob/main/src/shared/emotes.ts"
click node_settingsmodel "https://github.com/ylg-ctrl/lolping/blob/main/src/shared/settings.ts"
click node_features "https://github.com/ylg-ctrl/lolping/blob/main/src/shared/features.ts"
click node_roomprotocol "https://github.com/ylg-ctrl/lolping/blob/main/src/shared/roomProtocol.ts"
click node_ipc "https://github.com/ylg-ctrl/lolping/blob/main/src/shared/ipc.ts"

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_helper,node_main,node_bridge,node_user toneBlue
class node_overmgr,node_overlayui toneAmber
class node_panel,node_textui,node_manager,node_crypto,node_transport,node_lan,node_relay,node_emotetransfer toneMint
class node_settingsui,node_settingsipc,node_settingsstore,node_emotelib toneRose
class node_pings,node_emotes,node_settingsmodel,node_features,node_roomprotocol,node_ipc,node_peer,node_internet,node_desktop toneIndigo
```

## Components

### Input and orchestration

- [Native input helper](https://github.com/ylg-ctrl/lolping/tree/main/native/hook-helper/src): `native/hook-helper/src`
- [Electron main](https://github.com/ylg-ctrl/lolping/blob/main/src/main/index.ts): `src/main/index.ts`
- [Input bridge](https://github.com/ylg-ctrl/lolping/blob/main/src/main/inputBridge.ts): `src/main/inputBridge.ts`

### Desktop overlay

- [Overlay manager](https://github.com/ylg-ctrl/lolping/blob/main/src/main/overlayManager.ts): `src/main/overlayManager.ts`
- [Overlay renderer](https://github.com/ylg-ctrl/lolping/blob/main/src/renderer/overlay/main.ts): `src/renderer/overlay/main.ts`

### Room collaboration

- [Room panel](https://github.com/ylg-ctrl/lolping/blob/main/src/renderer/panel/main.ts): `src/renderer/panel/main.ts`
- [Room text window](https://github.com/ylg-ctrl/lolping/blob/main/src/renderer/text/main.ts): `src/renderer/text/main.ts`
- [Room manager](https://github.com/ylg-ctrl/lolping/blob/main/src/main/roomManager.ts): `src/main/roomManager.ts`
- [Room cryptography](https://github.com/ylg-ctrl/lolping/blob/main/src/main/roomCrypto.ts): `src/main/roomCrypto.ts`
- [Room transport](https://github.com/ylg-ctrl/lolping/blob/main/src/main/transport.ts): `src/main/transport.ts`
- [LAN transport](https://github.com/ylg-ctrl/lolping/blob/main/src/main/lanTransport.ts): `src/main/lanTransport.ts`
- [Relay transport](https://github.com/ylg-ctrl/lolping/blob/main/src/main/relayTransport.ts): `src/main/relayTransport.ts`
- [Emote transfer](https://github.com/ylg-ctrl/lolping/blob/main/src/main/emoteTransfer.ts): `src/main/emoteTransfer.ts`

### Configuration and assets

- [Settings window](https://github.com/ylg-ctrl/lolping/blob/main/src/renderer/settings/App.tsx): `src/renderer/settings/App.tsx`
- [Settings IPC](https://github.com/ylg-ctrl/lolping/blob/main/src/main/settingsIpc.ts): `src/main/settingsIpc.ts`
- [Settings store](https://github.com/ylg-ctrl/lolping/blob/main/src/main/settingsStore.ts): `src/main/settingsStore.ts`
- [Emote library](https://github.com/ylg-ctrl/lolping/blob/main/src/main/emoteLibrary.ts): `src/main/emoteLibrary.ts`

### Shared domain

- [Ping definitions](https://github.com/ylg-ctrl/lolping/blob/main/src/shared/pings.ts): `src/shared/pings.ts`
- [Emote catalog and model](https://github.com/ylg-ctrl/lolping/blob/main/src/shared/emotes.ts): `src/shared/emotes.ts`
- [Settings model](https://github.com/ylg-ctrl/lolping/blob/main/src/shared/settings.ts): `src/shared/settings.ts`
- [Feature switches](https://github.com/ylg-ctrl/lolping/blob/main/src/shared/features.ts): `src/shared/features.ts`
- [Room protocol](https://github.com/ylg-ctrl/lolping/blob/main/src/shared/roomProtocol.ts): `src/shared/roomProtocol.ts`
- [IPC contracts](https://github.com/ylg-ctrl/lolping/blob/main/src/shared/ipc.ts): `src/shared/ipc.ts`

### Other components

- **Desktop user**
- **Room peers**
- **Internet relays**
- **Other applications**

## Connections

- Desktop user → Native input helper: gestures (evidence: `README.md`)
- Native input helper → Input bridge: sends input
- Electron main → Input bridge: configures (evidence: `src/main/index.ts`)
- Input bridge → Electron main: forwards events (evidence: `src/main/index.ts`)
- Electron main → Overlay manager: starts (evidence: `src/main/index.ts`)
- Overlay manager → Overlay renderer: loads overlay (evidence: `src/main/overlayManager.ts`)
- Overlay manager → IPC contracts: uses channels (evidence: `src/main/overlayManager.ts`)
- Overlay renderer → Ping definitions: looks up pings (evidence: `src/renderer/overlay/main.ts`)
- Overlay renderer → Emote catalog and model: resolves emotes (evidence: `src/renderer/overlay/main.ts`)
- Desktop user → Settings window: configures (evidence: `README.md`)
- Settings window → Settings IPC: updates settings
- Settings IPC → Settings store: persists
- Settings window → Settings model: edits (evidence: `src/renderer/settings/App.tsx`)
- Settings model → Feature switches: normalizes (evidence: `src/shared/settings.ts`)
- Electron main → Room manager: coordinates rooms (evidence: `src/main/index.ts`)
- Room manager → Room cryptography: seals messages (evidence: `src/main/roomManager.ts`)
- Room manager → Room protocol: encodes messages (evidence: `src/main/roomManager.ts`)
- Room manager → Room transport: sends room data (evidence: `src/main/roomManager.ts`)
- Room transport → LAN transport: selects LAN
- Room transport → Relay transport: selects relay
- LAN transport → Room peers: exchanges data
- Relay transport → Internet relays: relays messages
- Room manager → Emote transfer: coordinates transfer
- Emote transfer → Emote library: uses library (evidence: `src/main/emoteTransfer.ts`)
- Room manager → Room panel: updates room view
- Room manager → Room text window: displays room text
- Electron main → IPC contracts: uses channels (evidence: `src/main/index.ts`)
- IPC contracts → Overlay renderer: defines overlay events (evidence: `src/renderer/overlay/main.ts`)
- IPC contracts → Settings window: defines settings API (evidence: `src/renderer/settings/App.tsx`)
- Desktop user → Overlay renderer: views effects (evidence: `README.md`)
- Overlay renderer → Other applications: renders above (evidence: `README.md`)
- Room manager → Room peers: shares room activity (evidence: `README.md`)
