How nekename/opendeck works
Project Type and Purpose
• OpenDeck is a cross-platform desktop application built with Tauri: a Svelte/TypeScript front-end running in a webview, paired with a Rust back-end.
• Its purpose is to drive Elgato Stream Deck and similar hardware on Linux, Windows, and macOS, supporting both native and Windows-only plugins (via Wine).
File Structure
• Top-level “src” directory holds the Svelte front-end (components/, lib/, routes/, static assets).
• “src-tauri” holds the Rust back-end: event handlers (events/), device logic (elgato.rs), plugin loader (plugins/), state store (store/), application watcher, zip extraction, plus Tauri config and bundler scripts.
• Build & tooling: deno.json, package.json, Vite, Deno tasks for lint/build, Cargo.toml for Rust.
Key Insights from README
• Tauri-based architecture, using the elgato-streamdeck Rust library and Wine for Windows-only plugins.
• Cross-platform packaging (Flatpak, DMG, MSI/EXE).
• Plugins conform to the original Stream Deck SDK or OpenAction API.
Main Components & Their Relationships
a. Front-end (Svelte UI)
• Components (ActionList, DeviceView, ProfileManager, PropertyInspector)
• Communicates with back-end via Tauri’s IPC (invokes Rust commands and listens for events).
b. Back-end (Rust/Tauri)
• Device Manager: detects and communicates with Stream Deck hardware (elgato.rs)
• Event Bus: inbound events (hardware keypress, settings changes), outbound events (UI updates, device state changes) organized under src-tauri/src/events
• Plugin Subsystem: loads plugin manifests, spawns plugin web-servers or processes (plugins/webserver.rs, info_param.rs)
• Application Watcher: tracks active OS windows for profile switching
• Store: persists profiles and settings on the file system (store/profiles.rs, simplified_profile.rs)
• ZIP Extractor: unpacks plugin bundles (zip_extract.rs)
c. External/OS Layers
• Wine: hosts Windows-only plugins
• udev rules on Linux for device permissions
• File System: local storage for logs, profiles, plugin files
Architectural Patterns & Design Principles
• Layered architecture: Presentation (UI), Application (Tauri IPC), Domain (Rust services), Infrastructure (device drivers, file I/O).
• Event-driven: hardware and UI events flow through a Rust event bus.
• Plugin extensibility: clearly defined plugin interface (manifests, web-server protocol) decouples core app from plugin implementations.