# playrood32/adw-network architecture

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

- Interactive diagram: https://gitdiagram.com/playrood32/adw-network
- Repository: https://github.com/playrood32/adw-network

## Overview

Adwaita Network is a GNOME network-management desktop app. Users manage Wi-Fi and Ethernet, configure and run hotspots, administer connected clients, and manage connection profiles/VPNs through separate UI pages. The main control path is the window and page handlers invoking network, hotspot, configuration, or modem services; these services interact with NetworkManager, persistent files, and optional system tools. The README documents major capabilities not visible in the sampled excerpts; those are represented at their supported module or directory paths, with uncertain internal wiring omitted.

Main entry points: [`src/window.rs`](https://github.com/playrood32/adw-network/blob/main/src/window.rs) (App window), [`src/ui/hotspot_page/mod.rs`](https://github.com/playrood32/adw-network/blob/main/src/ui/hotspot_page/mod.rs) (Hotspot page), [`src/ui/devices_page.rs`](https://github.com/playrood32/adw-network/blob/main/src/ui/devices_page.rs) (Devices page), [`src/hotspot.rs`](https://github.com/playrood32/adw-network/blob/main/src/hotspot.rs) (Hotspot service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application UI"]
  node_window["App window<br/>[window.rs]"]
  node_wifi["Wi-Fi page<br/>[mod.rs]"]
  node_ethernet["Ethernet page<br/>[ethernet_page.rs]"]
  node_devices["Devices page<br/>[devices_page.rs]"]
  node_hotspot_ui["Hotspot page<br/>[mod.rs]"]
end

subgraph group_network["Network Management"]
  node_network_service["Network service<br/>[nm.rs]"]
  node_network_dbus["Network D-Bus<br/>[nm_dbus.rs]"]
  node_modem_client["Modem client<br/>[modem_manager.rs]"]
  node_qr["QR generation<br/>[qr.rs]"]
end

subgraph group_hotspot["Hotspot and Clients"]
  node_hotspot_service["Hotspot service<br/>[hotspot.rs]"]
  node_hotspot_runtime["Runtime rules<br/>[hotspot_runtime.rs]"]
  node_leases["Client leases<br/>[leases.rs]"]
  node_hotspot_config["Hotspot config<br/>[config.rs]"]
  node_secrets["Password storage<br/>[secrets.rs]"]
end

subgraph group_profiles["Profiles and Settings"]
  node_profiles_ui["Profiles page<br/>[profiles_page.rs]"]
  node_profiles_service["Profile service<br/>[profiles.rs]"]
  node_settings["App settings<br/>[config.rs]"]
end

node_user(("Desktop user"))
node_nm{{"NetworkManager"}}
node_modem{{"ModemManager"}}
node_config_files[("App config files")]
node_system_tools{{"tc / nftables"}}

node_user -->|"uses"| node_window
node_window -->|"presents"| node_wifi
node_window -->|"presents"| node_ethernet
node_window -->|"presents"| node_hotspot_ui
node_window -->|"presents"| node_devices
node_window -->|"presents"| node_profiles_ui
node_wifi -->|"scans / connects"| node_network_service
node_ethernet -->|"manages connections"| node_network_service
node_profiles_ui -->|"manages VPNs"| node_network_service
node_network_service -->|"uses"| node_network_dbus
node_network_dbus -->|"D-Bus requests"| node_nm
node_devices -->|"reads / controls"| node_modem_client
node_modem_client -.->|"D-Bus requests"| node_modem
node_hotspot_ui -->|"starts / stops"| node_hotspot_service
node_hotspot_ui -->|"saves settings"| node_hotspot_config
node_hotspot_config -->|"reads / writes"| node_config_files
node_hotspot_ui -->|"stores password"| node_secrets
node_hotspot_ui -->|"requests QR"| node_qr
node_hotspot_service -->|"configures hotspot"| node_nm
node_hotspot_service -->|"syncs rules"| node_hotspot_runtime
node_hotspot_service -->|"reads clients"| node_leases
node_devices -->|"lists clients"| node_leases
node_devices -->|"edits device rules"| node_hotspot_config
node_hotspot_runtime -.->|"applies limits"| node_system_tools
node_profiles_ui -->|"manages profiles"| node_profiles_service
node_profiles_service -->|"reads / writes"| node_config_files
node_profiles_ui -->|"loads settings"| node_settings
node_settings -->|"reads / writes"| node_config_files

click node_window "https://github.com/playrood32/adw-network/blob/main/src/window.rs"
click node_wifi "https://github.com/playrood32/adw-network/blob/main/src/ui/wifi_page/mod.rs"
click node_ethernet "https://github.com/playrood32/adw-network/blob/main/src/ui/ethernet_page.rs"
click node_devices "https://github.com/playrood32/adw-network/blob/main/src/ui/devices_page.rs"
click node_hotspot_ui "https://github.com/playrood32/adw-network/blob/main/src/ui/hotspot_page/mod.rs"
click node_network_service "https://github.com/playrood32/adw-network/blob/main/src/nm.rs"
click node_network_dbus "https://github.com/playrood32/adw-network/blob/main/src/nm_dbus.rs"
click node_modem_client "https://github.com/playrood32/adw-network/blob/main/src/modem_manager.rs"
click node_hotspot_service "https://github.com/playrood32/adw-network/blob/main/src/hotspot.rs"
click node_hotspot_runtime "https://github.com/playrood32/adw-network/blob/main/src/hotspot_runtime.rs"
click node_leases "https://github.com/playrood32/adw-network/blob/main/src/leases.rs"
click node_hotspot_config "https://github.com/playrood32/adw-network/blob/main/src/config.rs"
click node_profiles_ui "https://github.com/playrood32/adw-network/blob/main/src/ui/profiles_page.rs"
click node_profiles_service "https://github.com/playrood32/adw-network/blob/main/src/profiles.rs"
click node_settings "https://github.com/playrood32/adw-network/blob/main/src/config.rs"
click node_qr "https://github.com/playrood32/adw-network/blob/main/src/qr.rs"
click node_secrets "https://github.com/playrood32/adw-network/blob/main/src/secrets.rs"

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_window,node_wifi,node_ethernet,node_devices,node_hotspot_ui,node_user toneBlue
class node_network_service,node_network_dbus,node_modem_client,node_qr,node_config_files toneAmber
class node_hotspot_service,node_hotspot_runtime,node_leases,node_hotspot_config,node_secrets toneMint
class node_profiles_ui,node_profiles_service,node_settings toneRose
class node_nm,node_modem,node_system_tools toneIndigo
```

## Components

### Application UI

- [App window](https://github.com/playrood32/adw-network/blob/main/src/window.rs): `src/window.rs`
- [Wi-Fi page](https://github.com/playrood32/adw-network/blob/main/src/ui/wifi_page/mod.rs): `src/ui/wifi_page/mod.rs`
- [Ethernet page](https://github.com/playrood32/adw-network/blob/main/src/ui/ethernet_page.rs): `src/ui/ethernet_page.rs`
- [Devices page](https://github.com/playrood32/adw-network/blob/main/src/ui/devices_page.rs): `src/ui/devices_page.rs`
- [Hotspot page](https://github.com/playrood32/adw-network/blob/main/src/ui/hotspot_page/mod.rs): `src/ui/hotspot_page/mod.rs`

### Network Management

- [Network service](https://github.com/playrood32/adw-network/blob/main/src/nm.rs): `src/nm.rs`
- [Network D-Bus](https://github.com/playrood32/adw-network/blob/main/src/nm_dbus.rs): `src/nm_dbus.rs`
- [Modem client](https://github.com/playrood32/adw-network/blob/main/src/modem_manager.rs): `src/modem_manager.rs`
- [QR generation](https://github.com/playrood32/adw-network/blob/main/src/qr.rs): `src/qr.rs`

### Hotspot and Clients

- [Hotspot service](https://github.com/playrood32/adw-network/blob/main/src/hotspot.rs): `src/hotspot.rs`
- [Runtime rules](https://github.com/playrood32/adw-network/blob/main/src/hotspot_runtime.rs): `src/hotspot_runtime.rs`
- [Client leases](https://github.com/playrood32/adw-network/blob/main/src/leases.rs): `src/leases.rs`
- [Hotspot config](https://github.com/playrood32/adw-network/blob/main/src/config.rs): `src/config.rs`
- [Password storage](https://github.com/playrood32/adw-network/blob/main/src/secrets.rs): `src/secrets.rs`

### Profiles and Settings

- [Profiles page](https://github.com/playrood32/adw-network/blob/main/src/ui/profiles_page.rs): `src/ui/profiles_page.rs`
- [Profile service](https://github.com/playrood32/adw-network/blob/main/src/profiles.rs): `src/profiles.rs`
- [App settings](https://github.com/playrood32/adw-network/blob/main/src/config.rs): `src/config.rs`

### Other components

- **Desktop user**
- **NetworkManager**
- **ModemManager**
- **App config files**
- **tc / nftables**

## Connections

- Desktop user → App window: uses
- App window → Wi-Fi page: presents
- App window → Ethernet page: presents
- App window → Hotspot page: presents
- App window → Devices page: presents
- App window → Profiles page: presents
- Wi-Fi page → Network service: scans / connects
- Ethernet page → Network service: manages connections
- Profiles page → Network service: manages VPNs
- Network service → Network D-Bus: uses
- Network D-Bus → NetworkManager: D-Bus requests
- Devices page → Modem client: reads / controls
- Modem client → ModemManager: D-Bus requests
- Hotspot page → Hotspot service: starts / stops
- Hotspot page → Hotspot config: saves settings
- Hotspot config → App config files: reads / writes
- Hotspot page → Password storage: stores password
- Hotspot page → QR generation: requests QR
- Hotspot service → NetworkManager: configures hotspot
- Hotspot service → Runtime rules: syncs rules
- Hotspot service → Client leases: reads clients
- Devices page → Client leases: lists clients
- Devices page → Hotspot config: edits device rules
- Runtime rules → tc / nftables: applies limits
- Profiles page → Profile service: manages profiles
- Profile service → App config files: reads / writes
- Profiles page → App settings: loads settings
- App settings → App config files: reads / writes
