# veyon/veyon architecture

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

- Interactive diagram: https://gitdiagram.com/veyon/veyon
- Repository: https://github.com/veyon/veyon

## Overview

Based on your project’s file tree and the details in the README, Veyon is a full‐feature, full‐stack remote monitoring and control system for networked computers in educational or support environments. Its purpose is to allow teachers or administrators to monitor multiple computers, view and control desktops remotely, and perform actions like screen locking, application launching, messaging, and more. Its structure is divided among several main building blocks that include reusable libraries, modular plugins, and different executables (master, worker, server, configurator, CLI) that together offer the overall system functionality.

##### Key Components
- Core Libraries (core/) – This is the foundation which includes the essential functions for authentication, configuration management, VNC connectivity, system tray, and inter-component communication.
- Frontend/User Interfaces:
– Veyon Master (master/) – The primary application for monitoring and controlling computers (graphical interface using QML/Qt).
– Veyon Configurator (configurator/) – A standalone tool for administrative configuration of machines and policies.
– CLI tool (cli/) – An alternative command-line interface for managing or scripting actions.
- Backend/Agents:
– Veyon Worker (worker/) – The agent running on target computers to receive commands, stream desktops, and execute control operations.
– Veyon Server (server/) – Manages client connections, communications (including proxy functionality) and orchestrates interactions between the master and worker nodes.
– Veyon Service (service/) – Likely a service component for managing background tasks or keeping persistent connectivity.
- Plugin Architecture (plugins/) – A modular system that extends functionality in authentication (LDAP, simple auth, demo, authkeys, etc.), remote access, screen locking, file transfer, VNC server integration, and more. Note that many subdirectories under plugins indicate a plugin-based design.
- Platform-specific and Third-Party Components:
– Android-specific build and code (android/, plus the .ci configurations for Android builds).
– CI/CD integration (.ci, .github, and GitLab CI files) for automated builds testing and packaging.
– Third-party dependencies (3rdparty/) for integrating external libraries like libvncserver, ultravnc, x11vnc, kldap, etc.
- Build/Configuration Infrastructure:
– CMake files (CMakeLists.txt and the /cmake directory) set up build architectures, package generation (.deb, .rpm) and other compilation parameters.
– Tests (tests/) to cover aspects of the VNC protocols, variant stream messaging, etc.

##### Relationships and Data Flow
- The User Interfaces (Master, Configurator, CLI) communicate with the core libraries, issuing commands and receiving status updates.
- The Master application sends remote control commands via the Server to target Computers where Worker agents are running.
- Plugins integrate with various core components to extend functionality—for example, authentication methods, extra communication methods, or additional remote control features. They should be depicted as modular add-ons that plug into both the core and the respective UI/agent components.
- The Server acts as the mediator for communications. It may also handle tasks like secure transmission (utilizing TLS, as seen in TlsServer.cpp) and proxy connections (VncProxy* files in the server directory).

##### Architectural Patterns and Design Principles
- Layered Architecture: Separate frontend applications (UI) from backend agents and service logic. The core libraries serve as the common layer.
- Modular/Plugin-Based Design: The plugins directory shows a clear approach to extensibility; include a note that new plugins integrate through defined interfaces that are part of the core.
- Multi-platform Support: Directories like android/, plugins/platform (with subdirectories for Linux, Windows, etc.) indicate different implementations based on the target OS.
- Clear separation of concerns: The master, server, worker, and configurator programs each have distinct responsibilities.
- Communication Protocols: At the lower level, components interact using protocols (e.g., VNC) along with authentication and secure messaging.

##### Incorporating Relevant Technologies
- Qt Framework: Many user interface elements and build files mention Qt (via Qt modules, QML, and Qt resources).
- CMake as the build system: Central to generating the build targets for various platforms.
- CI/CD integrations: Both GitHub and GitLab CI configurations detail the cross-platform, automated build and test flows.
- VNC protocol integration: Core and plugin directories include components for VNC connections to support remote desktop controls.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Clients Layer"
        VeyonMaster["Veyon Master (UI)"]:::ui
        VeyonConfigurator["Veyon Configurator"]:::ui
        CLITool["CLI Tool"]:::ui
    end

    subgraph "Core/Logic Layer"
        CoreLibraries["Core Libraries"]:::core
        PluginArch["Plugin Architecture"]:::plugin
    end

    subgraph "Agent/Service Layer"
        VeyonServer["Veyon Server"]:::agent
        VeyonWorker["Veyon Worker"]:::agent
        VeyonService["Veyon Service"]:::agent
    end

    subgraph "Deployment & Integration"
        CICDBuild["CI/CD & Build Infra"]:::ci
        ThirdPartyDeps["Third-Party Dependencies"]:::thirdparty
        AndroidComp["Android Components"]:::android
        TestsComp["Tests"]:::test
    end

    %% Relationships between Layers
    VeyonMaster -->|"commands"| VeyonServer
    VeyonConfigurator -->|"configurations"| CoreLibraries
    CLITool -->|"commands"| CoreLibraries
    CoreLibraries -->|"provides"| VeyonMaster
    CoreLibraries -->|"extends"| PluginArch
    VeyonServer -->|"manages"| VeyonWorker
    VeyonServer -->|"secureTransmission"| VeyonService
    PluginArch -->|"extendAgent"| VeyonWorker
    PluginArch -->|"extendServer"| VeyonServer

    %% Deployment and Integration flows
    CICDBuild -->|"builds"| VeyonMaster
    CICDBuild -->|"builds"| CoreLibraries
    CICDBuild -->|"builds"| VeyonWorker
    CICDBuild -->|"builds"| VeyonServer
    CICDBuild -->|"builds"| VeyonService
    AndroidComp -->|"platformSpec"| VeyonServer
    AndroidComp -->|"platformSpec"| VeyonMaster
    ThirdPartyDeps -->|"integratesWith"| CoreLibraries
    TestsComp -->|"tests"| CoreLibraries

    %% Click Events
    click CoreLibraries "https://github.com/veyon/veyon/tree/master/core/"
    click VeyonMaster "https://github.com/veyon/veyon/tree/master/master/"
    click VeyonConfigurator "https://github.com/veyon/veyon/tree/master/configurator/"
    click CLITool "https://github.com/veyon/veyon/tree/master/cli/"
    click VeyonWorker "https://github.com/veyon/veyon/tree/master/worker/"
    click VeyonServer "https://github.com/veyon/veyon/tree/master/server/"
    click VeyonService "https://github.com/veyon/veyon/tree/master/service/"
    click PluginArch "https://github.com/veyon/veyon/tree/master/plugins/"
    click AndroidComp "https://github.com/veyon/veyon/tree/master/android/"
    click CICDBuild "https://github.com/veyon/veyon/tree/master/.ci/"
    click ThirdPartyDeps "https://github.com/veyon/veyon/tree/master/3rdparty/"
    click TestsComp "https://github.com/veyon/veyon/tree/master/tests/"

    %% Styles
    classDef ui fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef core fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef agent fill:#E6B0AA,stroke:#943126,stroke-width:2px;
    classDef plugin fill:#D2B4DE,stroke:#6C3483,stroke-width:2px;
    classDef ci fill:#A9DFBF,stroke:#196F3D,stroke-width:2px;
    classDef thirdparty fill:#FAD7A0,stroke:#D35400,stroke-width:2px;
    classDef android fill:#F5CBA7,stroke:#A04000,stroke-width:2px;
    classDef test fill:#D5F5E3,stroke:#27AE60,stroke-width:2px;
```
