# pmh1314520/mctier architecture

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

- Interactive diagram: https://gitdiagram.com/pmh1314520/mctier
- Repository: https://github.com/pmh1314520/mctier

## Overview

MCTier is a cross-platform virtual-LAN client for Windows and Android, with desktop sources in `MCTier-MacOS` and Android sources in `MCTier-Android`. Users create or join a lobby, establish an EasyTier network, then collaborate through features such as chat, voice, file sharing, screen sharing, and remote control. The graph emphasizes the documented workflow and major capabilities; some subsystem links are supported only by README descriptions or import references, since most implementation files were not excerpted.

Main entry points: [`MCTier-MacOS/src/services/webrtc/WebRTCClient.ts`](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/webrtc/WebRTCClient.ts) (WebRTC client), [`MCTier-MacOS/src/App.tsx`](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/App.tsx) (Desktop app), [`MCTier-MacOS/src-tauri/src/modules/lobby_manager.rs`](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src-tauri/src/modules/lobby_manager.rs) (Lobby manager), [`MCTier-MacOS/src/services/screenShare/ScreenShareService.ts`](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/screenShare/ScreenShareService.ts) (Screen sharing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Client entry"]
  node_desktop["Desktop app<br/>[App.tsx]"]
  node_android["Android app<br/>[MainActivity.kt]"]
end

subgraph group_lobby["Lobby and networking"]
  node_session["Lobby session"]
  node_lobbybackend["Lobby manager<br/>[lobby_manager.rs]"]
  node_network["Virtual network<br/>[network_service.rs]"]
  node_config["Network config<br/>[config_manager.rs]"]
  node_hosts["Virtual DNS<br/>[hosts_manager.rs]"]
end

subgraph group_collaboration["Communication and sharing"]
  node_webrtc["WebRTC client<br/>[WebRTCClient.ts]"]
  node_chat["P2P chat<br/>[P2PChatService.ts]"]
  node_filesui["File sharing UI"]
  node_files["File transfer"]
  node_screenui["Screen sharing UI"]
  node_screen["Screen sharing"]
  node_remote["Remote control"]
  node_audio["Audio service<br/>[AudioService.ts]"]
  node_noise["Voice processing<br/>[nvidiaNoise.ts]"]
end

subgraph group_platform["Platform services"]
  node_capture["Native capture<br/>[nativeCapture.ts]"]
  node_recording["Screen recording"]
  node_quark["Quark support<br/>[quark_support.rs]"]
  node_androidvpn["Android VPN"]
end

subgraph group_security["Trust and state"]
  node_store[("App state<br/>[appStore.ts]")]
  node_trust["Trust boundary<br/>[trustBoundary.ts]"]
end

node_user(("User"))

node_user -->|"creates or joins"| node_desktop
node_user -->|"creates or joins"| node_android
node_desktop -->|"coordinates sessions"| node_session
node_desktop -.->|"enters lobby"| node_lobbybackend
node_session -.->|"manages lobby"| node_lobbybackend
node_lobbybackend -->|"uses network service"| node_network
node_lobbybackend -->|"uses configuration"| node_config
node_lobbybackend -->|"updates mappings"| node_hosts
node_desktop -.->|"uses app state"| node_store
node_webrtc -->|"uses chat service"| node_chat
node_webrtc -->|"uses file services"| node_files
node_webrtc -.->|"coordinates sharing"| node_screen
node_filesui -.->|"manages transfers"| node_files
node_screenui -->|"controls sharing"| node_screen
node_screen -->|"uses capture"| node_capture
node_remote -->|"uses capture"| node_capture
node_webrtc -->|"uses remote control"| node_remote
node_webrtc -.->|"uses audio service"| node_audio
node_noise -->|"uses audio devices"| node_audio
node_desktop -.->|"validates inputs"| node_trust
node_android -.->|"starts VPN service"| node_androidvpn
node_user -.->|"records screen"| node_recording
node_user -.->|"uses support features"| node_quark

click node_desktop "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/App.tsx"
click node_android "https://github.com/pmh1314520/mctier/blob/master/MCTier-Android/app/src/main/java/top/pmh13/mctier/MainActivity.kt"
click node_session "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/lobby/LobbySessionCoordinator.ts"
click node_lobbybackend "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src-tauri/src/modules/lobby_manager.rs"
click node_network "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src-tauri/src/modules/network_service.rs"
click node_config "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src-tauri/src/modules/config_manager.rs"
click node_hosts "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src-tauri/src/modules/hosts_manager.rs"
click node_store "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/stores/appStore.ts"
click node_trust "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/security/trustBoundary.ts"
click node_webrtc "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/webrtc/WebRTCClient.ts"
click node_chat "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/chat/P2PChatService.ts"
click node_filesui "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/components/FileShareManager/FileShareManagerNew.tsx"
click node_files "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/fileShare/FileShareService.ts"
click node_screenui "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/components/ScreenShareManager/ScreenShareManager.tsx"
click node_screen "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/screenShare/ScreenShareService.ts"
click node_capture "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/screenShare/nativeCapture.ts"
click node_remote "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/remoteControl/RemoteControlService.ts"
click node_audio "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/audio/AudioService.ts"
click node_noise "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/voice/nvidiaNoise.ts"
click node_recording "https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src-tauri/src/modules/screen_recording.rs"
click node_quark "https://github.com/pmh1314520/mctier/blob/master/src-tauri/src/modules/quark_support.rs"
click node_androidvpn "https://github.com/pmh1314520/mctier/blob/master/MCTier-Android/app/src/main/java/com/easytier/jni/EasyTierVpnService.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_desktop,node_android,node_user toneBlue
class node_session,node_lobbybackend,node_network,node_config,node_hosts toneAmber
class node_webrtc,node_chat,node_filesui,node_files,node_screenui,node_screen,node_remote,node_audio,node_noise toneMint
class node_capture,node_recording,node_quark,node_androidvpn toneRose
class node_store,node_trust toneIndigo
```

## Components

### Client entry

- [Desktop app](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/App.tsx): `MCTier-MacOS/src/App.tsx`
- [Android app](https://github.com/pmh1314520/mctier/blob/master/MCTier-Android/app/src/main/java/top/pmh13/mctier/MainActivity.kt): `MCTier-Android/app/src/main/java/top/pmh13/mctier/MainActivity.kt`

### Lobby and networking

- [Lobby session](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/lobby/LobbySessionCoordinator.ts): `MCTier-MacOS/src/services/lobby/LobbySessionCoordinator.ts`
- [Lobby manager](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src-tauri/src/modules/lobby_manager.rs): `MCTier-MacOS/src-tauri/src/modules/lobby_manager.rs`
- [Virtual network](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src-tauri/src/modules/network_service.rs): `MCTier-MacOS/src-tauri/src/modules/network_service.rs`
- [Network config](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src-tauri/src/modules/config_manager.rs): `MCTier-MacOS/src-tauri/src/modules/config_manager.rs`
- [Virtual DNS](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src-tauri/src/modules/hosts_manager.rs): `MCTier-MacOS/src-tauri/src/modules/hosts_manager.rs`

### Communication and sharing

- [WebRTC client](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/webrtc/WebRTCClient.ts): `MCTier-MacOS/src/services/webrtc/WebRTCClient.ts`
- [P2P chat](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/chat/P2PChatService.ts): `MCTier-MacOS/src/services/chat/P2PChatService.ts`
- [File sharing UI](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/components/FileShareManager/FileShareManagerNew.tsx): `MCTier-MacOS/src/components/FileShareManager/FileShareManagerNew.tsx`
- [File transfer](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/fileShare/FileShareService.ts): `MCTier-MacOS/src/services/fileShare/FileShareService.ts`
- [Screen sharing UI](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/components/ScreenShareManager/ScreenShareManager.tsx): `MCTier-MacOS/src/components/ScreenShareManager/ScreenShareManager.tsx`
- [Screen sharing](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/screenShare/ScreenShareService.ts): `MCTier-MacOS/src/services/screenShare/ScreenShareService.ts`
- [Remote control](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/remoteControl/RemoteControlService.ts): `MCTier-MacOS/src/services/remoteControl/RemoteControlService.ts`
- [Audio service](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/audio/AudioService.ts): `MCTier-MacOS/src/services/audio/AudioService.ts`
- [Voice processing](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/voice/nvidiaNoise.ts): `MCTier-MacOS/src/services/voice/nvidiaNoise.ts`

### Platform services

- [Native capture](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/services/screenShare/nativeCapture.ts): `MCTier-MacOS/src/services/screenShare/nativeCapture.ts`
- [Screen recording](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src-tauri/src/modules/screen_recording.rs): `MCTier-MacOS/src-tauri/src/modules/screen_recording.rs`
- [Quark support](https://github.com/pmh1314520/mctier/blob/master/src-tauri/src/modules/quark_support.rs): `src-tauri/src/modules/quark_support.rs`
- [Android VPN](https://github.com/pmh1314520/mctier/blob/master/MCTier-Android/app/src/main/java/com/easytier/jni/EasyTierVpnService.kt): `MCTier-Android/app/src/main/java/com/easytier/jni/EasyTierVpnService.kt`

### Trust and state

- [App state](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/stores/appStore.ts): `MCTier-MacOS/src/stores/appStore.ts`
- [Trust boundary](https://github.com/pmh1314520/mctier/blob/master/MCTier-MacOS/src/security/trustBoundary.ts): `MCTier-MacOS/src/security/trustBoundary.ts`

### Other components

- **User**

## Connections

- User → Desktop app: creates or joins (evidence: `README.md`)
- User → Android app: creates or joins (evidence: `README.md`)
- Desktop app → Lobby session: coordinates sessions
- Desktop app → Lobby manager: enters lobby (evidence: `README.md`)
- Lobby session → Lobby manager: manages lobby (evidence: `README.md`)
- Lobby manager → Virtual network: uses network service (evidence: `MCTier-MacOS/src-tauri/src/modules/lobby_manager.rs`)
- Lobby manager → Network config: uses configuration (evidence: `MCTier-MacOS/src-tauri/src/modules/lobby_manager.rs`)
- Lobby manager → Virtual DNS: updates mappings (evidence: `MCTier-MacOS/src-tauri/src/modules/lobby_manager.rs`)
- Desktop app → App state: uses app state
- WebRTC client → P2P chat: uses chat service
- WebRTC client → File transfer: uses file services
- WebRTC client → Screen sharing: coordinates sharing (evidence: `README.md`)
- File sharing UI → File transfer: manages transfers (evidence: `README.md`)
- Screen sharing UI → Screen sharing: controls sharing (evidence: `MCTier-MacOS/src/components/ScreenShareManager/ScreenShareManager.tsx`)
- Screen sharing → Native capture: uses capture
- Remote control → Native capture: uses capture
- WebRTC client → Remote control: uses remote control
- WebRTC client → Audio service: uses audio service (evidence: `README.md`)
- Voice processing → Audio service: uses audio devices
- Desktop app → Trust boundary: validates inputs (evidence: `README.md`)
- Android app → Android VPN: starts VPN service (evidence: `README.md`)
- User → Screen recording: records screen (evidence: `README.md`)
- User → Quark support: uses support features (evidence: `README.md`)
