How leaguetoolkit/ltk-manager works
1. Overall shape
- LTK Manager is a desktop application built with a React/Vite frontend and a Rust/Tauri backend.
- There is no remote application server in the architecture; the app talks to the local OS, the League of Legends install, the filesystem, and external mod/package sources.
2. Frontend shell
- The UI entrypoint is src/main.tsx, with app-wide routing in src/routes and page-level composition in src/pages.
- The app is split into feature modules under src/modules/*, each owning its own UI, hooks, and Tauri-facing API layer.
- Shared design-system components live in src/components, while cross-cutting React helpers live in src/hooks, src/stores, and src/lib.
3. Feature boundaries in the UI
- The main user-facing subsystems are:
- Library: installed mods, profiles, filtering, drag-and-drop, install/uninstall, enable/disable, reorder.
- Workshop: project editor, content browser, layers, string overrides, import/export.
- Patcher: run/stop overlay patching and show runtime status.
- Settings: app configuration, theme, game path, watcher, hotkeys, licenses.
- Diagnostics: health checks and environment reports.
- Deep link install: protocol-based install flows from external links.
- Updater, shell, notifications: app chrome, toasts, dev console, update UX.
4. Frontend data flow
- Each feature module exposes a small API surface in src/modules/<feature>/api, typically implemented as React hooks.
- Those hooks call into the Tauri bridge, manage progress/event subscriptions, and cache or derive state for components.
- UI state is split between:
- server-like state from Tauri commands/events,
- client state in Zustand-style stores under src/stores,
- derived/filtering state in feature-specific query utilities.
- This keeps command invocation, state derivation, and rendering separated.
5. Frontend-to-backend contract
- src/lib/bindings contains generated TypeScript types that mirror Rust-side command payloads and events.
- This is the primary boundary for architecture diagrams: the frontend does not reach into Rust internals directly; it talks through typed IPC contracts.
- The src/lib/tauri.ts and src/lib/useTauriEvent.ts helpers centralize command/event wiring.
6. Rust/Tauri backend shape
- The backend entrypoint is src-tauri/src/main.rs, with application bootstrap and global state setup in src-tauri/src/setup.rs, state.rs, and logging helpers.
- Rust code is organized by domain under src-tauri/src/commands, mods, workshop, patcher, diagnostics, deep_link, storage, strings, overlay, and utils.
- The commands layer is the IPC boundary exposed to the frontend; it wraps the lower-level domain services and returns typed payloads.
7. Core backend domains
- Mods: library scanning, metadata inspection, categorization, folder management, linked bin checks, migrations, WAD reports, and watcher integration.
- Workshop: project creation/editing, layer management, file content browsing, packing/exporting mod packages, and string override handling.
- Patcher: host/injector/runner logic for applying mods to the game, including progress, status, and WAD scanning.
- Diagnostics: environment checks like paths, processes, storage medium, compatibility flags, and DLL/library index validation.
- Deep link: protocol-driven installs that download or resolve content before handing off to install flows.
- Storage/settings: local persistence of app settings and related user configuration.
8. Runtime and OS integration
- The app is strongly tied to Windows and the local machine state:
- League of Legends installation path and running processes,
- filesystem-based mod libraries and workshop projects,
- tray behavior, hotkeys, shell interactions, and deep links,
- a bundled native patcher host executable in src-tauri/resources.
- The patching subsystem likely depends on injected/native components rather than browser-like APIs, which is why the Rust backend owns that responsibility.
9. Mod library data pipeline
- The library flow is: detect installed mods and profiles → compute filters/sorts/categories → render cards/lists → trigger actions like install, enable, move, reorder, uninstall.
- Watchers and progress events keep the UI live while the backend mutates the library on disk.
- Folder and profile management are first-class, which means the library is not just a flat list of mods.
10. Workshop project pipeline
- Workshop content flows from local project folders into a structured content tree, then through editing, layering, and string-override tools.
- Import paths include Fantome, Git repo, and modpkg sources; export/packing produces distributable mod packages.
- The feature has a multi-pane editor model: project overview, content browser, layer rail, and string override table are separate UI surfaces over the same backend project state.
11. Patcher and safety controls
- The patcher subsystem is isolated because it touches game execution and native injection.
- Safety/supporting subsystems around it include linked-bin warnings, WAD scan failures, compatibility checks, and diagnostics that explain why patching may not be safe or supported.
- The app also references anti-skinhacking rules and blocklists in settings and diagnostics, indicating policy enforcement is part of the runtime architecture, not just documentation.
12. Persistence and configuration
- User settings, library metadata, workshop project config, and app state are persisted locally through backend storage layers.
- The frontend reads and writes these through typed command hooks rather than direct file access.
- This keeps persistence boundaries centralized in Rust and avoids scattering filesystem logic across React components.
13. Build and packaging context
- The repo is a Rust workspace plus TypeScript frontend with Tauri schema generation under gen/ and src-tauri/gen/.
- Release/build automation exists in GitHub Actions, and the project bundles licenses and native resources for desktop distribution.
- Architecture-wise, the important point is that the frontend and backend are built together into one desktop binary/app package.
14. What to draw in an architecture diagram
- Draw one large desktop app boundary containing:
- React UI shell and feature modules,
- Tauri IPC bridge and generated types,
- Rust backend command layer,
- domain services for mods, workshop, patcher, diagnostics, deep links, storage, and strings.
- Outside that boundary, draw external dependencies:
- the League of Legends install and running game process,
- the local filesystem,
- downloaded mod packages and Git repositories,
- OS tray/hotkeys/deep links,
- update source/release distribution endpoints.
Main entry points: commands Commands · tauri.ts Tauri bridge · routes Routes · stores Client state
Components 26
React frontend
Desktop UI shell, feature modules, shared state, and Tauri-facing hooks.
- UI entry · Bootstraps the desktop frontend and routes into the app shell.
src/main.tsx - Routes · Top-level route composition and page boundaries.
src/routes - App shell · Title bar, notifications, updater UX, and dev console surfaces.
src/modules/shell - Library · Installed mods, folders, profiles, filtering, ordering, and mod actions.
src/modules/library - Workshop · Project editor, content browser, layers, imports, exports, and string overrides.
src/modules/workshop - Patcher UI · Start/stop controls, overlay status, warnings, and patcher feedback.
src/modules/patcher - Settings · App configuration, theme, game path, watcher, hotkeys, licenses, and storage-related preferences.
src/modules/settings - Diagnostics · Health checks and environment reports surfaced to the user.
src/modules/diagnostics - Deep link install · Protocol-based install flow for external links.
src/modules/deep-link - Client state · Zustand-style UI state for selection, filters, dialogs, notifications, updater, and patcher session.
src/stores - Tauri bridge · Central command/event wiring and typed event helpers used by feature hooks.
src/lib/tauri.ts - Typed bindings · Generated TypeScript payload and event types shared with Rust commands.
src/lib/bindings
Rust backend
Tauri command layer and domain services.
- Backend entry · Application startup, global state setup, and logging/tray integration.
src-tauri/src/main.rs - Commands · Frontend-exposed Rust commands that wrap domain services and return typed payloads.
src-tauri/src/commands - Mods domain · Library scanning, metadata, folders, profiles, categorization, migrations, watcher, and WAD reports.
src-tauri/src/mods - Workshop domain · Project CRUD, content browsing, layering, packing/export, and string handling.
src-tauri/src/workshop - Patcher domain · Runner, injector, host API, and patching lifecycle for the game process.
src-tauri/src/patcher - Diagnostics domain · Path, process, storage medium, compatibility, DLL, and library-index validation.
src-tauri/src/diagnostics - Deep link domain · Resolves protocol installs and downloads content before handing off to install flows.
src-tauri/src/deep_link - Storage · Local settings and configuration persistence for the app.
src-tauri/src/storage.rs - Strings · String key lookup, suggestions, and override support used by workshop features.
src-tauri/src/strings
External systems
Local machine, game install, packages, and update sources.
- Game install · League of Legends installation, processes, and native game files.
- Filesystem · Local disks holding mods, profiles, workshop projects, and persisted app data.
- Package sources · Downloaded mod packages, Fantome archives, Git repositories, and modpkg inputs.
- OS features · Tray, hotkeys, shell integration, and protocol handling from the operating system.
- Update source · Release distribution and changelog source used by update checks.
Connections 37
- UI entry → Routes: mounts · Bootstraps the routed desktop UI.
- Routes → App shell: wraps · Shared chrome and app-level surfaces around pages.
- Routes → Library: navigates · Library page and folder views.
- Routes → Workshop: navigates · Workshop page and project subroutes.
- Routes → Patcher UI: surfaces · Patcher controls are part of the app shell and related pages.
- Routes → Settings: navigates · Settings page.
- Routes → Diagnostics: navigates · Diagnostics page.
- Library → Tauri bridge: commands/events · Library hooks call backend commands and subscribe to progress.
- Workshop → Tauri bridge: commands/events · Workshop hooks use typed IPC for project and content operations.
- Patcher UI → Tauri bridge: commands/events · Patcher UI drives native patching lifecycle through IPC.
- Settings → Tauri bridge: commands/events · Settings read/write app configuration via backend commands.
- Diagnostics → Tauri bridge: commands/events · Diagnostics requests backend checks and reports.
- Deep link install → Tauri bridge: commands/events · Protocol-install flow is initiated and tracked through IPC.
- Client state → Library: supports · Selection, filters, and view state for library interactions.
- Client state → Workshop: supports · Project selection, filter, and dialog state.
- Client state → Patcher UI: supports · Patcher session and warning state.
- Tauri bridge → Typed bindings: typed contract · Commands and events are constrained by generated bindings.
- Tauri bridge → Commands: IPC · Frontend command/event bridge into Rust.
- Backend entry → Commands: exposes · Application bootstrap registers command surface and shared state.
- Commands → Mods domain: delegates · Library, folders, profiles, migrations, and watcher operations.
- Commands → Workshop domain: delegates · Project, layer, content, packing, and import/export operations.
- Commands → Patcher domain: delegates · Start/stop/status and native patching actions.
- Commands → Diagnostics domain: delegates · Environment and compatibility checks.
- Commands → Deep link domain: delegates · Protocol install resolution and download handoff.
- Commands → Storage: persists · Settings and app state storage.
- Commands → Strings: queries · String override and lookup helpers.
- Mods domain → Filesystem: reads/writes · Scans and mutates local mod library data on disk.
- Mods domain → Game install: inspects · Validates install, profiles, linked bins, and WAD state.
- Workshop domain → Filesystem: reads/writes · Projects and export artifacts live locally.
- Workshop domain → Package sources: imports · Consumes Fantome, Git, and modpkg sources.
- Patcher domain → Game install: patches · Applies mods against the running game and its files.
- Patcher domain → OS features: integrates · Hotkeys, tray, shell interactions, and native runtime behavior.
- Diagnostics domain → Game install: checks · Evaluates process, path, and compatibility state.
- Deep link domain → OS features: receives · Protocol-based install entrypoint from the OS.
- Deep link domain → Package sources: downloads · Resolves external content before installation.
- Storage → Filesystem: stores · Persists local configuration and app data.
- App shell → Update source: shows · Update and changelog UX reflects release source state.