Files
SubMiner/docs/architecture
sudacode e64ff1a0ee feat(anime): add anime browser powered by Aniyomi extensions
- Add `subminer anime` / `--anime` and a tray entry to open a browser that searches installed Aniyomi extension sources, shows cover art and episodes, and plays into mpv with overlay/mining attached
- Add an Extensions tab to add repos and install/update/remove sources, and per-source settings for sources needing config
- Support searching all sources at once with streaming, per-source results and status
- Prefer Japanese audio/subtitle tracks from the source and keep the primary subtitle slot reserved for Japanese
- Fix window/tray/Dock handling so the browser and mpv can be switched between without quitting the app or losing the Dock icon
- Add anime.repos, anime.extensionsDir, anime.preferredQuality config keys (no bundled repos or discovery)
2026-07-31 17:21:12 -07:00
..

Architecture Map

Status: active Last verified: 2026-05-23 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.

Current Shape

  • src/main/ owns composition, runtime setup, IPC wiring, and app lifecycle adapters.
  • src/main/boot/ owns boot-phase assembly seams so src/main.ts can 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.ts stays a compatibility barrel.
  • src/main/runtime/composers/ owns larger domain compositions.
  • src/main.ts call sites invoke configured runtime handlers and runtime-object methods directly; do not add local pass-through wrappers around them.

Architecture Intent

  • Small units, explicit boundaries
  • Composition over monoliths
  • Pure helpers where possible
  • Stable user behavior while internals evolve