# qw-ai-code/aether architecture

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

- Interactive diagram: https://gitdiagram.com/qw-ai-code/aether
- Repository: https://github.com/qw-ai-code/aether

## Overview

Aether Mobile is an Android VPN client built around an in-app tunnelling engine. The primary workflow is selecting a saved profile, obtaining Android VPN consent when needed, starting the service and engine, and exposing connection state to the user. Other product branches include routing and transport choices, LAN tunnel sharing, AI assistance, team/zero-trust access, and diagnostics. The excerpts show only selected wiring; unsampled subsystem links are omitted or marked unverified rather than treated as inspected.

Main entry points: [`app/src/main/java/studio/cluvex/aether/MainActivity.kt`](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/MainActivity.kt) (Main activity), [`app/src/main/java/studio/cluvex/aether/vpn/AetherVpnService.kt`](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/vpn/AetherVpnService.kt) (VPN service), [`app/src/main/java/studio/cluvex/aether/core/AetherController.kt`](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/AetherController.kt) (Connection controller), [`app/src/main/java/studio/cluvex/aether/core/ShareBridge.kt`](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/ShareBridge.kt) (Share bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Android app"]
  node_main["Main activity<br/>[MainActivity.kt]"]
  node_home["Home screen<br/>[HomeScreen.kt]"]
  node_profile[("Profile store<br/>[ProfileStore.kt]")]
  node_state["Connection state<br/>[ConnectionState.kt]"]
  node_controller["Connection controller"]
  node_diaglog[("Diagnostics log<br/>[DiagnosticsLog.kt]")]
end

subgraph group_tunnel["Tunnel runtime"]
  node_vpn["VPN service"]
  node_engineprocess["Engine process<br/>[AetherProcess.kt]"]
  node_config["Tunnel configuration<br/>[TunnelConfig.kt]"]
  node_routing["Routing engine<br/>[RoutingEngine.kt]"]
  node_native["Aether native engine<br/>[lib.rs]"]
  node_transports["Transport backends"]
end

subgraph group_sharing["LAN sharing"]
  node_sharebridge["Share bridge<br/>[ShareBridge.kt]"]
  node_sharepages["Share pages<br/>[SharePages.kt]"]
  node_shareguard["Share leak guard<br/>[ShareLeakGuard.kt]"]
end

subgraph group_assist["AI assistance"]
  node_aisession["AI session<br/>[AiSession.kt]"]
  node_gemini["Gemini client<br/>[GeminiClient.kt]"]
end

subgraph group_access["Identity and access"]
  node_teamaccess["Team and zero-trust<br/>[ZeroTrustSignIn.kt]"]
  node_teamui["Membership settings"]
end

node_user(("User"))
node_lanclient(("LAN client"))
node_geminiservice["Gemini API"]
node_androidvpn["Android VPN consent"]

node_user -->|"opens app"| node_main
node_main -->|"renders"| node_home
node_main -->|"loads profile"| node_profile
node_main -->|"starts connection"| node_controller
node_main -->|"requests consent"| node_androidvpn
node_controller -->|"starts service"| node_vpn
node_controller -->|"publishes state"| node_state
node_vpn -->|"launches engine"| node_engineprocess
node_vpn -->|"updates state"| node_state
node_vpn -->|"records events"| node_diaglog
node_engineprocess -.->|"loads native engine"| node_native
node_vpn -.->|"starts sharing"| node_sharebridge
node_sharebridge -.->|"serves pages"| node_sharepages
node_sharebridge -.->|"protects traffic"| node_shareguard
node_lanclient -.->|"opens setup"| node_sharepages
node_aisession -->|"requests generation"| node_gemini
node_gemini -.->|"sends request"| node_geminiservice
node_gemini -->|"uses diagnostics"| node_diaglog
node_teamui -.->|"manages access"| node_teamaccess

click node_main "https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/MainActivity.kt"
click node_home "https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/ui/HomeScreen.kt"
click node_profile "https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/data/ProfileStore.kt"
click node_state "https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/model/ConnectionState.kt"
click node_controller "https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/AetherController.kt"
click node_vpn "https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/vpn/AetherVpnService.kt"
click node_engineprocess "https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/AetherProcess.kt"
click node_config "https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/TunnelConfig.kt"
click node_routing "https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/RoutingEngine.kt"
click node_native "https://github.com/qw-ai-code/aether/blob/main/native/aether/aether/src/lib.rs"
click node_transports "https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/transport/ExternalTransport.kt"
click node_sharebridge "https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/ShareBridge.kt"
click node_sharepages "https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/SharePages.kt"
click node_shareguard "https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/ShareLeakGuard.kt"
click node_aisession "https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/ai/AiSession.kt"
click node_gemini "https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/ai/GeminiClient.kt"
click node_diaglog "https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/DiagnosticsLog.kt"
click node_teamaccess "https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/ZeroTrustSignIn.kt"
click node_teamui "https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/ui/settings/ZeroTrustMembership.kt"

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_main,node_home,node_profile,node_state,node_controller,node_diaglog,node_user,node_lanclient toneBlue
class node_vpn,node_engineprocess,node_config,node_routing,node_native,node_transports toneAmber
class node_sharebridge,node_sharepages,node_shareguard,node_geminiservice toneMint
class node_aisession,node_gemini toneRose
class node_teamaccess,node_teamui,node_androidvpn toneIndigo
```

## Components

### Android app

- [Main activity](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/MainActivity.kt): `app/src/main/java/studio/cluvex/aether/MainActivity.kt`
- [Home screen](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/ui/HomeScreen.kt): `app/src/main/java/studio/cluvex/aether/ui/HomeScreen.kt`
- [Profile store](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/data/ProfileStore.kt): `app/src/main/java/studio/cluvex/aether/data/ProfileStore.kt`
- [Connection state](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/model/ConnectionState.kt): `app/src/main/java/studio/cluvex/aether/model/ConnectionState.kt`
- [Connection controller](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/AetherController.kt): `app/src/main/java/studio/cluvex/aether/core/AetherController.kt`
- [Diagnostics log](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/DiagnosticsLog.kt): `app/src/main/java/studio/cluvex/aether/core/DiagnosticsLog.kt`

### Tunnel runtime

- [VPN service](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/vpn/AetherVpnService.kt): `app/src/main/java/studio/cluvex/aether/vpn/AetherVpnService.kt`
- [Engine process](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/AetherProcess.kt): `app/src/main/java/studio/cluvex/aether/core/AetherProcess.kt`
- [Tunnel configuration](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/TunnelConfig.kt): `app/src/main/java/studio/cluvex/aether/core/TunnelConfig.kt`
- [Routing engine](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/RoutingEngine.kt): `app/src/main/java/studio/cluvex/aether/core/RoutingEngine.kt`
- [Aether native engine](https://github.com/qw-ai-code/aether/blob/main/native/aether/aether/src/lib.rs): `native/aether/aether/src/lib.rs`
- [Transport backends](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/transport/ExternalTransport.kt): `app/src/main/java/studio/cluvex/aether/transport/ExternalTransport.kt`

### LAN sharing

- [Share bridge](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/ShareBridge.kt): `app/src/main/java/studio/cluvex/aether/core/ShareBridge.kt`
- [Share pages](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/SharePages.kt): `app/src/main/java/studio/cluvex/aether/core/SharePages.kt`
- [Share leak guard](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/ShareLeakGuard.kt): `app/src/main/java/studio/cluvex/aether/core/ShareLeakGuard.kt`

### AI assistance

- [AI session](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/ai/AiSession.kt): `app/src/main/java/studio/cluvex/aether/ai/AiSession.kt`
- [Gemini client](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/ai/GeminiClient.kt): `app/src/main/java/studio/cluvex/aether/ai/GeminiClient.kt`

### Identity and access

- [Team and zero-trust](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/core/ZeroTrustSignIn.kt): `app/src/main/java/studio/cluvex/aether/core/ZeroTrustSignIn.kt`
- [Membership settings](https://github.com/qw-ai-code/aether/blob/main/app/src/main/java/studio/cluvex/aether/ui/settings/ZeroTrustMembership.kt): `app/src/main/java/studio/cluvex/aether/ui/settings/ZeroTrustMembership.kt`

### Other components

- **User**
- **LAN client**
- **Gemini API**
- **Android VPN consent**

## Connections

- User → Main activity: opens app (evidence: `app/src/main/java/studio/cluvex/aether/MainActivity.kt`)
- Main activity → Home screen: renders (evidence: `app/src/main/java/studio/cluvex/aether/MainActivity.kt`)
- Main activity → Profile store: loads profile (evidence: `app/src/main/java/studio/cluvex/aether/MainActivity.kt`)
- Main activity → Connection controller: starts connection (evidence: `app/src/main/java/studio/cluvex/aether/MainActivity.kt`)
- Main activity → Android VPN consent: requests consent (evidence: `app/src/main/java/studio/cluvex/aether/MainActivity.kt`)
- Connection controller → VPN service: starts service (evidence: `app/src/main/java/studio/cluvex/aether/core/AetherController.kt`)
- Connection controller → Connection state: publishes state (evidence: `app/src/main/java/studio/cluvex/aether/core/AetherController.kt`)
- VPN service → Engine process: launches engine (evidence: `app/src/main/java/studio/cluvex/aether/vpn/AetherVpnService.kt`)
- VPN service → Connection state: updates state (evidence: `app/src/main/java/studio/cluvex/aether/vpn/AetherVpnService.kt`)
- VPN service → Diagnostics log: records events (evidence: `app/src/main/java/studio/cluvex/aether/vpn/AetherVpnService.kt`)
- Engine process → Aether native engine: loads native engine
- VPN service → Share bridge: starts sharing (evidence: `app/src/main/java/studio/cluvex/aether/vpn/AetherVpnService.kt`)
- Share bridge → Share pages: serves pages
- Share bridge → Share leak guard: protects traffic
- LAN client → Share pages: opens setup
- AI session → Gemini client: requests generation (evidence: `app/src/main/java/studio/cluvex/aether/ai/AiSession.kt`)
- Gemini client → Gemini API: sends request
- Gemini client → Diagnostics log: uses diagnostics (evidence: `app/src/main/java/studio/cluvex/aether/ai/GeminiClient.kt`)
- Membership settings → Team and zero-trust: manages access
