Architecture Overview¶
Rover uses an Electron + sing-box architecture, divided into three layers: the application layer, the core layer, and the system service layer.
Overall Architecture¶
Rover App (Electron + React + TypeScript)
├── Dashboard / Profiles / Proxies
├── Policies / Rule Sets / Connections
└── DNS Policies / Settings / Logs
│
│ IPC Communication (Electron Main Process)
▼
┌─────────────────────────────────────────────────────────────┐
│ Main Process (Node.js) │
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ Path 1: Local Mode │ │
│ │ │ │
│ │ Rover ──────────────► sing-box (subprocess) │ │
│ │ Direct Start (Normal user privileges) │ │
│ │ │ │
│ └─────────────────────────────────────────────────────┘ │
│ ▲ │
│ │ │
│ ┌──────────────────────────┼──────────────────────────┐ │
│ │ │ Path 2: Service Mode │ │
│ │ │ (Service) │ │
│ │ │ │ │
│ │ Rover ────────────────►│ RoverService (System) │ │
│ │ HTTP over │ └── Start/Stop sing-box │ │
│ │ Socket / Named Pipe │ (Admin privileges) │ │
│ │ │ │ │
│ └──────────────────────────┴──────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
Key Components¶
| Component | Tech Stack | Responsibility |
|---|---|---|
| Rover App | Electron + React | UI, data management, config generation |
| sing-box Core | Go | Proxy forwarding, traffic routing, DNS resolution |
| RoverService | Go (system service) | sing-box process management, local DoH DNS server, privileged file operations |
| JSON Data Files | Node.js fs | Store policy rules, DNS policies, settings |
| sing-box API | HTTP | Runtime status queries, connection management |
Data Flow¶
- User performs an action in the UI (add rule, switch node, etc.)
- The action is written to JSON data files
- The config generator reads from the JSON data and produces a sing-box config
- The core manager restarts sing-box to load the new config
- sing-box processes traffic according to the configuration
Why JSON Files?
Rover uses JSON files as its local data storage because: - Simple and intuitive format, easy to debug and manually edit - No extra dependencies — Node.js native support - Human-readable, convenient for backup and migration - Ideal for lightweight single-user desktop application storage
Communication Mechanisms¶
| Method | Direction | Purpose |
|---|---|---|
| Electron IPC | Renderer → Main | Passing UI actions to the backend |
| HTTP API | Main ↔ sing-box (9090) | Status queries, connection management |
| HTTP/DoH | Main ↔ RoverService | DNS query forwarding |
| HTTP API | Main ↔ RoverService | sing-box process management (start/stop/restart) |