$ show tauri-apps/tauri
Tauri is a production-grade framework for building cross-platform desktop and mobile applications using web frontends (HTML/JS/CSS) backed by a Rust core. The repository is a large monorepo containing the core library (`crates/tauri`), CLI tool (`crates/tauri-cli`), bundler (`crates/tauri-bundler`), runtime abstraction (`crates/tauri-runtime`), macros (`crates/tauri-macros`), code generation (`crates/tauri-codegen`), utilities (`crates/tauri-utils`), and platform-specific implementations for Windows, macOS, Linux, Android, and iOS. The architecture is modular: the core provides an application builder, plugin system, IPC (commands and events), window/webview management, tray icons, menus, state management, and a resource table. The CLI orchestrates development, building, bundling, and mobile workflows. The bundler produces platform-specific packages (MSI, NSIS, DMG, AppImage, deb, rpm, etc.). The framework emphasizes security through a capability-based ACL system, CSP injection, and an isolation pattern for IPC. It is actively maintained with frequent releases, extensive CI/CD, and a large ecosystem of plugins.
The LLM identified 4 files worth highlighting for reuse:
Implements a generic event listener system with a `Listeners` struct that uses a pending queue to avoid deadlocks when emitting events while holding a lock. Listeners are stored in a `HashMap` keyed by event type, and each listener can be registered with a target filter. The `Pending` queue allows safe emission from within listener callbacks by deferring delivery. This pattern is reusable for any event-driven system requiring safe reentrant emission.
Provides `RuntimeAuthority` for IPC access control using resolved capabilities. It maintains a `ScopeManager` that caches deserialized scope objects and supports glob-based matching for windows, webviews, and origins. `CommandScope` and `GlobalScope` implement `CommandArg` for automatic injection into commands. This is a self-contained, well-abstracted authorization module that could be extracted for any system needing fine-grained, capability-based permission checks.
Handles compile-time embedding of frontend assets into the binary. It compresses assets using Brotli, generates SHA-256 hashes for CSP (Content Security Policy) nonces, and produces a `Cached` struct with checksums for cache busting. The module is self-contained and demonstrates advanced use of Rust's proc-macro and build-script infrastructure. The pattern is reusable for any framework needing to embed and serve static assets with integrity verification.
Implements a `ResourceTable` that manages Rust objects accessible from JavaScript via numeric IDs (similar to file descriptors). Resources implement the `Resource` trait and are stored in a type-erased map with automatic cleanup on drop. This pattern is reusable for any system that needs to expose native objects to a scripting environment with safe lifecycle management.