Architecture
rh-mgr is a hybrid application built with:
- Frontend: React + TypeScript (bootstrapped with Vite).
- Backend / Host: Tauri (Rust).
- Database: SQLite (local storage for library metadata).
Core Components
Frontend (/src)
- React Components: The UI is built with functional components and hooks.
- Tailwind CSS: Used for styling.
- Radix UI: Provides accessible UI primitives (dialogs, tooltips, etc.).
Backend (/src-tauri)
- Tauri Commands: Functions exposed from Rust to the frontend (e.g.,
patch_rom,launch_emulator). - Patching Logic: Rust implementation of IPS/BPS/UPS patching (using existing crates or custom logic).
- Database:
rusqlitehandles interactions with the local SQLite DB.
Data Flow
- User Action: User clicks "Patch" in UI.
- IPC: Frontend invokes a Tauri command (
invoke('patch_hack', ...)). - Rust Backend:
- Downloads file.
- Reads clean ROM.
- Applies patch.
- Writes new file.
- Updates SQLite database.
- Response: Backend returns success/failure to UI.