$ show AnInsomniacy/rayburst
Motrix Next is a full-featured, cross-platform desktop download manager built from the ground up as a successor to Motrix. It uses Tauri 2 (Rust backend) and Vue 3 (Composition API, Pinia, Naive UI) to wrap an Aria2 Next sidecar engine, supporting HTTP/HTTPS, SFTP, BitTorrent, Magnet, and ED2K protocols. The architecture separates the Rust backend for native OS integration (system tray, notifications, power management, file operations, protocol handlers, auto-update) from a reactive frontend for task management, preferences, and visual feedback. Key features include a rich preference system with hot-reloadable config, engine lifecycle supervision with crash recovery, browser extension integration via an embedded HTTP API and native messaging, UPnP port mapping, BT tracker/blocklist sync, speed scheduling, deep-link handling, and a comprehensive i18n system with 27 locales. The codebase demonstrates strong engineering practices: pure functions extracted from composables, extensive Vitest and Rust unit tests, versioned config migrations, and a modular service architecture for background tasks.
The LLM identified 5 files worth highlighting for reuse:
Implements a versioned configuration migration pattern using an array of idempotent migration functions. Each migration transforms the config object in place, catches errors without blocking subsequent migrations, and a compile-time consistency guard ensures CONFIG_VERSION equals migrations.length. This is a pure, framework-agnostic pattern reusable in any project needing schema evolution.
Provides pure functions for URI normalization, magnet/thunder/ED2K parsing, content-disposition filename extraction, and sanitization. Includes HTTP URL normalization (lowercase scheme, percent-encoding, path deduplication), magnet link parameter extraction, and filename derivation from URL path or Content-Disposition header. Well-tested and fully independent of the rest of the codebase.
Exposes Tauri commands for file system operations with robust cross-platform handling: path normalization (\ to /, UNC prefix handling via dunce crate), reveal-in-explorer with Windows Shell API fallback, move/delete with cross-filesystem copy and collision numbering, and diagnostic log export as zip. The security-conscious path traversal sanitization and error handling patterns are reusable in any Tauri application needing safe file operations.
Provides a cleanup routine for the download engine's sidecar: force-kills lingering processes (platform-specific termination), removes stale lock files and session files, and frees engine-related ports. The pattern of graceful shutdown, escalation to termination, and port scavenging is reusable for any application managing external processes with resource conflicts.
Implements a file classification engine that assigns download categories (Videos, Music, Images, Documents, Archives, Programs, Others) based on file extension, URL patterns (wildcards, regex), and content-type hints. Each category defines a sortable list of rules (extensions, patterns, regex) for routing downloads to subdirectories. The engine is pure, well-tested, and reusable in any application needing download categorization.