# leaguetoolkit/ltk-manager architecture

> Architecture diagram of the GitHub repository leaguetoolkit/ltk-manager, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/leaguetoolkit/ltk-manager
- Repository: https://github.com/leaguetoolkit/ltk-manager

## Overview

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: [`src-tauri/src/commands`](https://github.com/leaguetoolkit/ltk-manager/tree/main/src-tauri/src/commands) (Commands), [`src/lib/tauri.ts`](https://github.com/leaguetoolkit/ltk-manager/blob/main/src/lib/tauri.ts) (Tauri bridge), [`src/routes`](https://github.com/leaguetoolkit/ltk-manager/tree/main/src/routes) (Routes), [`src/stores`](https://github.com/leaguetoolkit/ltk-manager/tree/main/src/stores) (Client state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React frontend"]
  node_ui_entry["UI entry<br/>React/Vite entry<br/>[main.tsx]"]
  node_ui_routes["Routes<br/>router"]
  node_ui_shell["App shell<br/>chrome"]
  node_ui_library["Library<br/>feature module"]
  node_ui_workshop["Workshop<br/>feature module"]
  node_ui_patcher["Patcher UI<br/>feature module"]
  node_ui_settings["Settings<br/>feature module"]
  node_ui_diagnostics["Diagnostics<br/>feature module"]
  node_ui_deeplink["Deep link install<br/>feature module"]
  node_ui_state["Client state<br/>stores"]
  node_ui_tauri["Tauri bridge<br/>IPC helpers<br/>[tauri.ts]"]
  node_ui_bindings["Typed bindings<br/>generated contracts"]
end

subgraph group_backend["Rust backend"]
  node_be_main["Backend entry<br/>Tauri bootstrap<br/>[main.rs]"]
  node_be_commands["Commands<br/>IPC boundary"]
  node_be_mods["Mods domain<br/>library service"]
  node_be_workshop["Workshop domain<br/>project service"]
  node_be_patcher["Patcher domain<br/>native patcher"]
  node_be_diagnostics["Diagnostics domain<br/>checks"]
  node_be_deeplink["Deep link domain<br/>protocol handler"]
  node_be_storage[("Storage<br/>local persistence<br/>[storage.rs]")]
  node_be_strings["Strings<br/>override service"]
end

subgraph group_external["External systems"]
  node_os_game[("Game install<br/>external dependency")]
  node_os_fs[("Filesystem<br/>external dependency")]
  node_os_sources[("Package sources<br/>external dependency")]
  node_os_desktop["OS features<br/>external dependency"]
  node_os_updates["Update source<br/>external dependency"]
end

node_ui_entry -->|"mounts"| node_ui_routes
node_ui_routes -->|"wraps"| node_ui_shell
node_ui_routes -->|"navigates"| node_ui_library
node_ui_routes -->|"navigates"| node_ui_workshop
node_ui_routes -->|"surfaces"| node_ui_patcher
node_ui_routes -->|"navigates"| node_ui_settings
node_ui_routes -->|"navigates"| node_ui_diagnostics
node_ui_library -->|"commands/events"| node_ui_tauri
node_ui_workshop -->|"commands/events"| node_ui_tauri
node_ui_patcher -->|"commands/events"| node_ui_tauri
node_ui_settings -->|"commands/events"| node_ui_tauri
node_ui_diagnostics -->|"commands/events"| node_ui_tauri
node_ui_deeplink -->|"commands/events"| node_ui_tauri
node_ui_state -->|"supports"| node_ui_library
node_ui_state -->|"supports"| node_ui_workshop
node_ui_state -->|"supports"| node_ui_patcher
node_ui_tauri -->|"typed contract"| node_ui_bindings
node_ui_tauri -->|"IPC"| node_be_commands
node_be_main -->|"exposes"| node_be_commands
node_be_commands -->|"delegates"| node_be_mods
node_be_commands -->|"delegates"| node_be_workshop
node_be_commands -->|"delegates"| node_be_patcher
node_be_commands -->|"delegates"| node_be_diagnostics
node_be_commands -->|"delegates"| node_be_deeplink
node_be_commands -->|"persists"| node_be_storage
node_be_commands -->|"queries"| node_be_strings
node_be_mods -->|"reads/writes"| node_os_fs
node_be_mods -->|"inspects"| node_os_game
node_be_workshop -->|"reads/writes"| node_os_fs
node_be_workshop -->|"imports"| node_os_sources
node_be_patcher -->|"patches"| node_os_game
node_be_patcher -->|"integrates"| node_os_desktop
node_be_diagnostics -->|"checks"| node_os_game
node_be_deeplink -->|"receives"| node_os_desktop
node_be_deeplink -->|"downloads"| node_os_sources
node_be_storage -->|"stores"| node_os_fs
node_ui_shell -->|"shows"| node_os_updates

click node_ui_entry "https://github.com/leaguetoolkit/ltk-manager/blob/main/src/main.tsx"
click node_ui_routes "https://github.com/leaguetoolkit/ltk-manager/tree/main/src/routes"
click node_ui_shell "https://github.com/leaguetoolkit/ltk-manager/tree/main/src/modules/shell"
click node_ui_library "https://github.com/leaguetoolkit/ltk-manager/tree/main/src/modules/library"
click node_ui_workshop "https://github.com/leaguetoolkit/ltk-manager/tree/main/src/modules/workshop"
click node_ui_patcher "https://github.com/leaguetoolkit/ltk-manager/tree/main/src/modules/patcher"
click node_ui_settings "https://github.com/leaguetoolkit/ltk-manager/tree/main/src/modules/settings"
click node_ui_diagnostics "https://github.com/leaguetoolkit/ltk-manager/tree/main/src/modules/diagnostics"
click node_ui_deeplink "https://github.com/leaguetoolkit/ltk-manager/tree/main/src/modules/deep-link"
click node_ui_state "https://github.com/leaguetoolkit/ltk-manager/tree/main/src/stores"
click node_ui_tauri "https://github.com/leaguetoolkit/ltk-manager/blob/main/src/lib/tauri.ts"
click node_ui_bindings "https://github.com/leaguetoolkit/ltk-manager/tree/main/src/lib/bindings"
click node_be_main "https://github.com/leaguetoolkit/ltk-manager/blob/main/src-tauri/src/main.rs"
click node_be_commands "https://github.com/leaguetoolkit/ltk-manager/tree/main/src-tauri/src/commands"
click node_be_mods "https://github.com/leaguetoolkit/ltk-manager/tree/main/src-tauri/src/mods"
click node_be_workshop "https://github.com/leaguetoolkit/ltk-manager/tree/main/src-tauri/src/workshop"
click node_be_patcher "https://github.com/leaguetoolkit/ltk-manager/tree/main/src-tauri/src/patcher"
click node_be_diagnostics "https://github.com/leaguetoolkit/ltk-manager/tree/main/src-tauri/src/diagnostics"
click node_be_deeplink "https://github.com/leaguetoolkit/ltk-manager/tree/main/src-tauri/src/deep_link"
click node_be_storage "https://github.com/leaguetoolkit/ltk-manager/blob/main/src-tauri/src/storage.rs"
click node_be_strings "https://github.com/leaguetoolkit/ltk-manager/tree/main/src-tauri/src/strings"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ui_entry,node_ui_routes,node_ui_shell,node_ui_library,node_ui_workshop,node_ui_patcher,node_ui_settings,node_ui_diagnostics,node_ui_deeplink,node_ui_state,node_ui_tauri,node_ui_bindings toneBlue
class node_be_main,node_be_commands,node_be_mods,node_be_workshop,node_be_patcher,node_be_diagnostics,node_be_deeplink,node_be_storage,node_be_strings toneAmber
class node_os_game,node_os_fs,node_os_sources,node_os_desktop,node_os_updates toneMint
```

## Components

### React frontend

Desktop UI shell, feature modules, shared state, and Tauri-facing hooks.

- [UI entry](https://github.com/leaguetoolkit/ltk-manager/blob/main/src/main.tsx): React/Vite entry · Bootstraps the desktop frontend and routes into the app shell. · `src/main.tsx`
- [Routes](https://github.com/leaguetoolkit/ltk-manager/tree/main/src/routes): router · Top-level route composition and page boundaries. · `src/routes`
- [App shell](https://github.com/leaguetoolkit/ltk-manager/tree/main/src/modules/shell): chrome · Title bar, notifications, updater UX, and dev console surfaces. · `src/modules/shell`
- [Library](https://github.com/leaguetoolkit/ltk-manager/tree/main/src/modules/library): feature module · Installed mods, folders, profiles, filtering, ordering, and mod actions. · `src/modules/library`
- [Workshop](https://github.com/leaguetoolkit/ltk-manager/tree/main/src/modules/workshop): feature module · Project editor, content browser, layers, imports, exports, and string overrides. · `src/modules/workshop`
- [Patcher UI](https://github.com/leaguetoolkit/ltk-manager/tree/main/src/modules/patcher): feature module · Start/stop controls, overlay status, warnings, and patcher feedback. · `src/modules/patcher`
- [Settings](https://github.com/leaguetoolkit/ltk-manager/tree/main/src/modules/settings): feature module · App configuration, theme, game path, watcher, hotkeys, licenses, and storage-related preferences. · `src/modules/settings`
- [Diagnostics](https://github.com/leaguetoolkit/ltk-manager/tree/main/src/modules/diagnostics): feature module · Health checks and environment reports surfaced to the user. · `src/modules/diagnostics`
- [Deep link install](https://github.com/leaguetoolkit/ltk-manager/tree/main/src/modules/deep-link): feature module · Protocol-based install flow for external links. · `src/modules/deep-link`
- [Client state](https://github.com/leaguetoolkit/ltk-manager/tree/main/src/stores): stores · Zustand-style UI state for selection, filters, dialogs, notifications, updater, and patcher session. · `src/stores`
- [Tauri bridge](https://github.com/leaguetoolkit/ltk-manager/blob/main/src/lib/tauri.ts): IPC helpers · Central command/event wiring and typed event helpers used by feature hooks. · `src/lib/tauri.ts`
- [Typed bindings](https://github.com/leaguetoolkit/ltk-manager/tree/main/src/lib/bindings): generated contracts · Generated TypeScript payload and event types shared with Rust commands. · `src/lib/bindings`

### Rust backend

Tauri command layer and domain services.

- [Backend entry](https://github.com/leaguetoolkit/ltk-manager/blob/main/src-tauri/src/main.rs): Tauri bootstrap · Application startup, global state setup, and logging/tray integration. · `src-tauri/src/main.rs`
- [Commands](https://github.com/leaguetoolkit/ltk-manager/tree/main/src-tauri/src/commands): IPC boundary · Frontend-exposed Rust commands that wrap domain services and return typed payloads. · `src-tauri/src/commands`
- [Mods domain](https://github.com/leaguetoolkit/ltk-manager/tree/main/src-tauri/src/mods): library service · Library scanning, metadata, folders, profiles, categorization, migrations, watcher, and WAD reports. · `src-tauri/src/mods`
- [Workshop domain](https://github.com/leaguetoolkit/ltk-manager/tree/main/src-tauri/src/workshop): project service · Project CRUD, content browsing, layering, packing/export, and string handling. · `src-tauri/src/workshop`
- [Patcher domain](https://github.com/leaguetoolkit/ltk-manager/tree/main/src-tauri/src/patcher): native patcher · Runner, injector, host API, and patching lifecycle for the game process. · `src-tauri/src/patcher`
- [Diagnostics domain](https://github.com/leaguetoolkit/ltk-manager/tree/main/src-tauri/src/diagnostics): checks · Path, process, storage medium, compatibility, DLL, and library-index validation. · `src-tauri/src/diagnostics`
- [Deep link domain](https://github.com/leaguetoolkit/ltk-manager/tree/main/src-tauri/src/deep_link): protocol handler · Resolves protocol installs and downloads content before handing off to install flows. · `src-tauri/src/deep_link`
- [Storage](https://github.com/leaguetoolkit/ltk-manager/blob/main/src-tauri/src/storage.rs): local persistence · Local settings and configuration persistence for the app. · `src-tauri/src/storage.rs`
- [Strings](https://github.com/leaguetoolkit/ltk-manager/tree/main/src-tauri/src/strings): override service · 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**: external dependency · League of Legends installation, processes, and native game files.
- **Filesystem**: external dependency · Local disks holding mods, profiles, workshop projects, and persisted app data.
- **Package sources**: external dependency · Downloaded mod packages, Fantome archives, Git repositories, and modpkg inputs.
- **OS features**: external dependency · Tray, hotkeys, shell integration, and protocol handling from the operating system.
- **Update source**: external dependency · Release distribution and changelog source used by update checks.

## Connections

- 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.
