# protonvpn/win-app architecture

> Architecture diagram of the GitHub repository protonvpn/win-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/protonvpn/win-app
- Repository: https://github.com/protonvpn/win-app

## Overview

Proton VPN for Windows is a desktop VPN client whose main workflow is user interaction in the GUI, authenticated service access and server selection, then a service-managed VPN connection with state reported back to the app. The README documents the service’s roles in managing OpenVPN, Windows firewall rules, and split tunneling; sampled source adds API transport, connection orchestration, and service-to-client state streaming. Several broader capabilities are represented at their documented subsystem level because their implementation files were not sampled.

Main entry points: [`src/ProtonVPN.Service/VpnController.cs`](https://github.com/protonvpn/win-app/blob/master/src/ProtonVPN.Service/VpnController.cs) (VPN service), [`src/Client/ProtonVPN.Client/App.xaml.cs`](https://github.com/protonvpn/win-app/blob/master/src/Client/ProtonVPN.Client/App.xaml.cs) (GUI app), [`src/Api/ProtonVPN.Api/ApiClient.cs`](https://github.com/protonvpn/win-app/blob/master/src/Api/ProtonVPN.Api/ApiClient.cs) (API client), [`src/Client/Logic`](https://github.com/protonvpn/win-app/tree/master/src/Client/Logic) (Client logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Desktop client"]
  node_gui["GUI app<br/>[App.xaml.cs]"]
  node_clientlogic["Client logic"]
  node_favorites["Server favorites"]
end

subgraph group_backend["API and account"]
  node_api["API client<br/>[ApiClient.cs]"]
  node_apicontracts["API contracts"]
  node_auth["Authentication<br/>[ProtonVPN.Api]"]
  node_serverdata["Server catalog<br/>[Servers]"]
  node_updates["App updates<br/>[ProtonVPN.Update]"]
end

subgraph group_connection["VPN connection"]
  node_service["VPN service<br/>[VpnController.cs]"]
  node_ipc["Process communication"]
  node_state["Connection orchestration<br/>[ProtonVPN.Service]"]
  node_settings[("Service settings")]
  node_guesthole[("Guest-hole servers")]
end

subgraph group_platform["Windows platform"]
  node_tap["TAP adapter"]
  node_firewall["Windows firewall"]
  node_splitdriver["Callout driver"]
end

node_user(("VPN user"))
node_proton{{"Proton VPN API"}}
node_updatefeed{{"Release feed"}}
node_openvpn{{"OpenVPN process"}}

node_user -->|"uses"| node_gui
node_gui -->|"starts and stops"| node_service
node_gui -->|"invokes"| node_clientlogic
node_clientlogic -->|"stores server IDs"| node_favorites
node_gui -->|"requests account data"| node_api
node_api -->|"deserializes"| node_apicontracts
node_api -->|"sends HTTP requests"| node_proton
node_api -->|"uses"| node_auth
node_api -->|"receives server data"| node_serverdata
node_gui -->|"checks for updates"| node_updates
node_updates -->|"reads releases"| node_updatefeed
node_service -->|"reads and writes"| node_settings
node_service -->|"orchestrates"| node_state
node_service -->|"manages tunnel"| node_openvpn
node_openvpn -->|"uses adapter"| node_tap
node_service -->|"manages rules"| node_firewall
node_service -->|"starts and stops"| node_splitdriver
node_service -->|"publishes VPN state"| node_ipc
node_ipc -->|"streams state"| node_gui
node_clientlogic -.->|"loads server data"| node_guesthole

click node_gui "https://github.com/protonvpn/win-app/blob/master/src/Client/ProtonVPN.Client/App.xaml.cs"
click node_clientlogic "https://github.com/protonvpn/win-app/tree/master/src/Client/Logic"
click node_favorites "https://github.com/protonvpn/win-app/blob/master/src/Client/Logic/Servers/ProtonVPN.Client.Logic.Servers/FavoriteServers/FavoriteServersStorage.cs"
click node_api "https://github.com/protonvpn/win-app/blob/master/src/Api/ProtonVPN.Api/ApiClient.cs"
click node_apicontracts "https://github.com/protonvpn/win-app/tree/master/src/Api/ProtonVPN.Api.Contracts"
click node_auth "https://github.com/protonvpn/win-app/tree/master/src/Api/ProtonVPN.Api"
click node_serverdata "https://github.com/protonvpn/win-app/tree/master/src/Api/ProtonVPN.Api.Contracts/Servers"
click node_updates "https://github.com/protonvpn/win-app/tree/master/src/Update/ProtonVPN.Update"
click node_service "https://github.com/protonvpn/win-app/blob/master/src/ProtonVPN.Service/VpnController.cs"
click node_ipc "https://github.com/protonvpn/win-app/blob/master/src/ProtonVPN.Service/ProcessCommunication/ClientControllerSender.cs"
click node_state "https://github.com/protonvpn/win-app/tree/master/src/ProtonVPN.Service"
click node_settings "https://github.com/protonvpn/win-app/blob/master/src/ProtonVPN.Service/Settings/SettingsFileStorage.cs"
click node_guesthole "https://github.com/protonvpn/win-app/blob/master/src/Client/Logic/Connection/ProtonVPN.Client.Logic.Connection/GuestHole/GuestHoleServersFileStorage.cs"

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_gui,node_clientlogic,node_favorites,node_user toneBlue
class node_api,node_apicontracts,node_auth,node_serverdata,node_updates toneAmber
class node_service,node_ipc,node_state,node_settings,node_guesthole,node_proton toneMint
class node_tap,node_firewall,node_splitdriver toneRose
class node_updatefeed,node_openvpn toneIndigo
```

## Components

### Desktop client

- [GUI app](https://github.com/protonvpn/win-app/blob/master/src/Client/ProtonVPN.Client/App.xaml.cs): `src/Client/ProtonVPN.Client/App.xaml.cs`
- [Client logic](https://github.com/protonvpn/win-app/tree/master/src/Client/Logic): `src/Client/Logic`
- [Server favorites](https://github.com/protonvpn/win-app/blob/master/src/Client/Logic/Servers/ProtonVPN.Client.Logic.Servers/FavoriteServers/FavoriteServersStorage.cs): `src/Client/Logic/Servers/ProtonVPN.Client.Logic.Servers/FavoriteServers/FavoriteServersStorage.cs`

### API and account

- [API client](https://github.com/protonvpn/win-app/blob/master/src/Api/ProtonVPN.Api/ApiClient.cs): `src/Api/ProtonVPN.Api/ApiClient.cs`
- [API contracts](https://github.com/protonvpn/win-app/tree/master/src/Api/ProtonVPN.Api.Contracts): `src/Api/ProtonVPN.Api.Contracts`
- [Authentication](https://github.com/protonvpn/win-app/tree/master/src/Api/ProtonVPN.Api): `src/Api/ProtonVPN.Api`
- [Server catalog](https://github.com/protonvpn/win-app/tree/master/src/Api/ProtonVPN.Api.Contracts/Servers): `src/Api/ProtonVPN.Api.Contracts/Servers`
- [App updates](https://github.com/protonvpn/win-app/tree/master/src/Update/ProtonVPN.Update): `src/Update/ProtonVPN.Update`

### VPN connection

- [VPN service](https://github.com/protonvpn/win-app/blob/master/src/ProtonVPN.Service/VpnController.cs): `src/ProtonVPN.Service/VpnController.cs`
- [Process communication](https://github.com/protonvpn/win-app/blob/master/src/ProtonVPN.Service/ProcessCommunication/ClientControllerSender.cs): `src/ProtonVPN.Service/ProcessCommunication/ClientControllerSender.cs`
- [Connection orchestration](https://github.com/protonvpn/win-app/tree/master/src/ProtonVPN.Service): `src/ProtonVPN.Service`
- [Service settings](https://github.com/protonvpn/win-app/blob/master/src/ProtonVPN.Service/Settings/SettingsFileStorage.cs): `src/ProtonVPN.Service/Settings/SettingsFileStorage.cs`
- [Guest-hole servers](https://github.com/protonvpn/win-app/blob/master/src/Client/Logic/Connection/ProtonVPN.Client.Logic.Connection/GuestHole/GuestHoleServersFileStorage.cs): `src/Client/Logic/Connection/ProtonVPN.Client.Logic.Connection/GuestHole/GuestHoleServersFileStorage.cs`

### Windows platform

- **TAP adapter**
- **Windows firewall**
- **Callout driver**

### Other components

- **VPN user**
- **Proton VPN API**
- **Release feed**
- **OpenVPN process**

## Connections

- VPN user → GUI app: uses
- GUI app → VPN service: starts and stops
- GUI app → Client logic: invokes
- Client logic → Server favorites: stores server IDs
- GUI app → API client: requests account data
- API client → API contracts: deserializes
- API client → Proton VPN API: sends HTTP requests
- API client → Authentication: uses
- API client → Server catalog: receives server data
- GUI app → App updates: checks for updates
- App updates → Release feed: reads releases
- VPN service → Service settings: reads and writes
- VPN service → Connection orchestration: orchestrates
- VPN service → OpenVPN process: manages tunnel
- OpenVPN process → TAP adapter: uses adapter
- VPN service → Windows firewall: manages rules
- VPN service → Callout driver: starts and stops
- VPN service → Process communication: publishes VPN state
- Process communication → GUI app: streams state
- Client logic → Guest-hole servers: loads server data
