$ show 0xle0ne/wireguard-gui
This repository implements a Linux desktop GUI for managing WireGuard VPN profiles. It is built using the Tauri v2 framework, combining a Rust backend for system-level operations (connection management, encryption, file I/O) with a Next.js 16 (React 19) frontend for the user interface. The application allows users to create, import, export, connect, and disconnect WireGuard tunnels, and provides optional at-rest encryption for profile data using a user-defined PIN. The architecture follows a clean IPC-based separation of concerns. The frontend communicates with the Rust backend exclusively through typed Tauri commands defined in `lib/effects.ts`. The backend in `src-tauri/src/main.rs` manages application state, executes WireGuard commands via shell scripts (`wg.sh`), and handles encryption via a dedicated security module. The UI is built from a comprehensive library of ~40+ composable, accessible components in `components/ui/`, demonstrating a strong commitment to frontend architecture and design system principles. The most reusable assets are the Rust security module (`security.rs`), which implements PIN-based encryption using Argon2id and XChaCha20-Poly1305 in a self-contained manner, and the typed IPC service layer (`lib/effects.ts`), which cleanly decouples the UI from the backend. The UI component library, while styled for this project, follows an architectural pattern (atomic, composable primitives) that is directly transferable to other React projects. The project is actively maintained with CI/CD, E2E testing, and semantic versioning, though it carries some technical drift in its Nix build configuration (targeting Tauri v1) and deprecated plugin permissions.
The LLM identified 3 files worth highlighting for reuse:
A self-contained Rust module implementing at-rest encryption for sensitive profile data. It uses Argon2id for memory-hard key derivation from a user PIN and XChaCha20-Poly1305 for authenticated encryption. The module handles salt generation, nonce management, and secure memory clearing. It is a textbook example of a portable security utility that could be extracted into any Rust project requiring PIN-based encryption with minimal modification.
Serves as the typed API facade between the React frontend and the Tauri Rust backend. It defines all IPC commands as strongly-typed async functions (e.g., `getProfiles`, `connectProfile`, `encryptProfiles`), providing a single source of truth for the frontend-backend contract. This pattern decouples the UI from the backend implementation, making the frontend testable and the backend swappable. It is a clean implementation of the Service Layer pattern for Tauri applications.
A representative file from the project's extensive UI component library (~40+ components). Built on Radix UI primitives, these components follow a consistent pattern of composition, accessibility, and type safety. While the specific styling is project-specific, the architectural pattern of building a UI kit from atomic, composable primitives is a reusable pattern. An engineer could extract the entire `components/ui/` directory and use it as a foundation for any React application, demonstrating strong frontend architecture skills.