# wackydawg/vps_rdp architecture

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

- Interactive diagram: https://gitdiagram.com/wackydawg/vps_rdp
- Repository: https://github.com/wackydawg/vps_rdp

## Overview

Summary / project type and purpose
- This is a single-container, containerized Ubuntu desktop environment with remote-access (RustDesk) plus a small Node.js "status" HTTP server. The project is effectively a monolithic container image that bundles an OS desktop (XFCE), virtual display (Xvfb), applications (Chrome), a RustDesk agent for RDP-like remote access, and a Node.js process (server.js) exposing system information on port 7860.
- Key indicators: Dockerfile + start.sh (container orchestration), server.js + package.json (Node server), README describing XFCE/Xvfb/RustDesk, port 7860, and desktop user/password.

File-structure → architecture mapping
- Dockerfile: builds the monolithic container image (Ubuntu 22.04 base + all installed pieces).
- start.sh: entrypoint that starts all runtime processes inside the container (Xvfb, XFCE session, RustDesk agent, possibly Chrome, and server.js).
- server.js + package.json/package-lock.json: Node.js status server that exposes system information at http://localhost:7860/.
- README.md: documents runtime behavior, credentials, ports, and features.

- Host / Docker Engine (outer context)
- Docker Container (the vps-rdp image)
- Process orchestration / entrypoint: start.sh (or supervisor) — shows that multiple processes are launched from a single script
- Virtual display server: Xvfb (:99, 1280x720)
- Desktop environment: XFCE desktop session (the GUI user session that runs on the virtual display)
- Applications running in the desktop: Chrome (and any other GUI apps)
- Remote-access agent: RustDesk (the component that accepts remote connections and exposes an ID/password)
- Node.js status server: server.js (HTTP API on port 7860)
- Logging stdout/stderr (container logs) — where the RustDesk ID is printed
- External actors / clients (outside the container)
- RustDesk client (external user connecting with ID/password)
- HTTP client (user/browser, monitoring system) calling GET http://host:7860/
- Docker host admin (build/run commands; e.g., docker build/run)

##### Important architectural patterns and design principles to highlight
- Single-container "monolithic" multi-process approach: One Docker image contains multiple cooperating processes rather than microservices. The entrypoint script (start.sh) acts as a simple process orchestrator.
- Process separation: GUI session vs. remote access agent vs. monitoring API — conceptual separation of concerns, but all colocated.
- Headless GUI strategy: Use Xvfb virtual display to run a GUI in a headless container — illustrates the “virtual framebuffer” pattern.
- External-facing interfaces:
- RustDesk (remote desktop protocol/agent) — interactive remote control channel.
- Node.js HTTP API — monitoring/automation channel (non-interactive status endpoint).

##### Relevant technologies / frameworks
- Docker (image & runtime)
- Ubuntu 22.04 base image
- XFCE desktop environment
- Xvfb (virtual display :99)
- RustDesk (remote access agent)
- Chrome (preinstalled browser)
- start.sh (entrypoint) and Dockerfile (image build)

- If converting to production or multi-container architecture, recommend decoupling: move Node.js API to its own container, use a dedicated remote-access gateway or VPN, and add monitoring and persistent volumes.

- Components (all labeled): Host/Docker engine, Container (vps-rdp), Ubuntu base, start.sh, Xvfb (:99), XFCE, Chrome, RustDesk agent, Node.js server (server.js) with port 7860, container logs
- External actors: RustDesk client (internet), HTTP client/browser, Administrator
- Port mappings and protocols: Host:7860 → Container:7860 (HTTP), RustDesk remote access channel (internet)
- Notes/annotations: credential values (mark as secrets), display resolution (:99 1280x720), desktop user/pass, mention that start.sh orchestrates processes

Tooling suggestions

