How freeproject089/bettermodsmanager works
1. Top-level shape
Better Mod Manager is a desktop application built as a Tauri shell: a JavaScript/HTML/CSS frontend runs in a webview, while the Rust backend performs all privileged local work. The core boundary is UI vs. file-system/game-management logic.
2. Frontend presentation layer
The frontend/ tree is a modular ES2022 app with app.js as the main bootstrap, plus feature modules such as mods.js, profiles.js, repo.js, onboarding.js, debug.js, benchmark.js, and interactive-docs.js. Styling is plain CSS, and the UI includes embedded assets, localized strings, and diagram-based help content.
3. Frontend state and API boundary
state.js, api.js, utils.js, and components.js form the client-side application layer. The frontend is not doing direct file or OS work; it calls into the Rust side through the Tauri command bridge and renders responses, errors, and diagnostics.
4. Rust backend command layer
src-tauri/src/commands/ is the main backend API surface. Commands are grouped by concern: mods, mod lists, profiles, tags, history, repository/repo-server, update/autoupdate, disk/image utilities, security, crash/debug, Discord integration, window control, and admin tooling such as ban and whitelist management. This is the executable core behind every privileged action.
5. Domain model and application state
The backend models are organized around profile, mod_entry, modlist, repo, tag, and history. src-tauri/src/state.rs and frontend/js/state.js indicate a stateful app that keeps the current profile/game context, selected mods, and operational status in sync across the UI and backend.
6. File-system and mod activation flow
The application’s main job is local mod management, so the critical runtime flow is: user action in the frontend → backend command → filesystem operation in the target game directory. The README’s “Smart Physical Copy” approach means files are copied and restored rather than managed by symlinks, with backup/restoration behavior and conflict detection around active mods.
7. Import/export, sharing, and repository support
Mod sharing is a first-class subsystem: .MM lists, import/export, download links, local mod pooling, and repository handling all live around the mods, modlist, and repo command/model sets. This is also where the app can categorize external links such as GitHub, Drive, MEGA, or direct archives.
8. Server/admin and multi-profile operations
The repository includes a dedicated server-management slice (repo_server, ban_manager, whitelist_manager, omm, ovgme) and a mini-server template under src-tauri/src/templates/mini-server/. That suggests the app can manage or assist with hosted/mod-sharing workflows, not just local installs. Profiles are a major partitioning boundary: each game/profile has its own paths, settings, and mod state.
9. Diagnostics, update, and safety tooling
There are explicit backend commands for crash reporting, benchmarking, disk checks, image handling, and update checking. The README calls out GitHub-based update checks, and the Rust backend dependencies imply network and archive handling. Global locking and stateful backend commands point to serialized access around mutable local resources.
10. Internationalization and documentation tooling
Localization is built into the frontend with frontend/Lang/en.json, fr.json, and template.json, plus compare_i18n.py and tests/i18n_parity.test.py to keep translations aligned. The Update/ directory and frontend/js/diagrams/ folder are documentation assets, not runtime subsystems, but they help explain the architecture and user-facing workflows.
11. Packaging and runtime context
src-tauri/tauri.conf.json, Rust build files, and package-lock.json show a standard Tauri packaging pipeline: frontend assets are bundled into a native desktop executable. The app is therefore best diagrammed as a local desktop orchestrator with a thin UI layer and a Rust system layer that owns storage, updates, mod operations, and external integration.
Main entry points: api.js Tauri API · app.js App bootstrap · mod.rs Domain models · mods.rs Mods commands
Components 18
Frontend
Tauri webview UI and client-side app modules
- App bootstrap · Main browser-side startup and feature wiring
frontend/js/app.js - UI state · Shared frontend state and view synchronization
frontend/js/state.js - Tauri API · Frontend command boundary into Rust backend
frontend/js/api.js - Feature modules · Mods, profiles, repo, onboarding, debug, benchmarking, docs
- Components · Reusable frontend rendering and interaction pieces
frontend/js/components.js - Localization · Frontend language loading and translated strings
frontend/Lang/en.json - Interactive docs · Embedded diagrams and guided help content
frontend/js/interactive-docs.js
Rust backend
Privileged local logic, commands, models, and filesystem coordination
- Mods commands · Mod import, activation, copy, and conflict workflows
src-tauri/src/commands/mods.rs - Modlist commands · .MM list management and import/export
src-tauri/src/commands/modlist.rs - Profile commands · Game/profile partitions, paths, and settings
src-tauri/src/commands/profile.rs - Repo commands · Repository links, downloads, and local mod sharing
src-tauri/src/commands/repo.rs - Server commands · Hosted/shared mod server management
src-tauri/src/commands/repo_server.rs - Ops commands · Update, disk, image, debug, crash, security, and window actions
src-tauri/src/commands/update.rs - Backend state · Serialized runtime state shared across commands
src-tauri/src/state.rs - Domain models · Profiles, mod entries, modlists, repo data, tags, and history
src-tauri/src/models/mod.rs - FS utils · File-system helpers for game directory operations
src-tauri/src/fs_utils.rs - Mini-server template · Generated server-side helper template
src-tauri/src/templates/mini-server/server.hybrid.bat.template
Docs & assets
Localization, diagrams, and update documentation
- Update docs · Release notes and architectural writeups
Update/changelog_since_7e839e.md
Connections 23
- App bootstrap → UI state: initializes · Bootstraps application state and UI flows
- App bootstrap → Feature modules: loads · Brings feature modules into the app
- App bootstrap → Components: renders with · Uses shared components during view composition
- Feature modules → Tauri API: calls · Features invoke backend actions through the bridge
- UI state → Tauri API: reads/writes · State is synchronized with backend responses and events
- Localization → App bootstrap: localizes · Language strings feed the UI bootstrap and modules
- Interactive docs → Feature modules: explains · Interactive help documents major workflows
- Tauri API → Mods commands: invokes · Frontend mod actions map to privileged backend commands
- Tauri API → Modlist commands: invokes · Frontend list import/export and sharing flows
- Tauri API → Profile commands: invokes · Frontend profile management maps to backend operations
- Tauri API → Repo commands: invokes · Frontend repository and download flows map here
- Tauri API → Server commands: invokes · Frontend server/admin workflows map here
- Tauri API → Ops commands: invokes · Frontend diagnostics, updates, and utility actions map here
- Mods commands → Backend state: uses · Mod operations rely on shared runtime state
- Modlist commands → Domain models: serializes · Lists are represented through the domain model layer
- Profile commands → Domain models: uses · Profiles and related context come from models
- Repo commands → Domain models: uses · Repository metadata and sharing data are modeled here
- Mods commands → FS utils: touches · Core mod flow performs file-system work in game directories
- Profile commands → FS utils: touches · Profile operations resolve and manage local paths
- Server commands → Mini-server template: templates · Server management can generate or use the mini-server template
- Ops commands → Backend state: uses · Diagnostic and control commands coordinate through shared state
- Domain models → Backend state: feeds · Model data is tracked in the runtime state
- Update docs → Interactive docs: supports · Documentation assets back the interactive help system