How kolhun/legcord works
Legcord is a standalone Electron Discord client: startup initializes configuration and optional client mods, then opens the Discord web app in a customized native window. Users configure themes, plugins, keybinds, games, and client behavior through the integrated settings UI; the main process bridges those choices to runtime features. The README also describes privacy protections, Rich Presence, and experimental mobile support. Edges reflect explicit imports/calls or README statements; unsampled modules are represented only where documented, so some subsystem links are intentionally omitted.
Main entry points: main.ts Legcord app startup · window.ts Discord window · index.ts Shelter settings UI · ipc.ts Main-process IPC
Components 23
Startup and setup
- Legcord app startup
src/main.ts - First-run setup
src/setup/main.ts - Startup splash
src/splash/main.ts
Discord runtime
- Discord window
src/discord/window.ts - Preload patches
src/discord/preload/patches.mts - Tracker blocking
src/discord/extensions/csp.ts - Main-process IPC
src/discord/ipc.ts
Mods and appearance
- Built-in mod loader
src/discord/extensions/modloader.ts - Plugin extension
src/discord/extensions/plugin.ts - Plugin manager
src/discord/plugins/manager.ts - Theme manager
src/common/themes.ts
Settings and persistence
- Shelter settings UI
src/shelter/settings/index.ts - General settings
src/shelter/settings/pages/SettingsPage.tsx - Settings state
src/shelter/settings/settings.ts - Configuration store
src/common/config.ts - Settings backup
src/common/backup.ts - Theme settings
src/shelter/settings/pages/ThemesPage.tsx
Integrated features
- Rich Presence
src/discord/rpcProcess.ts - Screen sharing
src/discord/screenshare.ts - Screen source picker
src/shelter/screenshare/components/ScreensharePicker.tsx - CSS editor
src/cssEditor/main.ts
Other components
- User
- Discord web app
Connections 25
- User → Legcord app startup: launches
- Legcord app startup → First-run setup: opens first-run
src/main.ts - Legcord app startup → Startup splash: opens
src/main.ts - Legcord app startup → Built-in mod loader: loads mods
src/main.ts - Legcord app startup → Plugin manager: initializes
src/main.ts - Legcord app startup → Discord window: creates window
src/main.ts - Discord window → Discord web app: loads web app
- Discord window → Preload patches: configures preload
src/discord/window.ts - Legcord app startup → Tracker blocking: loads protections
src/main.ts - Discord window → Main-process IPC: registers IPC
src/discord/window.ts - Discord window → Theme manager: injects themes
src/discord/window.ts - Discord window → Rich Presence: starts presence
src/discord/window.ts - Discord window → Screen sharing: uses capture
src/discord/window.ts - Main-process IPC → CSS editor: opens editor
src/discord/ipc.ts - Main-process IPC → Configuration store: reads settings
src/discord/ipc.ts - Plugin manager → Configuration store: reads plugin state
src/discord/plugins/manager.ts - Shelter settings UI → General settings: registers page
src/shelter/settings/index.ts - Shelter settings UI → Settings state: refreshes state
src/shelter/settings/index.ts - General settings → Settings state: updates settings
src/shelter/settings/pages/SettingsPage.tsx - General settings → Settings backup: renders backup
src/shelter/settings/pages/SettingsPage.tsx - Settings state → Configuration store: persists settings
- Shelter settings UI → Theme settings: registers themes
src/shelter/settings/index.ts - Theme settings → Theme manager: manages themes
- Shelter settings UI → Plugin manager: exposes plugins
- Screen source picker → Screen sharing: selects sources