How th-ch/youtube-music works
Project type and purpose
• This is a desktop application built with Electron + Vite + TypeScript.
• Its goal is to wrap the YouTube Music web interface in a native desktop shell and provide a plugin framework for extending and customizing YouTube Music’s UI and behavior.
File structure
• Top‐level build/config files: electron.vite.config.mts, package.json, tsconfig.json, pnpm-lock.yaml, .github/workflows – define the build/test/CI pipeline.
• docs/: multilingual documentation and static site for docs.
• src/: the heart of the application, subdivided into:
• config/ (application defaults, plugin registry)
• loader/ (Electron entrypoints: main.ts, menu.ts, preload.ts, renderer.ts)
• index.html + index.ts + renderer.ts (the renderer scaffold that embeds YouTube Music’s web UI via a WebView or iframe)
• providers/ (abstraction over YouTube Music’s JS API – song controls, metadata)
• plugins/ (≈50 plugin folders, each with optional backend, preload, renderer code, stylesheets, templates)
• utils/ & types/: shared helper functions, IPC wrappers, type definitions
• i18n/: translation resources
• tray.ts, menu.ts: native menu and tray integration
• tests/: Playwright end‑to‑end tests
README for additional insights
• The README confirms it’s an Electron “wrapper around YouTube Music” with a “framework for custom plugins.”
• Build instructions (pnpm, electron-builder) and plugin authoring guide highlight three plugin execution contexts: backend (main), preload, and renderer.