- Inside the container, map the runtime processes (start.sh -> processes) and annotate interactions (RustDesk ↔ XFCE; Node.js → OS; port mapping).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External actors at top
    subgraph "External Actors" 
        direction TB
        RD["RustDesk Client (Internet)"]:::external
        HTTP["HTTP Client / Browser"]:::external
        ADMIN["Administrator / Docker Host Admin"]:::external
    end

    %% Docker Host / Engine
    subgraph "Docker Host / Docker Engine" 
        direction TB
        HOST["Host (Docker Engine)"]:::host
        note_ports["Port mapping: Host:7860 → Container:7860 (HTTP)"]:::note
    end

    HOST -->|"runs container image"| CONTAINER["Container: vps-rdp image"]:::container

    %% Container internals
    subgraph "vps-rdp Container (Ubuntu 22.04)" 
        direction TB
        OS["Ubuntu 22.04 (base image)"]:::os

        ORCHESTRATOR["start.sh (entrypoint) - starts all runtime processes"]:::orchestrator
        ORCHESTRATOR -->|"starts"| XVFB["Xvfb (:99, 1280x720)"]:::process
        ORCHESTRATOR -->|"starts"| XFCE["XFCE desktop session (GUI)"]:::process
        ORCHESTRATOR -->|"starts"| RUSTDESK["RustDesk agent (ID + password)"]:::process
        ORCHESTRATOR -->|"starts"| NODEJS["Node.js status server (server.js) - port 7860"]:::service
        ORCHESTRATOR -->|"may start"| CHROME["Chrome (GUI app)"]:::app

        %% GUI stack vertically
        XVFB -->|"provides virtual display"| XFCE
        XFCE -->|"runs on :99 framebuffer"| CHROME
        RUSTDESK -->|"controls / injects input to"| XFCE

        %% Node.js interactions
        NODEJS -->|"GET / returns JSON system info (uptime, CPU, mem, hostname, IP)"| OS
        NODEJS -->|"exposes HTTP on port 7860"| HOST

        %% Logs and secrets
        LOGS["Container stdout / stderr (logs)"]:::logs
        RUSTDESK -->|"prints RustDesk ID to logs"| LOGS
        LOGS -->|"admin reads RustDesk ID"| ADMIN

        %% Dev mode
        DEV["Developer (local) - node server.js (dev)"]:::dev
        DEV -.->|"dashed: local dev run"| NODEJS

        %% Annotations
        CREDENTIALS["Credentials (README): desktopuser/password123, RustDesk pwd: WackydawgTheBotFather (secret)"]:::note
    end

    %% External connections
    RD -->|"Remote control traffic (ID/password) - Internet"| RUSTDESK
    HTTP -->|"GET http://host:7860/ -> JSON"| NODEJS
    ADMIN -->|"docker build/run, view logs"| HOST

    %% Container composition arrows
    CONTAINER -->|"contains"| OS
    CONTAINER -->|"entrypoint"| ORCHESTRATOR
    CONTAINER -->|"logs"| LOGS

    %% Notes / architecture calls-outs
    ARCH_NOTE["Single-container monolithic multi-process approach (start.sh orchestrates processes)\nHeadless GUI via Xvfb\nNo persistent volumes defined (ephemeral)"]:::note
    CONTAINER --> ARCH_NOTE

    %% File / repo mappings (clickable)
    DockerfileNode["Dockerfile (build image)"]:::file
    StartShNode["start.sh (entrypoint / orchestrator)"]:::file
    ServerJsNode["server.js (Node.js status server)"]:::file
    PackageJsonNode["package.json"]:::file
    PackageLockNode["package-lock.json"]:::file
    ReadmeNode["README.md (runtime docs, ports, creds)"]:::file

    %% Place file nodes visually to the side of container
    CONTAINER -->|"built from"| DockerfileNode
    ORCHESTRATOR -->|"script file"| StartShNode
    NODEJS -->|"implements"| ServerJsNode
    ServerJsNode -->|"depends on"| PackageJsonNode
    PackageJsonNode -->|"lockfile"| PackageLockNode
    CONTAINER -->|"docs"| ReadmeNode

    %% Click events (paths from component_mapping)
    click DockerfileNode "https://github.com/wackydawg/vps_rdp/tree/main/Dockerfile"
    click StartShNode "https://github.com/wackydawg/vps_rdp/blob/main/start.sh"
    click ServerJsNode "https://github.com/wackydawg/vps_rdp/blob/main/server.js"
    click PackageJsonNode "https://github.com/wackydawg/vps_rdp/blob/main/package.json"
    click PackageLockNode "https://github.com/wackydawg/vps_rdp/blob/main/package-lock.json"
    click ReadmeNode "https://github.com/wackydawg/vps_rdp/blob/main/README.md"

    %% Styling
    classDef external fill:#E8F0FE,stroke:#2C6BED,color:#073763;
    classDef host fill:#FFF4E5,stroke:#F2994A,color:#6A4100;
    classDef container fill:#F3F7F9,stroke:#2AA7F7,color:#033E59;
    classDef os fill:#E8F5E9,stroke:#2E7D32,color:#184F1A;
    classDef orchestrator fill:#FFF0F6,stroke:#D6336C,color:#5A0023;
    classDef process fill:#FFF3E0,stroke:#FB8C00,color:#6A3E00;
    classDef service fill:#E3F2FD,stroke:#0288D1,color:#01314A;
    classDef app fill:#FCE4EC,stroke:#C2185B,color:#4A0E2C;
    classDef logs fill:#F5F5F5,stroke:#9E9E9E,color:#333333;
    classDef note fill:#FFFDE7,stroke:#F4B400,color:#6A4B00;
    classDef file fill:#FFFFFF,stroke:#7B1FA2,color:#3B0B4A;
    classDef dev fill:#F3E5F5,stroke:#9C27B0,color:#3A0B3A;

    class DockerfileNode,StartShNode,ServerJsNode,PackageJsonNode,PackageLockNode,ReadmeNode file
    class RD,HTTP,ADMIN external
    class HOST host
    class CONTAINER container
    class OS os
    class ORCHESTRATOR orchestrator
    class XVFB,XFCE,RUSTDESK,CHROME process
    class NODEJS service
    class LOGS logs
    class note_ports,ARCH_NOTE,CREDENTIALS note
    class DEV dev
```
