# 31-gallium/yeval architecture

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

- Interactive diagram: https://gitdiagram.com/31-gallium/yeval
- Repository: https://github.com/31-gallium/yeval

## Overview

Yeval is a phone-to-PC virtual Xbox controller: users discover a Windows host, choose a profile and connection, operate an on-screen controller, and the PC maps received input to virtual Xbox gamepads. The graph also preserves profile/layout editing, settings and updates, the desktop dashboard’s editor and slot-management capabilities, and the documented transport and rumble loop. Source excerpts establish Android composition and parts of the Windows engine; several dashboard and runtime details are represented only where the README documents them.

Main entry points: [`android/app/src/main/java/com/mobilecontroller/MainActivity.kt`](https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/MainActivity.kt) (App coordinator), [`windows/core/main.cpp`](https://github.com/31-gallium/yeval/blob/main/windows/core/main.cpp) (Backend engine), [`dashboard/main.js`](https://github.com/31-gallium/yeval/blob/main/dashboard/main.js) (Dashboard shell), [`dashboard/renderer.js`](https://github.com/31-gallium/yeval/blob/main/dashboard/renderer.js) (Dashboard renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_android["Android client"]
  node_activity["App coordinator<br/>[MainActivity.kt]"]
  node_home["Discovery home<br/>[HomeView.kt]"]
  node_controller["Touch controller<br/>[ControllerView.kt]"]
  node_udpclient["UDP sender<br/>[UdpSender.kt]"]
  node_adbclient["TCP sender<br/>[AdbTcpSender.kt]"]
  node_profilesview["Profile browser<br/>[ProfilesView.kt]"]
  node_editor["Layout editor"]
  node_profilemanager["Profile model<br/>[ProfileManager.kt]"]
  node_profilestore[("Profile storage<br/>[ProfileStorage.kt]")]
  node_settings["Settings<br/>[SettingsView.kt]"]
  node_haptics["Haptics and rumble"]
  node_updater["App updater<br/>[UpdateManager.kt]"]
end

subgraph group_dashboard["Desktop dashboard"]
  node_dashboardmain["Dashboard shell<br/>[main.js]"]
  node_dashboardrenderer["Dashboard renderer<br/>[renderer.js]"]
  node_slotmanager["Slot manager<br/>[slot_manager.js]"]
  node_layouteditor["Layout editor<br/>[editor.js]"]
  node_zoneeditor["Zone editor<br/>[zone_editor.js]"]
end

subgraph group_engine["Windows engine"]
  node_enginecore["Backend engine<br/>[main.cpp]"]
  node_udpserver["UDP transport<br/>[UdpTransport.h]"]
  node_tcpserver["ADB TCP transport<br/>[AdbTcpTransport.h]"]
  node_transportapi["Transport interface<br/>[ITransport.h]"]
  node_gamepad["ViGEm backend<br/>[NefariusBackend.h]"]
  node_gamepadapi["Gamepad interface"]
end

subgraph group_protocol["Protocol and profiles"]
  node_wireformat["Controller packet"]
  node_profilefiles[("Shared profiles")]
end

node_player(("Phone player"))
node_pcuser(("PC user"))
node_windows["Windows games and OS"]
node_vigem["ViGEmBus driver"]
node_adbservice["ADB tunnel"]
node_releaseapi["Release service"]

node_player -->|"uses"| node_activity
node_activity -->|"shows"| node_home
node_activity -->|"shows"| node_controller
node_activity -->|"shows"| node_profilesview
node_activity -->|"shows"| node_settings
node_activity -->|"shows"| node_editor
node_home -->|"checks updates"| node_updater
node_profilesview -->|"loads profiles"| node_profilestore
node_editor -->|"edits layout"| node_profilemanager
node_editor -->|"saves layout"| node_profilestore
node_profilemanager -.->|"syncs profiles"| node_profilefiles
node_activity -->|"sends input"| node_udpclient
node_activity -->|"sends input"| node_adbclient
node_controller -.->|"reports touches"| node_activity
node_settings -->|"configures"| node_haptics
node_activity -->|"plays rumble"| node_haptics
node_updater -->|"checks and downloads"| node_releaseapi
node_dashboardmain -.->|"hosts UI"| node_dashboardrenderer
node_pcuser -->|"configures"| node_dashboardrenderer
node_dashboardrenderer -.->|"opens editor"| node_layouteditor
node_dashboardrenderer -.->|"opens editor"| node_zoneeditor
node_dashboardrenderer -.->|"reorders slots"| node_slotmanager
node_dashboardmain -->|"routes IPC"| node_enginecore
node_dashboardmain -->|"discovers phones"| node_activity
node_dashboardmain -->|"serves layouts"| node_profilefiles
node_udpclient -->|"streams packets"| node_udpserver
node_adbclient -->|"streams packets"| node_tcpserver
node_adbservice -->|"forwards TCP"| node_tcpserver
node_udpserver -->|"decodes packets"| node_wireformat
node_tcpserver -->|"decodes packets"| node_wireformat
node_udpserver -->|"implements"| node_transportapi
node_tcpserver -->|"implements"| node_transportapi
node_enginecore -->|"starts transport"| node_udpserver
node_enginecore -->|"starts transport"| node_tcpserver
node_enginecore -->|"updates controllers"| node_gamepad
node_gamepad -->|"implements"| node_gamepadapi
node_gamepad -->|"creates virtual pads"| node_vigem
node_vigem -->|"exposes Xbox pads"| node_windows
node_enginecore -->|"exchanges IPC"| node_dashboardmain
node_enginecore -->|"returns rumble"| node_adbclient
node_enginecore -->|"sends rumble"| node_activity
node_dashboardmain -->|"broadcasts reload"| node_activity

click node_activity "https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/MainActivity.kt"
click node_home "https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/HomeView.kt"
click node_controller "https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/ControllerView.kt"
click node_udpclient "https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/UdpSender.kt"
click node_adbclient "https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/AdbTcpSender.kt"
click node_profilesview "https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/ProfilesView.kt"
click node_editor "https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/EditorOverlayView.kt"
click node_profilemanager "https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/ProfileManager.kt"
click node_profilestore "https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/ProfileStorage.kt"
click node_settings "https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/SettingsView.kt"
click node_haptics "https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/VibrationManager.kt"
click node_updater "https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/UpdateManager.kt"
click node_dashboardmain "https://github.com/31-gallium/yeval/blob/main/dashboard/main.js"
click node_dashboardrenderer "https://github.com/31-gallium/yeval/blob/main/dashboard/renderer.js"
click node_slotmanager "https://github.com/31-gallium/yeval/blob/main/dashboard/slot_manager.js"
click node_layouteditor "https://github.com/31-gallium/yeval/blob/main/dashboard/editor.js"
click node_zoneeditor "https://github.com/31-gallium/yeval/blob/main/dashboard/zone_editor.js"
click node_enginecore "https://github.com/31-gallium/yeval/blob/main/windows/core/main.cpp"
click node_udpserver "https://github.com/31-gallium/yeval/blob/main/windows/networking/UdpTransport.h"
click node_tcpserver "https://github.com/31-gallium/yeval/blob/main/windows/networking/AdbTcpTransport.h"
click node_transportapi "https://github.com/31-gallium/yeval/blob/main/windows/networking/ITransport.h"
click node_gamepad "https://github.com/31-gallium/yeval/blob/main/windows/virtual-gamepad/NefariusBackend.h"
click node_gamepadapi "https://github.com/31-gallium/yeval/blob/main/windows/virtual-gamepad/IVirtualGamepadBackend.h"
click node_wireformat "https://github.com/31-gallium/yeval/blob/main/shared/protocol/controller_protocol.h"
click node_profilefiles "https://github.com/31-gallium/yeval/tree/main/shared/profiles"

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_activity,node_home,node_controller,node_udpclient,node_adbclient,node_profilesview,node_editor,node_profilemanager,node_profilestore,node_settings,node_haptics,node_updater,node_pcuser toneBlue
class node_dashboardmain,node_dashboardrenderer,node_slotmanager,node_layouteditor,node_zoneeditor toneAmber
class node_enginecore,node_udpserver,node_tcpserver,node_transportapi,node_gamepad,node_gamepadapi toneMint
class node_wireformat,node_profilefiles toneRose
class node_player,node_windows,node_vigem,node_adbservice,node_releaseapi toneIndigo
```

## Components

### Android client

- [App coordinator](https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/MainActivity.kt): `android/app/src/main/java/com/mobilecontroller/MainActivity.kt`
- [Discovery home](https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/HomeView.kt): `android/app/src/main/java/com/mobilecontroller/HomeView.kt`
- [Touch controller](https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/ControllerView.kt): `android/app/src/main/java/com/mobilecontroller/ControllerView.kt`
- [UDP sender](https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/UdpSender.kt): `android/app/src/main/java/com/mobilecontroller/UdpSender.kt`
- [TCP sender](https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/AdbTcpSender.kt): `android/app/src/main/java/com/mobilecontroller/AdbTcpSender.kt`
- [Profile browser](https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/ProfilesView.kt): `android/app/src/main/java/com/mobilecontroller/ProfilesView.kt`
- [Layout editor](https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/EditorOverlayView.kt): `android/app/src/main/java/com/mobilecontroller/EditorOverlayView.kt`
- [Profile model](https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/ProfileManager.kt): `android/app/src/main/java/com/mobilecontroller/ProfileManager.kt`
- [Profile storage](https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/ProfileStorage.kt): `android/app/src/main/java/com/mobilecontroller/ProfileStorage.kt`
- [Settings](https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/SettingsView.kt): `android/app/src/main/java/com/mobilecontroller/SettingsView.kt`
- [Haptics and rumble](https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/VibrationManager.kt): `android/app/src/main/java/com/mobilecontroller/VibrationManager.kt`
- [App updater](https://github.com/31-gallium/yeval/blob/main/android/app/src/main/java/com/mobilecontroller/UpdateManager.kt): `android/app/src/main/java/com/mobilecontroller/UpdateManager.kt`

### Desktop dashboard

- [Dashboard shell](https://github.com/31-gallium/yeval/blob/main/dashboard/main.js): `dashboard/main.js`
- [Dashboard renderer](https://github.com/31-gallium/yeval/blob/main/dashboard/renderer.js): `dashboard/renderer.js`
- [Slot manager](https://github.com/31-gallium/yeval/blob/main/dashboard/slot_manager.js): `dashboard/slot_manager.js`
- [Layout editor](https://github.com/31-gallium/yeval/blob/main/dashboard/editor.js): `dashboard/editor.js`
- [Zone editor](https://github.com/31-gallium/yeval/blob/main/dashboard/zone_editor.js): `dashboard/zone_editor.js`

### Windows engine

- [Backend engine](https://github.com/31-gallium/yeval/blob/main/windows/core/main.cpp): `windows/core/main.cpp`
- [UDP transport](https://github.com/31-gallium/yeval/blob/main/windows/networking/UdpTransport.h): `windows/networking/UdpTransport.h`
- [ADB TCP transport](https://github.com/31-gallium/yeval/blob/main/windows/networking/AdbTcpTransport.h): `windows/networking/AdbTcpTransport.h`
- [Transport interface](https://github.com/31-gallium/yeval/blob/main/windows/networking/ITransport.h): `windows/networking/ITransport.h`
- [ViGEm backend](https://github.com/31-gallium/yeval/blob/main/windows/virtual-gamepad/NefariusBackend.h): `windows/virtual-gamepad/NefariusBackend.h`
- [Gamepad interface](https://github.com/31-gallium/yeval/blob/main/windows/virtual-gamepad/IVirtualGamepadBackend.h): `windows/virtual-gamepad/IVirtualGamepadBackend.h`

### Protocol and profiles

- [Controller packet](https://github.com/31-gallium/yeval/blob/main/shared/protocol/controller_protocol.h): `shared/protocol/controller_protocol.h`
- [Shared profiles](https://github.com/31-gallium/yeval/tree/main/shared/profiles): `shared/profiles`

### Other components

- **Phone player**
- **PC user**
- **Windows games and OS**
- **ViGEmBus driver**
- **ADB tunnel**
- **Release service**

## Connections

- Phone player → App coordinator: uses (evidence: `README.md`)
- App coordinator → Discovery home: shows (evidence: `android/app/src/main/java/com/mobilecontroller/MainActivity.kt`)
- App coordinator → Touch controller: shows (evidence: `android/app/src/main/java/com/mobilecontroller/MainActivity.kt`)
- App coordinator → Profile browser: shows (evidence: `android/app/src/main/java/com/mobilecontroller/MainActivity.kt`)
- App coordinator → Settings: shows (evidence: `android/app/src/main/java/com/mobilecontroller/MainActivity.kt`)
- App coordinator → Layout editor: shows (evidence: `android/app/src/main/java/com/mobilecontroller/MainActivity.kt`)
- Discovery home → App updater: checks updates (evidence: `android/app/src/main/java/com/mobilecontroller/HomeView.kt`)
- Profile browser → Profile storage: loads profiles (evidence: `android/app/src/main/java/com/mobilecontroller/ProfilesView.kt`)
- Layout editor → Profile model: edits layout (evidence: `android/app/src/main/java/com/mobilecontroller/EditorOverlayView.kt`)
- Layout editor → Profile storage: saves layout (evidence: `android/app/src/main/java/com/mobilecontroller/EditorOverlayView.kt`)
- Profile model → Shared profiles: syncs profiles (evidence: `README.md`)
- App coordinator → UDP sender: sends input (evidence: `android/app/src/main/java/com/mobilecontroller/MainActivity.kt`)
- App coordinator → TCP sender: sends input (evidence: `android/app/src/main/java/com/mobilecontroller/MainActivity.kt`)
- Touch controller → App coordinator: reports touches (evidence: `android/app/src/main/java/com/mobilecontroller/MainActivity.kt`)
- Settings → Haptics and rumble: configures (evidence: `android/app/src/main/java/com/mobilecontroller/SettingsView.kt`)
- App coordinator → Haptics and rumble: plays rumble (evidence: `android/app/src/main/java/com/mobilecontroller/MainActivity.kt`)
- App updater → Release service: checks and downloads (evidence: `android/app/src/main/java/com/mobilecontroller/UpdateManager.kt`)
- Dashboard shell → Dashboard renderer: hosts UI
- PC user → Dashboard renderer: configures (evidence: `README.md`)
- Dashboard renderer → Layout editor: opens editor
- Dashboard renderer → Zone editor: opens editor
- Dashboard renderer → Slot manager: reorders slots
- Dashboard shell → Backend engine: routes IPC (evidence: `README.md`)
- Dashboard shell → App coordinator: discovers phones (evidence: `README.md`)
- Dashboard shell → Shared profiles: serves layouts (evidence: `README.md`)
- UDP sender → UDP transport: streams packets (evidence: `README.md`)
- TCP sender → ADB TCP transport: streams packets (evidence: `README.md`)
- ADB tunnel → ADB TCP transport: forwards TCP (evidence: `README.md`)
- UDP transport → Controller packet: decodes packets (evidence: `windows/networking/UdpTransport.h`)
- ADB TCP transport → Controller packet: decodes packets (evidence: `windows/networking/AdbTcpTransport.h`)
- UDP transport → Transport interface: implements (evidence: `windows/networking/UdpTransport.h`)
- ADB TCP transport → Transport interface: implements (evidence: `windows/networking/AdbTcpTransport.h`)
- Backend engine → UDP transport: starts transport (evidence: `windows/core/main.cpp`)
- Backend engine → ADB TCP transport: starts transport (evidence: `windows/core/main.cpp`)
- Backend engine → ViGEm backend: updates controllers (evidence: `windows/core/main.cpp`)
- ViGEm backend → Gamepad interface: implements (evidence: `windows/virtual-gamepad/NefariusBackend.h`)
- ViGEm backend → ViGEmBus driver: creates virtual pads (evidence: `README.md`)
- ViGEmBus driver → Windows games and OS: exposes Xbox pads (evidence: `README.md`)
- Backend engine → Dashboard shell: exchanges IPC (evidence: `README.md`)
- Backend engine → TCP sender: returns rumble (evidence: `README.md`)
- Backend engine → App coordinator: sends rumble (evidence: `README.md`)
- Dashboard shell → App coordinator: broadcasts reload (evidence: `README.md`)
