# qianyesu/gdou-net-login architecture

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

- Interactive diagram: https://gitdiagram.com/qianyesu/gdou-net-login
- Repository: https://github.com/qianyesu/gdou-net-login

## Overview

GDOU Net Login is a desktop client for campus-network SRUN authentication and connection maintenance, with Windows/Tauri and native macOS implementations. The user configures credentials and network settings, then logs in; status checks and optional reconnect keep the session alive. The README also describes Portal detection, diagnostics, themes, tray operation, and update checking. The excerpts show Windows UI-to-command wiring and macOS manager/client responsibilities; README statements support documented Portal and reconnect behavior where implementation details were not sampled.

Main entry points: [`macos/Sources/Views/ContentView.swift`](https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Views/ContentView.swift) (Native login interface), [`macos/Sources/Services/SrunClient.swift`](https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Services/SrunClient.swift) (macOS SRUN client), [`desktop/src/main.rs`](https://github.com/qianyesu/gdou-net-login/blob/main/desktop/src/main.rs) (Desktop runtime), [`macos/Sources/Services/AutoReconnectManager.swift`](https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Services/AutoReconnectManager.swift) (Reconnect manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_windows["Windows client"]
  node_frontend["Login interface<br/>[main.jsx]"]
  node_win_runtime["Desktop runtime<br/>[main.rs]"]
  node_win_config[("Windows configuration<br/>[config.rs]")]
end

subgraph group_macos["macOS client"]
  node_mac_app["macOS app entry<br/>[App.swift]"]
  node_mac_ui["Native login interface<br/>[ContentView.swift]"]
  node_reconnect["Reconnect manager"]
  node_mac_config[("macOS configuration<br/>[AppConfig.swift]")]
  node_keychain[("Password keychain")]
  node_app_delegate["Window and tray lifecycle<br/>[AppDelegate.swift]"]
end

subgraph group_auth["Authentication and network"]
  node_win_srun["Windows SRUN client<br/>[srun.rs]"]
  node_mac_client["macOS SRUN client<br/>[SrunClient.swift]"]
  node_crypto["SRUN crypto<br/>[SrunCrypto.swift]"]
  node_login_state["Login state model<br/>[LoginState.swift]"]
  node_portal{{"Campus Portal"}}
end

subgraph group_support["Settings and diagnostics"]
  node_network_monitor["Network monitor"]
  node_settings["Advanced settings"]
  node_diagnostics["Diagnostics view"]
  node_traffic["Traffic visualization"]
end

node_user(("User"))

node_user -->|"configures and logs in"| node_frontend
node_frontend -->|"invokes commands"| node_win_runtime
node_win_runtime -->|"loads and saves"| node_win_config
node_win_runtime -->|"calls authentication"| node_win_srun
node_win_runtime -->|"probes and authenticates"| node_portal
node_user -->|"configures and logs in"| node_mac_ui
node_mac_app -->|"presents"| node_mac_ui
node_mac_app -->|"adapts lifecycle"| node_app_delegate
node_mac_ui -->|"requests login and status"| node_reconnect
node_mac_ui -->|"starts monitoring"| node_network_monitor
node_mac_ui -->|"opens settings"| node_settings
node_mac_ui -->|"opens diagnostics"| node_diagnostics
node_mac_ui -->|"renders"| node_traffic
node_reconnect -->|"checks and authenticates"| node_mac_client
node_reconnect -->|"loads saved password"| node_keychain
node_reconnect -->|"uses settings"| node_mac_config
node_mac_client -->|"uses protocol crypto"| node_crypto
node_mac_client -->|"decodes status"| node_login_state
node_mac_client -->|"probes and authenticates"| node_portal
node_settings -->|"probes Portal"| node_mac_client
node_settings -->|"reads interfaces"| node_network_monitor
node_diagnostics -->|"runs diagnostics"| node_mac_client
node_diagnostics -->|"checks network"| node_network_monitor
node_traffic -->|"renders measurements"| node_network_monitor

click node_frontend "https://github.com/qianyesu/gdou-net-login/blob/main/frontend/src/main.jsx"
click node_win_runtime "https://github.com/qianyesu/gdou-net-login/blob/main/desktop/src/main.rs"
click node_win_config "https://github.com/qianyesu/gdou-net-login/blob/main/desktop/src/config.rs"
click node_win_srun "https://github.com/qianyesu/gdou-net-login/blob/main/desktop/src/srun.rs"
click node_mac_app "https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/App.swift"
click node_mac_ui "https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Views/ContentView.swift"
click node_reconnect "https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Services/AutoReconnectManager.swift"
click node_mac_config "https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Models/AppConfig.swift"
click node_keychain "https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Services/KeychainService.swift"
click node_mac_client "https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Services/SrunClient.swift"
click node_crypto "https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Services/SrunCrypto.swift"
click node_login_state "https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Models/LoginState.swift"
click node_network_monitor "https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Services/NetworkMonitor.swift"
click node_settings "https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Views/AdvancedSettingsSheet.swift"
click node_diagnostics "https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Views/DiagnosticsSheet.swift"
click node_traffic "https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Views/TrafficWaveformView.swift"
click node_app_delegate "https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/AppDelegate.swift"

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_frontend,node_win_runtime,node_win_config,node_user toneBlue
class node_mac_app,node_mac_ui,node_reconnect,node_mac_config,node_keychain,node_app_delegate toneAmber
class node_win_srun,node_mac_client,node_crypto,node_login_state,node_portal toneMint
class node_network_monitor,node_settings,node_diagnostics,node_traffic toneRose
```

## Components

### Windows client

- [Login interface](https://github.com/qianyesu/gdou-net-login/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Desktop runtime](https://github.com/qianyesu/gdou-net-login/blob/main/desktop/src/main.rs): `desktop/src/main.rs`
- [Windows configuration](https://github.com/qianyesu/gdou-net-login/blob/main/desktop/src/config.rs): `desktop/src/config.rs`

### macOS client

- [macOS app entry](https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/App.swift): `macos/Sources/App.swift`
- [Native login interface](https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Views/ContentView.swift): `macos/Sources/Views/ContentView.swift`
- [Reconnect manager](https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Services/AutoReconnectManager.swift): `macos/Sources/Services/AutoReconnectManager.swift`
- [macOS configuration](https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Models/AppConfig.swift): `macos/Sources/Models/AppConfig.swift`
- [Password keychain](https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Services/KeychainService.swift): `macos/Sources/Services/KeychainService.swift`
- [Window and tray lifecycle](https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/AppDelegate.swift): `macos/Sources/AppDelegate.swift`

### Authentication and network

- [Windows SRUN client](https://github.com/qianyesu/gdou-net-login/blob/main/desktop/src/srun.rs): `desktop/src/srun.rs`
- [macOS SRUN client](https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Services/SrunClient.swift): `macos/Sources/Services/SrunClient.swift`
- [SRUN crypto](https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Services/SrunCrypto.swift): `macos/Sources/Services/SrunCrypto.swift`
- [Login state model](https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Models/LoginState.swift): `macos/Sources/Models/LoginState.swift`
- **Campus Portal**

### Settings and diagnostics

- [Network monitor](https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Services/NetworkMonitor.swift): `macos/Sources/Services/NetworkMonitor.swift`
- [Advanced settings](https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Views/AdvancedSettingsSheet.swift): `macos/Sources/Views/AdvancedSettingsSheet.swift`
- [Diagnostics view](https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Views/DiagnosticsSheet.swift): `macos/Sources/Views/DiagnosticsSheet.swift`
- [Traffic visualization](https://github.com/qianyesu/gdou-net-login/blob/main/macos/Sources/Views/TrafficWaveformView.swift): `macos/Sources/Views/TrafficWaveformView.swift`

### Other components

- **User**

## Connections

- User → Login interface: configures and logs in (evidence: `README.md`)
- Login interface → Desktop runtime: invokes commands (evidence: `frontend/src/main.jsx`)
- Desktop runtime → Windows configuration: loads and saves (evidence: `desktop/src/main.rs`)
- Desktop runtime → Windows SRUN client: calls authentication (evidence: `desktop/src/main.rs`)
- Desktop runtime → Campus Portal: probes and authenticates (evidence: `README.md`)
- User → Native login interface: configures and logs in (evidence: `README.md`)
- macOS app entry → Native login interface: presents (evidence: `macos/Sources/App.swift`)
- macOS app entry → Window and tray lifecycle: adapts lifecycle (evidence: `macos/Sources/App.swift`)
- Native login interface → Reconnect manager: requests login and status (evidence: `macos/Sources/Views/ContentView.swift`)
- Native login interface → Network monitor: starts monitoring (evidence: `macos/Sources/Views/ContentView.swift`)
- Native login interface → Advanced settings: opens settings (evidence: `macos/Sources/Views/ContentView.swift`)
- Native login interface → Diagnostics view: opens diagnostics (evidence: `macos/Sources/Views/ContentView.swift`)
- Native login interface → Traffic visualization: renders (evidence: `macos/Sources/Views/ContentView.swift`)
- Reconnect manager → macOS SRUN client: checks and authenticates (evidence: `macos/Sources/Services/AutoReconnectManager.swift`)
- Reconnect manager → Password keychain: loads saved password (evidence: `macos/Sources/Services/AutoReconnectManager.swift`)
- Reconnect manager → macOS configuration: uses settings (evidence: `macos/Sources/Services/AutoReconnectManager.swift`)
- macOS SRUN client → SRUN crypto: uses protocol crypto (evidence: `macos/Sources/Services/SrunClient.swift`)
- macOS SRUN client → Login state model: decodes status (evidence: `macos/Sources/Services/SrunClient.swift`)
- macOS SRUN client → Campus Portal: probes and authenticates (evidence: `README.md`)
- Advanced settings → macOS SRUN client: probes Portal (evidence: `macos/Sources/Views/AdvancedSettingsSheet.swift`)
- Advanced settings → Network monitor: reads interfaces (evidence: `macos/Sources/Views/AdvancedSettingsSheet.swift`)
- Diagnostics view → macOS SRUN client: runs diagnostics (evidence: `macos/Sources/Views/DiagnosticsSheet.swift`)
- Diagnostics view → Network monitor: checks network (evidence: `macos/Sources/Views/DiagnosticsSheet.swift`)
- Traffic visualization → Network monitor: renders measurements (evidence: `macos/Sources/Views/TrafficWaveformView.swift`)
