# tflivesstudio/tflclient architecture

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

- Interactive diagram: https://gitdiagram.com/tflivesstudio/tflclient
- Repository: https://github.com/tflivesstudio/tflclient

## Overview

TFL Client is a Minecraft launcher with a Svelte interface and a native Rust core. A user acts through the desktop UI; the Tauri command layer exposes native operations, which manage instances and content, prepare Java, and launch the game. Other major capabilities include Microsoft/Mojang accounts, TFL Selection installs, imports, servers, worlds, settings, and MCP integrations. The map reflects the documented product and sampled relationships; several unsampled command and service links are intentionally omitted rather than inferred.

Main entry points: [`src-tauri/src/lib.rs`](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/lib.rs) (Tauri command host), [`src-tauri/src/services/instance_manager.rs`](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/services/instance_manager.rs) (Instance management), [`src-tauri/src/core/path_manager.rs`](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/core/path_manager.rs) (Profile paths), [`src/lib/app/AppShell.svelte`](https://github.com/tflivesstudio/tflclient/blob/main/src/lib/app/AppShell.svelte) (Svelte interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_ui["Svelte interface<br/>[AppShell.svelte]"]
  node_api["Frontend API<br/>[invoke.ts]"]
end

subgraph group_native["Native application"]
  node_tauri["Tauri command host<br/>[lib.rs]"]
  node_instance_cmd["Instance commands<br/>[instance.rs]"]
  node_content_cmd["Content commands<br/>[content.rs]"]
  node_addon_cmd["Addon commands<br/>[addons.rs]"]
  node_import_cmd["Import commands<br/>[import_sources.rs]"]
  node_modpack_cmd["Modpack commands<br/>[modpacks.rs]"]
  node_server_cmd["Server commands<br/>[servers.rs]"]
  node_profile_cmd["Profile commands<br/>[mojang_profile.rs]"]
  node_selection_cmd["Selection commands<br/>[tfl_selection.rs]"]
  node_settings[("Settings storage")]
  node_paths["Profile paths<br/>[path_manager.rs]"]
end

subgraph group_game["Game management"]
  node_instance_store["Instance management"]
  node_selection_install["Selection installer<br/>[installer.rs]"]
  node_worlds["World management<br/>[worlds.rs]"]
  node_java["Java runtime setup<br/>[java_manager.rs]"]
  node_content["Content services"]
  node_mrpack["Modpack installer<br/>[installer.rs]"]
end

subgraph group_integrations["Accounts and integrations"]
  node_auth["Microsoft authentication<br/>[microsoft.rs]"]
  node_identity["Microsoft identity config"]
  node_mcp["MCP integration<br/>[mcp.rs]"]
  node_modrinth["Modrinth services<br/>[modrinth.rs]"]
end

node_user(("Launcher user"))
node_game_process["Minecraft process"]

node_user -->|"uses"| node_ui
node_ui -->|"invokes"| node_api
node_api -.->|"dispatches commands"| node_tauri
node_tauri -->|"registers"| node_instance_cmd
node_tauri -->|"registers"| node_content_cmd
node_tauri -->|"registers"| node_addon_cmd
node_tauri -->|"registers"| node_import_cmd
node_tauri -->|"registers"| node_modpack_cmd
node_tauri -->|"registers"| node_server_cmd
node_tauri -->|"registers"| node_profile_cmd
node_tauri -->|"registers"| node_selection_cmd
node_instance_store -->|"gets instance paths"| node_paths
node_instance_store -->|"reads selection identity"| node_selection_install
node_instance_store -->|"uses services"| node_content
node_instance_store -->|"uses world service"| node_worlds
node_settings -->|"uses profile paths"| node_paths
node_java -->|"gets runtime paths"| node_paths
node_content -.->|"uses provider"| node_modrinth
node_modpack_cmd -.->|"installs packs"| node_mrpack
node_selection_cmd -.->|"delegates install"| node_selection_install
node_profile_cmd -.->|"authenticates account"| node_auth
node_identity -->|"scopes test profile"| node_paths
node_tauri -->|"restores integration"| node_mcp
node_instance_cmd -.->|"manages instances"| node_instance_store
node_instance_store -.->|"prepares runtime"| node_java
node_instance_store -.->|"launches game"| node_game_process

click node_ui "https://github.com/tflivesstudio/tflclient/blob/main/src/lib/app/AppShell.svelte"
click node_api "https://github.com/tflivesstudio/tflclient/blob/main/src/lib/api/invoke.ts"
click node_tauri "https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/lib.rs"
click node_instance_cmd "https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/commands/instance.rs"
click node_content_cmd "https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/commands/content.rs"
click node_addon_cmd "https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/commands/addons.rs"
click node_import_cmd "https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/commands/import_sources.rs"
click node_modpack_cmd "https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/commands/modpacks.rs"
click node_server_cmd "https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/commands/servers.rs"
click node_profile_cmd "https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/commands/mojang_profile.rs"
click node_selection_cmd "https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/commands/tfl_selection.rs"
click node_instance_store "https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/services/instance_manager.rs"
click node_selection_install "https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/services/selection/installer.rs"
click node_worlds "https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/services/worlds.rs"
click node_java "https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/services/java_manager.rs"
click node_content "https://github.com/tflivesstudio/tflclient/tree/main/src-tauri/src/services/content"
click node_mrpack "https://github.com/tflivesstudio/tflclient/blob/main/crates/cubrinth/src/mrpack/installer.rs"
click node_settings "https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/services/settings_manager.rs"
click node_paths "https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/core/path_manager.rs"
click node_auth "https://github.com/tflivesstudio/tflclient/blob/main/crates/launchwerk/src/auth/microsoft.rs"
click node_identity "https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/core/microsoft_identity.rs"
click node_mcp "https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/services/mcp.rs"
click node_modrinth "https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/services/content/providers/modrinth.rs"

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,node_api,node_user toneBlue
class node_tauri,node_instance_cmd,node_content_cmd,node_addon_cmd,node_import_cmd,node_modpack_cmd,node_server_cmd,node_profile_cmd,node_selection_cmd,node_settings,node_paths toneAmber
class node_instance_store,node_selection_install,node_worlds,node_java,node_content,node_mrpack toneMint
class node_auth,node_identity,node_mcp,node_modrinth toneRose
class node_game_process toneIndigo
```

## Components

### Desktop interface

- [Svelte interface](https://github.com/tflivesstudio/tflclient/blob/main/src/lib/app/AppShell.svelte): `src/lib/app/AppShell.svelte`
- [Frontend API](https://github.com/tflivesstudio/tflclient/blob/main/src/lib/api/invoke.ts): `src/lib/api/invoke.ts`

### Native application

- [Tauri command host](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`
- [Instance commands](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/commands/instance.rs): `src-tauri/src/commands/instance.rs`
- [Content commands](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/commands/content.rs): `src-tauri/src/commands/content.rs`
- [Addon commands](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/commands/addons.rs): `src-tauri/src/commands/addons.rs`
- [Import commands](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/commands/import_sources.rs): `src-tauri/src/commands/import_sources.rs`
- [Modpack commands](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/commands/modpacks.rs): `src-tauri/src/commands/modpacks.rs`
- [Server commands](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/commands/servers.rs): `src-tauri/src/commands/servers.rs`
- [Profile commands](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/commands/mojang_profile.rs): `src-tauri/src/commands/mojang_profile.rs`
- [Selection commands](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/commands/tfl_selection.rs): `src-tauri/src/commands/tfl_selection.rs`
- [Settings storage](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/services/settings_manager.rs): `src-tauri/src/services/settings_manager.rs`
- [Profile paths](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/core/path_manager.rs): `src-tauri/src/core/path_manager.rs`

### Game management

- [Instance management](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/services/instance_manager.rs): `src-tauri/src/services/instance_manager.rs`
- [Selection installer](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/services/selection/installer.rs): `src-tauri/src/services/selection/installer.rs`
- [World management](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/services/worlds.rs): `src-tauri/src/services/worlds.rs`
- [Java runtime setup](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/services/java_manager.rs): `src-tauri/src/services/java_manager.rs`
- [Content services](https://github.com/tflivesstudio/tflclient/tree/main/src-tauri/src/services/content): `src-tauri/src/services/content`
- [Modpack installer](https://github.com/tflivesstudio/tflclient/blob/main/crates/cubrinth/src/mrpack/installer.rs): `crates/cubrinth/src/mrpack/installer.rs`

### Accounts and integrations

- [Microsoft authentication](https://github.com/tflivesstudio/tflclient/blob/main/crates/launchwerk/src/auth/microsoft.rs): `crates/launchwerk/src/auth/microsoft.rs`
- [Microsoft identity config](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/core/microsoft_identity.rs): `src-tauri/src/core/microsoft_identity.rs`
- [MCP integration](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/services/mcp.rs): `src-tauri/src/services/mcp.rs`
- [Modrinth services](https://github.com/tflivesstudio/tflclient/blob/main/src-tauri/src/services/content/providers/modrinth.rs): `src-tauri/src/services/content/providers/modrinth.rs`

### Other components

- **Launcher user**
- **Minecraft process**

## Connections

- Launcher user → Svelte interface: uses (evidence: `README.md`)
- Svelte interface → Frontend API: invokes
- Frontend API → Tauri command host: dispatches commands
- Tauri command host → Instance commands: registers (evidence: `src-tauri/src/lib.rs`)
- Tauri command host → Content commands: registers (evidence: `src-tauri/src/lib.rs`)
- Tauri command host → Addon commands: registers (evidence: `src-tauri/src/lib.rs`)
- Tauri command host → Import commands: registers (evidence: `src-tauri/src/lib.rs`)
- Tauri command host → Modpack commands: registers (evidence: `src-tauri/src/lib.rs`)
- Tauri command host → Server commands: registers (evidence: `src-tauri/src/lib.rs`)
- Tauri command host → Profile commands: registers (evidence: `src-tauri/src/lib.rs`)
- Tauri command host → Selection commands: registers
- Instance management → Profile paths: gets instance paths (evidence: `src-tauri/src/services/instance_manager.rs`)
- Instance management → Selection installer: reads selection identity (evidence: `src-tauri/src/services/instance_manager.rs`)
- Instance management → Content services: uses services (evidence: `src-tauri/src/services/instance_manager.rs`)
- Instance management → World management: uses world service (evidence: `src-tauri/src/services/instance_manager.rs`)
- Settings storage → Profile paths: uses profile paths (evidence: `src-tauri/src/services/settings_manager.rs`)
- Java runtime setup → Profile paths: gets runtime paths (evidence: `src-tauri/src/services/java_manager.rs`)
- Content services → Modrinth services: uses provider
- Modpack commands → Modpack installer: installs packs
- Selection commands → Selection installer: delegates install
- Profile commands → Microsoft authentication: authenticates account
- Microsoft identity config → Profile paths: scopes test profile (evidence: `src-tauri/src/core/path_manager.rs`)
- Tauri command host → MCP integration: restores integration (evidence: `src-tauri/src/lib.rs`)
- Instance commands → Instance management: manages instances
- Instance management → Java runtime setup: prepares runtime
- Instance management → Minecraft process: launches game
