# liriliri/aya architecture

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

- Interactive diagram: https://gitdiagram.com/liriliri/aya
- Repository: https://github.com/liriliri/aya

## Overview

AYA is an Electron desktop GUI for controlling Android devices through ADB. The main workflow is selecting a device, using a feature panel, and issuing requests through the preload bridge to device-facing code; the README’s major capabilities are represented as distinct panels. ADB and sidecar nodes reflect the tree and sampled package-server code, but most IPC handler wiring and feature implementations were not sampled, so those internal links are intentionally limited.

Main entry points: [`src/preload/main.ts`](https://github.com/liriliri/aya/blob/master/src/preload/main.ts) (Preload bridge), [`src/main/lib/adb.ts`](https://github.com/liriliri/aya/blob/master/src/main/lib/adb.ts) (ADB operations), [`src/main/lib/adb/server.ts`](https://github.com/liriliri/aya/blob/master/src/main/lib/adb/server.ts) (AYA client), [`src/renderer/main/App.tsx`](https://github.com/liriliri/aya/blob/master/src/renderer/main/App.tsx) (Main workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_mainui["Main workspace<br/>[App.tsx]"]
  node_deviceui["Device manager<br/>[DeviceManager.tsx]"]
  node_avdui["AVD manager<br/>[AvdManager.tsx]"]
  node_bridge["Preload bridge<br/>[main.ts]"]
  node_ipc["Main process<br/>[index.ts]"]
end

subgraph group_device["Device workflows"]
  node_mirror["Screen mirror<br/>[Screencast.tsx]"]
  node_files["File explorer<br/>[File.tsx]"]
  node_apps["Application manager<br/>[Application.tsx]"]
  node_process["Process monitor<br/>[Process.tsx]"]
  node_layout["Layout inspector<br/>[Layout.tsx]"]
  node_performance["Performance monitor<br/>[Performance.tsx]"]
  node_logcat["Logcat viewer<br/>[Logcat.tsx]"]
  node_shell["Interactive shell<br/>[Shell.tsx]"]
end

subgraph group_adb["ADB runtime"]
  node_adbapi["ADB operations<br/>[adb.ts]"]
  node_adbbase["ADB transport<br/>[base.ts]"]
  node_adbserver["AYA client<br/>[server.ts]"]
  node_adbfeatures["ADB feature modules"]
end

subgraph group_sidecar["Android sidecar"]
  node_aya["AYA device service<br/>[Server.kt]"]
  node_fileserver["Device file server<br/>[HttpFileServer.kt]"]
end

node_user(("Operator"))
node_android(("Android device"))

node_user -->|"selects device"| node_deviceui
node_user -->|"uses features"| node_mainui
node_mainui -->|"invokes APIs"| node_bridge
node_deviceui -->|"invokes APIs"| node_bridge
node_avdui -->|"starts AVD"| node_bridge
node_mirror -->|"controls stream"| node_bridge
node_files -->|"requests files"| node_bridge
node_apps -->|"manages packages"| node_bridge
node_process -->|"requests processes"| node_bridge
node_layout -->|"requests hierarchy"| node_bridge
node_performance -->|"requests metrics"| node_bridge
node_logcat -->|"controls logcat"| node_bridge
node_shell -->|"controls shell"| node_bridge
node_bridge -->|"dispatches IPC"| node_ipc
node_ipc -->|"routes requests"| node_adbapi
node_adbapi -->|"uses transport"| node_adbbase
node_adbapi -->|"uses operations"| node_adbfeatures
node_adbserver -->|"opens device socket"| node_android
node_adbserver -->|"sends requests"| node_aya
node_aya -->|"starts service"| node_fileserver
node_adbbase -->|"runs ADB commands"| node_android

click node_mainui "https://github.com/liriliri/aya/blob/master/src/renderer/main/App.tsx"
click node_deviceui "https://github.com/liriliri/aya/blob/master/src/renderer/devices/components/DeviceManager.tsx"
click node_avdui "https://github.com/liriliri/aya/blob/master/src/renderer/avd/components/AvdManager.tsx"
click node_bridge "https://github.com/liriliri/aya/blob/master/src/preload/main.ts"
click node_ipc "https://github.com/liriliri/aya/blob/master/src/main/index.ts"
click node_mirror "https://github.com/liriliri/aya/blob/master/src/renderer/screencast/components/Screencast.tsx"
click node_files "https://github.com/liriliri/aya/blob/master/src/renderer/main/components/file/File.tsx"
click node_apps "https://github.com/liriliri/aya/blob/master/src/renderer/main/components/application/Application.tsx"
click node_process "https://github.com/liriliri/aya/blob/master/src/renderer/main/components/process/Process.tsx"
click node_layout "https://github.com/liriliri/aya/blob/master/src/renderer/main/components/layout/Layout.tsx"
click node_performance "https://github.com/liriliri/aya/blob/master/src/renderer/main/components/performance/Performance.tsx"
click node_logcat "https://github.com/liriliri/aya/blob/master/src/renderer/main/components/logcat/Logcat.tsx"
click node_shell "https://github.com/liriliri/aya/blob/master/src/renderer/main/components/shell/Shell.tsx"
click node_adbapi "https://github.com/liriliri/aya/blob/master/src/main/lib/adb.ts"
click node_adbbase "https://github.com/liriliri/aya/blob/master/src/main/lib/adb/base.ts"
click node_adbserver "https://github.com/liriliri/aya/blob/master/src/main/lib/adb/server.ts"
click node_adbfeatures "https://github.com/liriliri/aya/tree/master/src/main/lib/adb"
click node_aya "https://github.com/liriliri/aya/blob/master/server/server/src/main/java/io/liriliri/aya/Server.kt"
click node_fileserver "https://github.com/liriliri/aya/blob/master/server/server/src/main/java/io/liriliri/aya/HttpFileServer.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_mainui,node_deviceui,node_avdui,node_bridge,node_ipc toneBlue
class node_mirror,node_files,node_apps,node_process,node_layout,node_performance,node_logcat,node_shell toneAmber
class node_adbapi,node_adbbase,node_adbserver,node_adbfeatures toneMint
class node_aya,node_fileserver toneRose
class node_user,node_android toneIndigo
```

## Components

### Desktop interface

- [Main workspace](https://github.com/liriliri/aya/blob/master/src/renderer/main/App.tsx): `src/renderer/main/App.tsx`
- [Device manager](https://github.com/liriliri/aya/blob/master/src/renderer/devices/components/DeviceManager.tsx): `src/renderer/devices/components/DeviceManager.tsx`
- [AVD manager](https://github.com/liriliri/aya/blob/master/src/renderer/avd/components/AvdManager.tsx): `src/renderer/avd/components/AvdManager.tsx`
- [Preload bridge](https://github.com/liriliri/aya/blob/master/src/preload/main.ts): `src/preload/main.ts`
- [Main process](https://github.com/liriliri/aya/blob/master/src/main/index.ts): `src/main/index.ts`

### Device workflows

- [Screen mirror](https://github.com/liriliri/aya/blob/master/src/renderer/screencast/components/Screencast.tsx): `src/renderer/screencast/components/Screencast.tsx`
- [File explorer](https://github.com/liriliri/aya/blob/master/src/renderer/main/components/file/File.tsx): `src/renderer/main/components/file/File.tsx`
- [Application manager](https://github.com/liriliri/aya/blob/master/src/renderer/main/components/application/Application.tsx): `src/renderer/main/components/application/Application.tsx`
- [Process monitor](https://github.com/liriliri/aya/blob/master/src/renderer/main/components/process/Process.tsx): `src/renderer/main/components/process/Process.tsx`
- [Layout inspector](https://github.com/liriliri/aya/blob/master/src/renderer/main/components/layout/Layout.tsx): `src/renderer/main/components/layout/Layout.tsx`
- [Performance monitor](https://github.com/liriliri/aya/blob/master/src/renderer/main/components/performance/Performance.tsx): `src/renderer/main/components/performance/Performance.tsx`
- [Logcat viewer](https://github.com/liriliri/aya/blob/master/src/renderer/main/components/logcat/Logcat.tsx): `src/renderer/main/components/logcat/Logcat.tsx`
- [Interactive shell](https://github.com/liriliri/aya/blob/master/src/renderer/main/components/shell/Shell.tsx): `src/renderer/main/components/shell/Shell.tsx`

### ADB runtime

- [ADB operations](https://github.com/liriliri/aya/blob/master/src/main/lib/adb.ts): `src/main/lib/adb.ts`
- [ADB transport](https://github.com/liriliri/aya/blob/master/src/main/lib/adb/base.ts): `src/main/lib/adb/base.ts`
- [AYA client](https://github.com/liriliri/aya/blob/master/src/main/lib/adb/server.ts): `src/main/lib/adb/server.ts`
- [ADB feature modules](https://github.com/liriliri/aya/tree/master/src/main/lib/adb): `src/main/lib/adb`

### Android sidecar

- [AYA device service](https://github.com/liriliri/aya/blob/master/server/server/src/main/java/io/liriliri/aya/Server.kt): `server/server/src/main/java/io/liriliri/aya/Server.kt`
- [Device file server](https://github.com/liriliri/aya/blob/master/server/server/src/main/java/io/liriliri/aya/HttpFileServer.kt): `server/server/src/main/java/io/liriliri/aya/HttpFileServer.kt`

### Other components

- **Operator**
- **Android device**

## Connections

- Operator → Device manager: selects device
- Operator → Main workspace: uses features
- Main workspace → Preload bridge: invokes APIs
- Device manager → Preload bridge: invokes APIs
- AVD manager → Preload bridge: starts AVD
- Screen mirror → Preload bridge: controls stream
- File explorer → Preload bridge: requests files
- Application manager → Preload bridge: manages packages
- Process monitor → Preload bridge: requests processes
- Layout inspector → Preload bridge: requests hierarchy
- Performance monitor → Preload bridge: requests metrics
- Logcat viewer → Preload bridge: controls logcat
- Interactive shell → Preload bridge: controls shell
- Preload bridge → Main process: dispatches IPC
- Main process → ADB operations: routes requests
- ADB operations → ADB transport: uses transport
- ADB operations → ADB feature modules: uses operations
- AYA client → Android device: opens device socket
- AYA client → AYA device service: sends requests
- AYA device service → Device file server: starts service
- ADB transport → Android device: runs ADB commands
