How uatomicboolean/slint-template works
Project Type and Purpose
• This is a single-binary desktop GUI application written in Rust, using Slint for the UI layer.
Main Architectural Components
a. Rust Core (Business Logic & App Entry)
• File: src/main.rs
• build.rs (build-time resource bundler)
• Cargo.toml (dependency & metadata)
b. UI Layer (Slint Definitions)
• ui/app-window.slint (main window)
• ui/components (sidebar, layout components)
• ui/pages (logical pages/views)
• ui/widgets (custom widgets like buttons, menus)
• ui/theme (theme variables & style structs)
• ui/windows (auxiliary windows)
• ui/assets (fonts, images)
c. Internationalization (i18n)
• lang/*.po and .pot files
• Loaded at runtime by Slint
d. Resources
• winresources configured via Cargo.toml
e. Packaging & Distribution
• .github/workflows/*.yaml (CI jobs for Linux, Windows, macOS-Intel/ARM)
• dist/ (generated installers & executables)
f. External Dependencies & Services
• Slint runtime library
• Cargo/Rust toolchain
• GitHub Actions runners
• Platform installer toolchains (e.g. WiX on Windows, pkgbuild on macOS)
Relationships & Data Flows
• The Rust Core initializes the Slint engine, loads UI definitions and translations.
• UI events (button clicks, user input) propagate to Rust Core via Slint’s callback mechanism.
• Rust Core may read/write resources or configuration (not shown in this template).
• build.rs at compile time bundles assets (fonts, images, translation files) into the binary.
• CI/CD workflows trigger on Git tag push → build for each platform → package into installers → publish release (artifacts pushed to dist/).
• At runtime, the user interacts with the UI; the single executable contains all embedded resources.
Architectural Patterns & Design Principles
• Layered separation:
• UI (Slint) <→> Application Logic (Rust)
• Componentization: UI broken into reusable components, pages, widgets.
• Resource embedding: build.rs + Cargo metadata ensure a self-contained binary.
• CI/CD as an independent pipeline orchestrating multi-platform builds.
• Convention-over-configuration: project is a template—folder structure organizes concerns.