How brassworks-smp/brassworkslauncher works
Purpose and Entry Points
Brassworks Launcher is a cross-platform desktop Minecraft launcher for installing, managing, sharing, and launching custom modpack instances. The desktop binary is the Tauri shell at frontend/src-tauri/src/main.rs, initialized through frontend/src-tauri/src/lib.rs. React/Vite starts at frontend/main.tsx and renders the application root in frontend/app/page.tsx.
Desktop Boundary and Application State
Tauri is the trust boundary between the browser-rendered UI and local filesystem, process, network, and launcher operations. frontend/src-tauri/src/commands.rs exposes native commands; frontend/src-tauri/src/state.rs owns shared application state; frontend/src-tauri/src/auth_window.rs supports authentication flows. The frontend invokes this boundary through frontend/lib/api.ts, keeping views such as frontend/components/PlayView.tsx and frontend/components/InstancesView.tsx thin clients of Rust operations.
Core Launcher Domain
crates/brassworks-core/src/lib.rs is the principal native domain crate. Instance lifecycle—including creation, metadata, installation state, and instance-local paths—is centered in crates/brassworks-core/src/instance.rs, crates/brassworks-core/src/paths.rs, and crates/brassworks-core/src/settings.rs. Launch orchestration is in crates/brassworks-core/src/launch.rs; it combines resolved game assets, Java configuration, active instance files, and user settings into a Minecraft process launch.
Minecraft Resolution and Java Provisioning
The vendored portablemc crate resolves Minecraft and loader dependencies and supports downloading/launch preparation: crates/portablemc/src/lib.rs, crates/portablemc/src/moj/mod.rs, crates/portablemc/src/fabric/mod.rs, and crates/portablemc/src/forge/mod.rs. The separate Java crate, crates/java/src/lib.rs, provisions runtime requirements from Adoptium. This isolates upstream game/version/Maven/HTTP concerns from Brassworks-specific instance behavior.
Modpack Install, Sync, and Export
crates/packwiz/src/installer.rs implements packwiz installation, while crates/packwiz/src/unsup/resolve.rs implements resumable, hash-verified Unsup updates. crates/brassworks-core/src/modpack.rs coordinates these capabilities for launcher instances. Import/export and share workflows are represented by crates/brassworks-core/src/import.rs, crates/brassworks-core/src/export.rs, and crates/brassworks-core/src/packwiz_share.rs; pack format construction resides under crates/packwiz/src/export/. Content is sourced from Modrinth and CurseForge through crates/packwiz/src/modrinth.rs and crates/packwiz/src/curseforge.rs.
Publishing and Remote Integrations
Shared-pack publishing abstracts source-control hosts in crates/brassworks-core/src/forge/mod.rs, with implementations for GitHub and GitLab at crates/brassworks-core/src/forge/github.rs and crates/brassworks-core/src/forge/gitlab.rs. Credentials/account behavior is local to crates/brassworks-core/src/auth.rs and crates/brassworks-core/src/account.rs. External runtime services also include Modrinth, CurseForge, Mojang/Microsoft authentication, Adoptium, configured pack hosts, and the default schematic cache proxy.
Filesystem Content, Saves, and Schematics
Instance-associated user content is handled by dedicated core modules: global shared-file profiles/symlink repair in crates/brassworks-core/src/global_files.rs, worlds and backups in crates/brassworks-core/src/saves.rs, and schematic discovery/install/conversion in crates/brassworks-core/src/schematics.rs and crates/brassworks-core/src/schematic_convert.rs. Schematic remote access/cache behavior is separated into crates/brassworks-core/src/createmod.rs and crates/brassworks-core/src/schematic_client_cache.rs, with the cache base configurable by environment variable.
UI Workflow Layer and Distribution
The frontend organizes major launcher workflows into feature views—content, modpacks, servers, worlds, skins, settings, and command palette—under frontend/components/ and command parsing/dispatch under frontend/lib/cmd/. Tauri platform configuration is in frontend/src-tauri/tauri.conf.json plus OS overrides. Releases produce native bundles; Linux repackaging targets AUR, Flatpak, and Snap via packaging/aur/PKGBUILD, packaging/flatpak/com.brassworks.launcher.yaml, and packaging/snap/snapcraft.yaml.
Main entry points: lib.rs Brassworks core · launch.rs Launch orchestration · commands.rs Native commands · packwiz_share.rs Import, export, sharing
Components 21
Desktop application
- React/Vite entry
frontend/main.tsx - Launcher workflow UI · Feature views and command dispatch for launcher workflows.
frontend/app/page.tsx - Native API client
frontend/lib/api.ts - Tauri shell · Trust boundary for browser UI and local native operations.
frontend/src-tauri/src/main.rs - Native commands
frontend/src-tauri/src/commands.rs - Shared app state · Also supports authentication windows.
frontend/src-tauri/src/state.rs
Launcher core
- Brassworks core
crates/brassworks-core/src/lib.rs - Instances and settings · Owns instance metadata, paths, installation state, and settings.
crates/brassworks-core/src/instance.rs - Launch orchestration
crates/brassworks-core/src/launch.rs - Saves and schematics · Manages worlds, backups, shared files, and schematic workflows.
crates/brassworks-core/src/saves.rs - Import, export, sharing · Coordinates pack imports, exports, and shared-pack publishing.
crates/brassworks-core/src/packwiz_share.rs - Accounts and credentials
crates/brassworks-core/src/auth.rs
Game runtime
- portablemc resolver · Resolves Minecraft, loaders, assets, and download preparation.
crates/portablemc/src/lib.rs - Java provisioning
crates/java/src/lib.rs - Minecraft process
Modpack pipeline
- Modpack coordinator · Applies installation and update capabilities to launcher instances.
crates/brassworks-core/src/modpack.rs - packwiz installer and export · Installs packs, performs verified Unsup updates, and constructs exports.
crates/packwiz/src/installer.rs
External services
- Minecraft and loader services · Mojang versions/assets plus Fabric and Forge dependencies.
- Adoptium
- Mod content catalogs
- Pack hosts and Git forges · Configured pack hosts plus GitHub and GitLab shared-pack repositories.
Connections 24
- React/Vite entry → Launcher workflow UI: renders
- Launcher workflow UI → Native API client: invokes
- Native API client → Tauri shell: crosses desktop boundary
- Tauri shell → Native commands: registers
- Native commands → Shared app state: uses
- Native commands → Brassworks core: delegates to
- Brassworks core → Instances and settings: manages
- Brassworks core → Launch orchestration: orchestrates
- Brassworks core → Saves and schematics: manages
- Brassworks core → Import, export, sharing: coordinates
- Brassworks core → Accounts and credentials: uses
- Launch orchestration → Instances and settings: reads active files and settings
- Launch orchestration → portablemc resolver: resolves game assets
- Launch orchestration → Java provisioning: selects runtime
- Launch orchestration → Minecraft process: starts
- portablemc resolver → Minecraft and loader services: resolves and downloads
- Java provisioning → Adoptium: provisions from
- Brassworks core → Modpack coordinator: coordinates
- Modpack coordinator → packwiz installer and export: installs and updates through
- Modpack coordinator → Instances and settings: updates instance content
- packwiz installer and export → Mod content catalogs: sources mods from
- Import, export, sharing → packwiz installer and export: constructs pack formats with
- Import, export, sharing → Pack hosts and Git forges: publishes and syncs
- Accounts and credentials → Minecraft and loader services: authenticates with