How libnyanpasu/clash-nyanpasu works
Based on our analysis of the file tree and the README, Clash Nyanpasu is a desktop GUI application for the Clash network proxy that leverages Tauri for its desktop-side integration. In short, it is a full‐stack desktop application written in Rust (backend) with a modern web frontend (React/TypeScript with Material You styling and Tailwind CSS). The project is architected with a clear separation of concerns, where the Rust backend (with several dedicated crates and modules) handles core functions, IPC, plugins (like a deep linking plugin), and various services, while the frontend (in multiple directories such as “interface”, “nyanpasu”, and “ui”) implements the user interface and interacts with the backend via Tauri’s IPC mechanisms.
Main components
• Frontend User Interface:
– The “frontend/nyanpasu” directory contains the primary application UI built with React, styled with Material You design and Tailwind.
– The “frontend/interface” directory handles the communication and bindings (via Tauri IPC) between the frontend and the backend.
– The “frontend/ui” directory holds additional UI components and theme definitions.
• Backend (Rust/Tauri):
– The “backend/tauri” directory comprises the core Tauri application. It hosts modules for configuration, IPC handling, core functionality (e.g., service management, migration, updater, tray, and logging), and system integration.
– Other Rust crates like “nyanpasu-egui”, “boa_utils”, and “nyanpasu-macro” provide specialized utilities and macros that extend the application’s capabilities.
– The “tauri-plugin-deep-link” provides extra integration for deep linking.
• Build and Automation:
– Multiple GitHub workflow YAML files, Rust/Cargo configuration files, and scripts (in the “scripts” directory) handle building, dependency management, publishing, and continuous integration.
• External Dependencies and Integrations:
– The project relies on external services including Clash (the proxy backend), Clash Premium, Clash Rust, and even Mihomo among other related projects.
• Build automation and deployment engines (GitHub workflows, scripts) in a distinct section, showing their relationship to both the frontend and backend build processes.
• If desired, note external dependencies such as Clash, clarifying that the backend interacts with these services.
Important Architectural Patterns & Technologies
• Separation between the frontend and backend through a clear IPC boundary.
• That the backend follows modular design principles with separate Rust crates for utilities, UI integrations (nyanpasu-egui), and macro processing (nyanpasu-macro).
• Specify the use of Tauri as the glue that integrates the web-based frontend with native system capabilities on Windows, macOS, and Linux.
• For the frontend, mention the use of modern web technologies (React, Vite, TypeScript) and design systems (Material You, Tailwind).