# maksmoroz91/dreamwalker architecture

> Architecture diagram of the GitHub repository maksmoroz91/dreamwalker, 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/maksmoroz91/dreamwalker
- Repository: https://github.com/maksmoroz91/dreamwalker

## Overview

DreamWalker is an MVP Flutter/Android VPN-style client paired with an olcrtc server. The documented flow is user interaction through the client to an Android tunnel and onward to the server, which requires Xray. The tree identifies client, native VPN, and server components, but their source was not sampled; internal call wiring and the server script’s behavior are therefore not asserted.

Main entry points: [`android/app/src/main/kotlin/com/example/vpn_app/AppVpnService.kt`](https://github.com/maksmoroz91/dreamwalker/blob/main/android/app/src/main/kotlin/com/example/vpn_app/AppVpnService.kt) (VPN service), [`lib/vpn/olcrtc_client.dart`](https://github.com/maksmoroz91/dreamwalker/blob/main/lib/vpn/olcrtc_client.dart) (olcrtc client), [`lib/ui/home_screen.dart`](https://github.com/maksmoroz91/dreamwalker/blob/main/lib/ui/home_screen.dart) (Home screen), [`lib/vpn/tunnel_interface.dart`](https://github.com/maksmoroz91/dreamwalker/blob/main/lib/vpn/tunnel_interface.dart) (Tunnel interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flutter["Flutter client"]
  node_home["Home screen<br/>[home_screen.dart]"]
  node_client["olcrtc client<br/>[olcrtc_client.dart]"]
  node_tunnel_interface["Tunnel interface"]
  node_main["Flutter entry<br/>[main.dart]"]
end

subgraph group_android["Android VPN"]
  node_activity["Main activity<br/>[MainActivity.kt]"]
  node_plugin["olcrtc plugin<br/>[OlcrtcPlugin.kt]"]
  node_vpn_service["VPN service<br/>[AppVpnService.kt]"]
  node_service_instance["VPN instance"]
  node_native_runner["Native runner"]
  node_socks_runner["TUN-to-SOCKS<br/>[Tun2SocksRunner.kt]"]
  node_lifecycle["Lifecycle policy"]
  node_recovery["Recovery policy"]
end

subgraph group_server["Server side"]
  node_server_script["Server script<br/>[server.sh]"]
  node_olcrtc_server["olcrtc server"]
  node_names["Name data"]
  node_surnames["Surname data"]
end

node_user(("User"))
node_xray["Xray service"]

node_user -->|"uses"| node_home
node_main -->|"opens"| node_home
node_home -->|"initiates"| node_client
node_client -->|"uses"| node_tunnel_interface
node_tunnel_interface -->|"bridges"| node_plugin
node_plugin -->|"uses"| node_activity
node_activity -->|"starts"| node_vpn_service
node_vpn_service -->|"manages"| node_service_instance
node_vpn_service -->|"runs"| node_native_runner
node_vpn_service -->|"runs"| node_socks_runner
node_vpn_service -->|"applies"| node_lifecycle
node_vpn_service -->|"applies"| node_recovery
node_client -.->|"connects"| node_olcrtc_server
node_olcrtc_server -.->|"requires"| node_xray

click node_home "https://github.com/maksmoroz91/dreamwalker/blob/main/lib/ui/home_screen.dart"
click node_client "https://github.com/maksmoroz91/dreamwalker/blob/main/lib/vpn/olcrtc_client.dart"
click node_tunnel_interface "https://github.com/maksmoroz91/dreamwalker/blob/main/lib/vpn/tunnel_interface.dart"
click node_main "https://github.com/maksmoroz91/dreamwalker/blob/main/lib/main.dart"
click node_activity "https://github.com/maksmoroz91/dreamwalker/blob/main/android/app/src/main/kotlin/com/example/vpn_app/MainActivity.kt"
click node_plugin "https://github.com/maksmoroz91/dreamwalker/blob/main/android/app/src/main/kotlin/com/example/vpn_app/OlcrtcPlugin.kt"
click node_vpn_service "https://github.com/maksmoroz91/dreamwalker/blob/main/android/app/src/main/kotlin/com/example/vpn_app/AppVpnService.kt"
click node_service_instance "https://github.com/maksmoroz91/dreamwalker/blob/main/android/app/src/main/kotlin/com/example/vpn_app/VpnServiceInstance.kt"
click node_native_runner "https://github.com/maksmoroz91/dreamwalker/blob/main/android/app/src/main/kotlin/com/example/vpn_app/OlcrtcNativeRunner.kt"
click node_socks_runner "https://github.com/maksmoroz91/dreamwalker/blob/main/android/app/src/main/kotlin/com/example/vpn_app/Tun2SocksRunner.kt"
click node_lifecycle "https://github.com/maksmoroz91/dreamwalker/blob/main/android/app/src/main/kotlin/com/example/vpn_app/OlcrtcLifecyclePolicy.kt"
click node_recovery "https://github.com/maksmoroz91/dreamwalker/blob/main/android/app/src/main/kotlin/com/example/vpn_app/OlcrtcRecoveryPolicy.kt"
click node_server_script "https://github.com/maksmoroz91/dreamwalker/blob/main/scripts/server.sh"
click node_olcrtc_server "https://github.com/maksmoroz91/dreamwalker/blob/main/worker_olcrtc_server/olcrtc"
click node_names "https://github.com/maksmoroz91/dreamwalker/blob/main/worker_olcrtc_server/names"
click node_surnames "https://github.com/maksmoroz91/dreamwalker/blob/main/worker_olcrtc_server/surnames"

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_home,node_client,node_tunnel_interface,node_main,node_user toneBlue
class node_activity,node_plugin,node_vpn_service,node_service_instance,node_native_runner,node_socks_runner,node_lifecycle,node_recovery toneAmber
class node_server_script,node_olcrtc_server,node_names,node_surnames toneMint
class node_xray toneIndigo
```

## Components

### Flutter client

- [Home screen](https://github.com/maksmoroz91/dreamwalker/blob/main/lib/ui/home_screen.dart): `lib/ui/home_screen.dart`
- [olcrtc client](https://github.com/maksmoroz91/dreamwalker/blob/main/lib/vpn/olcrtc_client.dart): `lib/vpn/olcrtc_client.dart`
- [Tunnel interface](https://github.com/maksmoroz91/dreamwalker/blob/main/lib/vpn/tunnel_interface.dart): `lib/vpn/tunnel_interface.dart`
- [Flutter entry](https://github.com/maksmoroz91/dreamwalker/blob/main/lib/main.dart): `lib/main.dart`

### Android VPN

- [Main activity](https://github.com/maksmoroz91/dreamwalker/blob/main/android/app/src/main/kotlin/com/example/vpn_app/MainActivity.kt): `android/app/src/main/kotlin/com/example/vpn_app/MainActivity.kt`
- [olcrtc plugin](https://github.com/maksmoroz91/dreamwalker/blob/main/android/app/src/main/kotlin/com/example/vpn_app/OlcrtcPlugin.kt): `android/app/src/main/kotlin/com/example/vpn_app/OlcrtcPlugin.kt`
- [VPN service](https://github.com/maksmoroz91/dreamwalker/blob/main/android/app/src/main/kotlin/com/example/vpn_app/AppVpnService.kt): `android/app/src/main/kotlin/com/example/vpn_app/AppVpnService.kt`
- [VPN instance](https://github.com/maksmoroz91/dreamwalker/blob/main/android/app/src/main/kotlin/com/example/vpn_app/VpnServiceInstance.kt): `android/app/src/main/kotlin/com/example/vpn_app/VpnServiceInstance.kt`
- [Native runner](https://github.com/maksmoroz91/dreamwalker/blob/main/android/app/src/main/kotlin/com/example/vpn_app/OlcrtcNativeRunner.kt): `android/app/src/main/kotlin/com/example/vpn_app/OlcrtcNativeRunner.kt`
- [TUN-to-SOCKS](https://github.com/maksmoroz91/dreamwalker/blob/main/android/app/src/main/kotlin/com/example/vpn_app/Tun2SocksRunner.kt): `android/app/src/main/kotlin/com/example/vpn_app/Tun2SocksRunner.kt`
- [Lifecycle policy](https://github.com/maksmoroz91/dreamwalker/blob/main/android/app/src/main/kotlin/com/example/vpn_app/OlcrtcLifecyclePolicy.kt): `android/app/src/main/kotlin/com/example/vpn_app/OlcrtcLifecyclePolicy.kt`
- [Recovery policy](https://github.com/maksmoroz91/dreamwalker/blob/main/android/app/src/main/kotlin/com/example/vpn_app/OlcrtcRecoveryPolicy.kt): `android/app/src/main/kotlin/com/example/vpn_app/OlcrtcRecoveryPolicy.kt`

### Server side

- [Server script](https://github.com/maksmoroz91/dreamwalker/blob/main/scripts/server.sh): `scripts/server.sh`
- [olcrtc server](https://github.com/maksmoroz91/dreamwalker/blob/main/worker_olcrtc_server/olcrtc): `worker_olcrtc_server/olcrtc`
- [Name data](https://github.com/maksmoroz91/dreamwalker/blob/main/worker_olcrtc_server/names): `worker_olcrtc_server/names`
- [Surname data](https://github.com/maksmoroz91/dreamwalker/blob/main/worker_olcrtc_server/surnames): `worker_olcrtc_server/surnames`

### Other components

- **User**
- **Xray service**

## Connections

- User → Home screen: uses
- Flutter entry → Home screen: opens
- Home screen → olcrtc client: initiates
- olcrtc client → Tunnel interface: uses
- Tunnel interface → olcrtc plugin: bridges
- olcrtc plugin → Main activity: uses
- Main activity → VPN service: starts
- VPN service → VPN instance: manages
- VPN service → Native runner: runs
- VPN service → TUN-to-SOCKS: runs
- VPN service → Lifecycle policy: applies
- VPN service → Recovery policy: applies
- olcrtc client → olcrtc server: connects
- olcrtc server → Xray service: requires
