# dchapyshev/aspia architecture

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

- Interactive diagram: https://gitdiagram.com/dchapyshev/aspia
- Repository: https://github.com/dchapyshev/aspia

## Overview

Aspia is a cross-platform remote access product whose main workflow is a user choosing a managed host, establishing a direct or Router/Relay-assisted connection, authenticating, and then using remote capabilities such as desktop control or file transfer. The graph also preserves address-book and backup management, audio/video processing, and host-side capture/input as distinct product areas. The README documents the broader feature set, but most of those implementations are not present in the sampled source; their paths therefore use only supported enclosing directories, and uncertain internal wiring is omitted.

Main entry points: [`source/host`](https://github.com/dchapyshev/aspia/tree/master/source/host) (Host session), [`source/client/desktop`](https://github.com/dchapyshev/aspia/tree/master/source/client/desktop) (Client interface), [`source/client/router_session.cc`](https://github.com/dchapyshev/aspia/blob/master/source/client/router_session.cc) (Client session), [`source/base/peer`](https://github.com/dchapyshev/aspia/tree/master/source/base/peer) (Peer networking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_client_ui["Client interface"]
  node_file_transfer["File transfer"]
  node_task_manager["Task manager"]
  node_chat["Text chat<br/>[chat_window.cc]"]
end

subgraph group_connect["Connection and security"]
  node_session["Client session<br/>[router_session.cc]"]
  node_auth["Client authentication"]
  node_peer_net["Peer networking"]
  node_router_relay["Router and relay"]
end

subgraph group_host["Host capabilities"]
  node_host_session["Host session"]
  node_desktop_capture["Desktop capture"]
  node_input["Remote input<br/>[InputService.java]"]
  node_terminal["Remote terminal"]
  node_system_info["System information"]
  node_host_storage[("Host state<br/>[host_storage.cc]")]
end

subgraph group_media["Media processing"]
  node_audio["Audio handling<br/>[audio_decoder.cc]"]
  node_video["Video codecs<br/>[video_decoder.cc]"]
  node_recording["Video recording"]
end

subgraph group_data["Management data"]
  node_address_book[("Address book<br/>[database.cc]")]
  node_backup["Encrypted backup<br/>[backup.cc]"]
  node_storage_format["Backup format<br/>[storage.proto]"]
end

node_user(("Remote user"))

node_user -->|"uses"| node_client_ui
node_client_ui -->|"starts session"| node_session
node_session -->|"authenticates"| node_auth
node_session -->|"connects"| node_peer_net
node_peer_net -.->|"routes via"| node_router_relay
node_peer_net -->|"connects directly"| node_host_session
node_router_relay -.->|"relays session"| node_host_session
node_host_session -->|"captures screen"| node_desktop_capture
node_host_session -->|"delivers input"| node_input
node_client_ui -->|"opens transfer"| node_file_transfer
node_client_ui -->|"opens manager"| node_task_manager
node_client_ui -->|"opens chat"| node_chat
node_client_ui -->|"reads and updates"| node_address_book
node_client_ui -->|"exports or imports"| node_backup
node_backup -->|"serializes"| node_storage_format
node_host_session -->|"provides"| node_terminal
node_host_session -->|"provides"| node_system_info
node_host_session -->|"records state"| node_host_storage
node_host_session -->|"uses codecs"| node_audio
node_host_session -->|"uses codecs"| node_video
node_video -->|"encodes recording"| node_recording

click node_client_ui "https://github.com/dchapyshev/aspia/tree/master/source/client/desktop"
click node_session "https://github.com/dchapyshev/aspia/blob/master/source/client/router_session.cc"
click node_auth "https://github.com/dchapyshev/aspia/blob/master/source/base/peer/client_authenticator.cc"
click node_peer_net "https://github.com/dchapyshev/aspia/tree/master/source/base/peer"
click node_router_relay "https://github.com/dchapyshev/aspia/tree/master/source/base/peer"
click node_host_session "https://github.com/dchapyshev/aspia/tree/master/source/host"
click node_desktop_capture "https://github.com/dchapyshev/aspia/blob/master/source/host/win/dxgi_duplicator_controller.cc"
click node_input "https://github.com/dchapyshev/aspia/blob/master/source/host/android/packaging/src/org/aspia/host/InputService.java"
click node_file_transfer "https://github.com/dchapyshev/aspia/tree/master/source/client/desktop/file_transfer"
click node_terminal "https://github.com/dchapyshev/aspia/tree/master/source/host"
click node_system_info "https://github.com/dchapyshev/aspia/tree/master/source/host"
click node_task_manager "https://github.com/dchapyshev/aspia/blob/master/source/client/desktop/desktop/task_manager_window.cc"
click node_chat "https://github.com/dchapyshev/aspia/blob/master/source/client/desktop/chat/chat_window.cc"
click node_audio "https://github.com/dchapyshev/aspia/blob/master/source/base/codec/audio_decoder.cc"
click node_video "https://github.com/dchapyshev/aspia/blob/master/source/base/codec/video_decoder.cc"
click node_recording "https://github.com/dchapyshev/aspia/blob/master/source/base/codec/webm_video_encoder.cc"
click node_address_book "https://github.com/dchapyshev/aspia/blob/master/source/client/database.cc"
click node_backup "https://github.com/dchapyshev/aspia/blob/master/source/client/backup.cc"
click node_storage_format "https://github.com/dchapyshev/aspia/blob/master/source/proto/storage.proto"
click node_host_storage "https://github.com/dchapyshev/aspia/blob/master/source/host/host_storage.cc"

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_client_ui,node_file_transfer,node_task_manager,node_chat,node_user toneBlue
class node_session,node_auth,node_peer_net,node_router_relay toneAmber
class node_host_session,node_desktop_capture,node_input,node_terminal,node_system_info,node_host_storage toneMint
class node_audio,node_video,node_recording toneRose
class node_address_book,node_backup,node_storage_format toneIndigo
```

## Components

### Client experience

- [Client interface](https://github.com/dchapyshev/aspia/tree/master/source/client/desktop): `source/client/desktop`
- [File transfer](https://github.com/dchapyshev/aspia/tree/master/source/client/desktop/file_transfer): `source/client/desktop/file_transfer`
- [Task manager](https://github.com/dchapyshev/aspia/blob/master/source/client/desktop/desktop/task_manager_window.cc): `source/client/desktop/desktop/task_manager_window.cc`
- [Text chat](https://github.com/dchapyshev/aspia/blob/master/source/client/desktop/chat/chat_window.cc): `source/client/desktop/chat/chat_window.cc`

### Connection and security

- [Client session](https://github.com/dchapyshev/aspia/blob/master/source/client/router_session.cc): `source/client/router_session.cc`
- [Client authentication](https://github.com/dchapyshev/aspia/blob/master/source/base/peer/client_authenticator.cc): `source/base/peer/client_authenticator.cc`
- [Peer networking](https://github.com/dchapyshev/aspia/tree/master/source/base/peer): `source/base/peer`
- [Router and relay](https://github.com/dchapyshev/aspia/tree/master/source/base/peer): `source/base/peer`

### Host capabilities

- [Host session](https://github.com/dchapyshev/aspia/tree/master/source/host): `source/host`
- [Desktop capture](https://github.com/dchapyshev/aspia/blob/master/source/host/win/dxgi_duplicator_controller.cc): `source/host/win/dxgi_duplicator_controller.cc`
- [Remote input](https://github.com/dchapyshev/aspia/blob/master/source/host/android/packaging/src/org/aspia/host/InputService.java): `source/host/android/packaging/src/org/aspia/host/InputService.java`
- [Remote terminal](https://github.com/dchapyshev/aspia/tree/master/source/host): `source/host`
- [System information](https://github.com/dchapyshev/aspia/tree/master/source/host): `source/host`
- [Host state](https://github.com/dchapyshev/aspia/blob/master/source/host/host_storage.cc): `source/host/host_storage.cc`

### Media processing

- [Audio handling](https://github.com/dchapyshev/aspia/blob/master/source/base/codec/audio_decoder.cc): `source/base/codec/audio_decoder.cc`
- [Video codecs](https://github.com/dchapyshev/aspia/blob/master/source/base/codec/video_decoder.cc): `source/base/codec/video_decoder.cc`
- [Video recording](https://github.com/dchapyshev/aspia/blob/master/source/base/codec/webm_video_encoder.cc): `source/base/codec/webm_video_encoder.cc`

### Management data

- [Address book](https://github.com/dchapyshev/aspia/blob/master/source/client/database.cc): `source/client/database.cc`
- [Encrypted backup](https://github.com/dchapyshev/aspia/blob/master/source/client/backup.cc): `source/client/backup.cc`
- [Backup format](https://github.com/dchapyshev/aspia/blob/master/source/proto/storage.proto): `source/proto/storage.proto`

### Other components

- **Remote user**

## Connections

- Remote user → Client interface: uses
- Client interface → Client session: starts session
- Client session → Client authentication: authenticates
- Client session → Peer networking: connects
- Peer networking → Router and relay: routes via
- Peer networking → Host session: connects directly
- Router and relay → Host session: relays session
- Host session → Desktop capture: captures screen
- Host session → Remote input: delivers input
- Client interface → File transfer: opens transfer
- Client interface → Task manager: opens manager
- Client interface → Text chat: opens chat
- Client interface → Address book: reads and updates
- Client interface → Encrypted backup: exports or imports
- Encrypted backup → Backup format: serializes
- Host session → Remote terminal: provides
- Host session → System information: provides
- Host session → Host state: records state
- Host session → Audio handling: uses codecs
- Host session → Video codecs: uses codecs
- Video codecs → Video recording: encodes recording
