RustFS Launcher is a desktop GUI application designed to configure, launch, and monitor the rustfs binary. It bridges a robust Rust backend with a reactive web-based frontend using the Tauri framework.
- Frontend: Built with Leptos (Rust web framework), providing a type-safe, reactive UI for user input and real-time log streaming.
- Backend: A Tauri (Rust) application that manages the lifecycle of the external
rustfsprocess, captures its stdout/stderr, and streams these logs to the frontend via events.
The backend acts as the process manager and native layer.
src-tauri/src/lib.rs: Application entry point. Sets up the Tauri builder, lifecycle hooks, and registers commands.src-tauri/src/commands.rs: Defines the API exposed to the frontend (e.g.,launch_rustfs,get_app_logs).src-tauri/src/process.rs: Core logic for locating therustfsbinary (checks multiple paths), diagnosing it, and spawning the child process. Captures output streams.src-tauri/src/state.rs: Manages global, thread-safe application state (process handles, log history) and emits real-time events (app-log,rustfs-log) to the frontend.
The frontend is a Single Page Application (SPA) compiled to WebAssembly.
src/main.rs: Leptos entry point, mounts the application.src/app.rs: The main UI component. It handles:- Configuration: Inputs for Host, Port, and Mountpoint.
- Commands: Invokes
launch_rustfsvia Tauri'sinvokesystem. - Events: Listens for
APP_LOG_EVENTandRUSTFS_LOG_EVENTto update the log console in real-time.
src/logs.css: Styles specific to the log viewer component.
- Rust: Standard toolchain (
cargo,rustup). - Node.js: Required for Tauri's CLI and frontend asset bundling.
- Trunk: The WASM web application bundler (
cargo install trunk).
-
Download Binaries: The application requires a platform-specific
rustfsbinary.- macOS/Linux: Run
./build.sh - Windows: Run
build.bat - Note: Binaries are placed in
src-tauri/binaries/and are git-ignored.
- macOS/Linux: Run
-
Development Server:
cargo tauri dev
This starts the Tauri application with hot-reloading for both the Rust backend and the Leptos frontend.
-
Production Build:
cargo tauri build
- Rust: Follow standard Rust idioms. Use
cargo fmtandcargo clippy --workspace --all-targetsbefore committing. - Commits: Adhere to Conventional Commits (e.g.,
feat: add log filter,fix: process termination). - Organization:
- Keep frontend code in
src/. - Keep backend logic in
src-tauri/src/. - Tests should be co-located with code in
#[cfg(test)]modules.
- Keep frontend code in
- Backend: Run
cargo test -p rustfs-launcher. - Integration: Manually verify the "Launch" flow and log streaming. Ensure the child process terminates when the window closes.
Trunk.toml: Configuration for the Leptos build pipeline.AGENTS.md: Detailed repository guidelines for contributors and AI agents.
- Language: All communication with the user must be in Chinese.