# mustafaahmed007/sentinel-vpn- architecture

> Architecture diagram of the GitHub repository mustafaahmed007/sentinel-vpn-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mustafaahmed007/sentinel-vpn-
- Repository: https://github.com/mustafaahmed007/sentinel-vpn-

## Overview

Sentinel-VPN Ω is a self-hosted Windows WireGuard VPN whose defining workflow is: a user configures a tunnel in the desktop UI, requests connection through the native boundary, and the privileged service coordinates protection and reports status. The documented security stages include firewall lockdown, tunnel startup, handshake, and verification before normal traffic is exposed. The service also owns DNS, profiles, network-change handling, and diagnostics; a separate Go VPS API manages peers and bounded P2P forwarding. Several internal links reflect README architecture documentation; unsampled implementations are not inferred beyond it.

Main entry points: [`crates/service/src/lib.rs`](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/service/src/lib.rs) (VPN service), [`crates/service/src/main.rs`](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/service/src/main.rs) (Service runtime), [`server/cmd/sentinel-server/main.go`](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/server/cmd/sentinel-server/main.go) (Peer and P2P API), [`apps/desktop/src/main.tsx`](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/apps/desktop/src/main.tsx) (Desktop UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Windows client"]
  node_desktop_ui["Desktop UI<br/>[main.tsx]"]
  node_tauri_shell["Tauri shell<br/>[lib.rs]"]
end

subgraph group_protection["Privileged protection"]
  node_service["VPN service<br/>[lib.rs]"]
  node_service_runtime["Service runtime<br/>[main.rs]"]
  node_ipc["Authenticated IPC<br/>[lib.rs]"]
  node_vpn_state["Connection state<br/>[lib.rs]"]
  node_firewall["Windows firewall<br/>[lib.rs]"]
  node_wireguard["WireGuard client<br/>[lib.rs]"]
  node_dns["DNS policy<br/>[lib.rs]"]
  node_network_monitor["Network monitoring<br/>[lib.rs]"]
  node_profiles["Profile management<br/>[lib.rs]"]
  node_diagnostics["Verification diagnostics<br/>[lib.rs]"]
end

subgraph group_vps["VPS control plane"]
  node_control_api["Peer and P2P API<br/>[main.go]"]
  node_peer_store[("Peer and lease state<br/>[main.go]")]
  node_nftables["Port forwarding<br/>[nftables.go]"]
  node_vps_wireguard["VPS WireGuard<br/>[wireguard.go]"]
end

subgraph group_external["External systems"]
  node_windows_network["Windows network stack"]
  node_wireguard_peer["WireGuard peer"]
end

node_user(("VPN user"))
node_operator(("VPS operator"))

node_user -->|"configures and connects"| node_desktop_ui
node_desktop_ui -->|"invokes commands"| node_tauri_shell
node_tauri_shell -->|"uses local IPC"| node_service_runtime
node_service_runtime -->|"reads and writes frames"| node_ipc
node_service_runtime -->|"dispatches requests"| node_service
node_service -->|"orchestrates states"| node_vpn_state
node_service -->|"enforces lockdown"| node_firewall
node_service -->|"manages tunnel"| node_wireguard
node_service -->|"applies DNS policy"| node_dns
node_service -->|"handles transitions"| node_network_monitor
node_service -->|"manages profiles"| node_profiles
node_service -->|"runs verification"| node_diagnostics
node_firewall -->|"sets filtering rules"| node_windows_network
node_wireguard -->|"installs tunnel"| node_windows_network
node_dns -->|"sets DNS servers"| node_windows_network
node_operator -.->|"manages VPS"| node_control_api
node_control_api -->|"reads and updates"| node_peer_store
node_control_api -->|"installs or removes rules"| node_nftables
node_wireguard_peer -.->|"tunnels to"| node_vps_wireguard

click node_desktop_ui "https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/apps/desktop/src/main.tsx"
click node_tauri_shell "https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/apps/desktop/src-tauri/src/lib.rs"
click node_service "https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/service/src/lib.rs"
click node_service_runtime "https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/service/src/main.rs"
click node_ipc "https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/ipc/src/lib.rs"
click node_vpn_state "https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/vpn-core/src/lib.rs"
click node_firewall "https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/firewall-windows/src/lib.rs"
click node_wireguard "https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/wireguard-controller/src/lib.rs"
click node_dns "https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/dns-controller/src/lib.rs"
click node_network_monitor "https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/network-monitor/src/lib.rs"
click node_profiles "https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/profile-manager/src/lib.rs"
click node_diagnostics "https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/diagnostics/src/lib.rs"
click node_control_api "https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/server/cmd/sentinel-server/main.go"
click node_peer_store "https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/server/cmd/sentinel-server/main.go"
click node_nftables "https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/server/internal/firewall/nftables.go"
click node_vps_wireguard "https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/server/internal/wireguard/wireguard.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_desktop_ui,node_tauri_shell,node_user toneBlue
class node_service,node_service_runtime,node_ipc,node_vpn_state,node_firewall,node_wireguard,node_dns,node_network_monitor,node_profiles,node_diagnostics toneAmber
class node_control_api,node_peer_store,node_nftables,node_vps_wireguard toneMint
class node_windows_network,node_wireguard_peer toneRose
class node_operator toneIndigo
```

## Components

### Windows client

- [Desktop UI](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/apps/desktop/src/main.tsx): `apps/desktop/src/main.tsx`
- [Tauri shell](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/apps/desktop/src-tauri/src/lib.rs): `apps/desktop/src-tauri/src/lib.rs`

### Privileged protection

- [VPN service](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/service/src/lib.rs): `crates/service/src/lib.rs`
- [Service runtime](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/service/src/main.rs): `crates/service/src/main.rs`
- [Authenticated IPC](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/ipc/src/lib.rs): `crates/ipc/src/lib.rs`
- [Connection state](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/vpn-core/src/lib.rs): `crates/vpn-core/src/lib.rs`
- [Windows firewall](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/firewall-windows/src/lib.rs): `crates/firewall-windows/src/lib.rs`
- [WireGuard client](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/wireguard-controller/src/lib.rs): `crates/wireguard-controller/src/lib.rs`
- [DNS policy](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/dns-controller/src/lib.rs): `crates/dns-controller/src/lib.rs`
- [Network monitoring](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/network-monitor/src/lib.rs): `crates/network-monitor/src/lib.rs`
- [Profile management](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/profile-manager/src/lib.rs): `crates/profile-manager/src/lib.rs`
- [Verification diagnostics](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/crates/diagnostics/src/lib.rs): `crates/diagnostics/src/lib.rs`

### VPS control plane

- [Peer and P2P API](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/server/cmd/sentinel-server/main.go): `server/cmd/sentinel-server/main.go`
- [Peer and lease state](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/server/cmd/sentinel-server/main.go): `server/cmd/sentinel-server/main.go`
- [Port forwarding](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/server/internal/firewall/nftables.go): `server/internal/firewall/nftables.go`
- [VPS WireGuard](https://github.com/mustafaahmed007/sentinel-vpn-/blob/main/server/internal/wireguard/wireguard.go): `server/internal/wireguard/wireguard.go`

### External systems

- **Windows network stack**
- **WireGuard peer**

### Other components

- **VPN user**
- **VPS operator**

## Connections

- VPN user → Desktop UI: configures and connects (evidence: `README.md`)
- Desktop UI → Tauri shell: invokes commands (evidence: `apps/desktop/src/main.tsx`)
- Tauri shell → Service runtime: uses local IPC (evidence: `README.md`)
- Service runtime → Authenticated IPC: reads and writes frames (evidence: `crates/service/src/main.rs`)
- Service runtime → VPN service: dispatches requests (evidence: `crates/service/src/main.rs`)
- VPN service → Connection state: orchestrates states (evidence: `README.md`)
- VPN service → Windows firewall: enforces lockdown (evidence: `README.md`)
- VPN service → WireGuard client: manages tunnel (evidence: `README.md`)
- VPN service → DNS policy: applies DNS policy (evidence: `README.md`)
- VPN service → Network monitoring: handles transitions (evidence: `README.md`)
- VPN service → Profile management: manages profiles (evidence: `README.md`)
- VPN service → Verification diagnostics: runs verification (evidence: `README.md`)
- Windows firewall → Windows network stack: sets filtering rules (evidence: `crates/firewall-windows/src/lib.rs`)
- WireGuard client → Windows network stack: installs tunnel (evidence: `crates/wireguard-controller/src/lib.rs`)
- DNS policy → Windows network stack: sets DNS servers (evidence: `crates/dns-controller/src/lib.rs`)
- VPS operator → Peer and P2P API: manages VPS
- Peer and P2P API → Peer and lease state: reads and updates (evidence: `server/cmd/sentinel-server/main.go`)
- Peer and P2P API → Port forwarding: installs or removes rules (evidence: `server/cmd/sentinel-server/main.go`)
- WireGuard peer → VPS WireGuard: tunnels to
