mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-01 06:12:07 -07:00
2.9 KiB
2.9 KiB
Architecture Map
Status: active Last verified: 2026-03-31 Owner: Kyle Yasuda Read when: runtime ownership, composition boundaries, or layering questions
SubMiner runs as three cooperating runtimes:
- Electron desktop app in
src/ - Launcher CLI in
launcher/ - mpv Lua plugin in
plugin/subminer/
The desktop app keeps src/main.ts as composition root and pushes behavior into small runtime/domain modules.
Read Next
- Domains - who owns what
- Layering - how modules should depend on each other
- Public contributor summary:
docs-site/architecture.md
Current Shape
src/main/owns composition, runtime setup, IPC wiring, and app lifecycle adapters.src/main/*.tswrapper runtimes sit betweensrc/main.tsandsrc/main/runtime/**so the composition root stays thin while exportedcreateBuild*MainDepsHandlerAPIs remain internal plumbing. Key domain runtimes:anilist-runtime– AniList token management, media tracking, retry queuecli-startup-runtime– CLI command dispatch and initial-args handlingdiscord-presence-lifecycle-runtime– Discord Rich Presence lifecyclefirst-run-runtime– first-run setup wizardipc-runtime– IPC handler registration and compositionjellyfin-runtime– Jellyfin session, playback, mpv orchestrationmain-startup-runtime– top-level startup orchestration (app-ready → CLI → headless)main-startup-bootstrap– wiring helper that builds startup runtime inputsmining-runtime– Anki card mining actionsmpv-runtime– mpv client lifecycleoverlay-ui-runtime– overlay window management, visibility, trayoverlay-geometry-runtime– overlay bounds resolutionshortcuts-runtime– global shortcut registrationstartup-sequence-runtime– headless known-word refresh and deferred startup sequencingstats-runtime– immersion tracker, stats server, stats CLIsubtitle-runtime– subtitle prefetch, tokenization, cachingyoutube-runtime– YouTube playback flowyomitan-runtime– Yomitan extension loading and settings
src/main/boot/owns boot-phase assembly seams sosrc/main.tscan stay focused on lifecycle coordination and startup-path selection.src/core/services/owns focused runtime services plus pure or side-effect-bounded logic.src/renderer/owns overlay rendering and input behavior.src/config/owns config definitions, defaults, loading, and resolution.src/types/owns shared cross-runtime contracts via domain entrypoints;src/types.tsstays a compatibility barrel.src/main/runtime/composers/owns larger domain compositions.
Architecture Intent
- Small units, explicit boundaries
- Composition over monoliths
- Pure helpers where possible
- Stable user behavior while internals evolve