How zephyrus21/tauri-timer works
Project type and purpose
• This is a desktop application built with Tauri (Rust-based native shell) and Yew (Rust-to-WASM web UI framework). It provides a single-window, web-UI front end (compiled with Trunk) talking to a Rust backend for OS-level capabilities.
File structure
• Top-level:
• Cargo.toml, Makefile, Trunk.toml, tauri config (src-tauri/tauri.conf.json)
• index.html, CSS files (input.css, output.css, styles.css), tailwind.config.js
• src-tauri/… – the Rust “backend” implementing Tauri commands and bundling
• src/… – the Yew front-end (app.rs, components/, helpers.rs, main.rs)
• Patterns:
• Separation of front end vs backend
• Build tool (Trunk) compiles Rust → WASM + bundles static assets
• Tauri bridges WebView ↔ native code via JSON-RPC commands
README insights
• Describes a “Tauri + Yew” template: minimal setup to bootstrap a desktop app.
• No external microservices—purely local UI + native API calls.
a. Main components
• Yew Web UI (WASM bundle loaded into index.html)
• Tauri Runtime (WebView + event loop)
• Rust Backend (src-tauri/main.rs, build.rs)
• OS-level services (filesystem, notifications, clipboard, etc.)
• Build tooling (Trunk, Cargo)
b. Relationships & interactions
• User → Web UI (DOM events)
• Web UI → Tauri (invoke JSON-RPC commands)
• Tauri → Rust backend (command handlers)
• Rust backend → OS (native APIs)
• Backend emits events → Web UI (via “emit” callbacks)
c. Architectural patterns
• Clear UI/backend separation
• Message-based RPC between WASM and native
• Single-page application structure inside a desktop shell
d. Key technologies
• Yew (Rust→WASM front end)
• Trunk (bundler for WASM + static)
• Tauri (lightweight desktop shell, Rust API layer)
• Tailwind CSS for styling