$ show clash-verge-rev/clash-verge-rev
Clash Verge Rev is a cross-platform desktop proxy management GUI built with Tauri 2 (Rust backend) and React 19 (TypeScript frontend). It serves as the control interface for the mihomo (Clash Meta) proxy core, enabling users to manage proxy subscriptions, switch proxy groups, toggle system proxy and TUN mode, view real-time traffic and connection details, and configure advanced settings like DNS overrides, script enhancements, and backup to WebDAV. The architecture is modular: a Rust backend handles core lifecycle, config management (using a unique 'Draft' transactional pattern), system integration (tray, hotkeys, auto-launch), and IPC with a privileged service on Windows. The frontend uses MUI, SWR, and virtual lists for a responsive UI with drag-and-drop profile/group editing, a built-in Monaco editor for YAML/JS configs, and real-time WebSocket-based data visualization. The repository also includes a Rust workspace with several crates (media unlock checker, i18n, logging, signal handling, rate limiter, system info plugin) that could be extracted and reused in other Tauri applications.
The LLM identified 6 files worth highlighting for reuse:
Provides `Draft<T>` and `DraftTransaction` for atomic, rollback-aware config mutations. The pattern allows multiple concurrent readers while serializing writes with optimistic locking. Reusable in any Rust application requiring safe, consistent updates to a shared configuration with conflict detection.
Implements a config enhancement pipeline that merges user profiles with app defaults, applies JavaScript scripts via Boa engine, enforces authoritative fields (ports, secret, mode), and handles DNS/TUN overrides. The chain-of-items pattern (`ChainItem` trait) allows extensible, async processing steps and is reusable for any multi-stage configuration transformation.
A concurrent media unlock checker that tests proxy connectivity to streaming services (Netflix, Disney+, YouTube, ChatGPT, etc.) by crafting specific HTTP requests and inspecting responses. Runs up to 4 checks in parallel with per-provider timeout. The pattern of structured, concurrent HTTP probing with response analysis is reusable for any network service availability testing.
A custom YAML emitter that produces visually clean YAML output with specific formatting rules (key ordering, comment preservation, indentation control). Demonstrates fine-grained control over YAML serialization that could be extracted for any Rust project needing deterministic, human-friendly YAML output beyond what standard libraries provide.
Centralized delay/latency manager for proxy nodes. Implements batch testing with concurrency control, caching with TTL, and group-level notifications. Uses a singleton pattern with throttled event emission. Reusable as a generic latency measurement service for any network application requiring efficient, batched health checks with observer updates.
A React hook that creates a shared WebSocket subscription to the mihomo API with automatic reconnection, throttled updates, and cleanup. Multiple components can subscribe to the same socket without duplication. The pattern of a shared, auto-managed WebSocket hook is reusable for any React application needing real-time data with minimal overhead.