# nickrunning/wechat-selkies architecture

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

- Interactive diagram: https://gitdiagram.com/nickrunning/wechat-selkies
- Repository: https://github.com/nickrunning/wechat-selkies

## Overview

WeChat Selkies packages Linux WeChat and optional QQ in a Docker desktop exposed to a browser through Selkies/WebRTC. The main user path is browser access to the desktop, then launching and using the client; configuration and chat data can persist through the mounted volume. Other documented capabilities include automatic and scheduled client lifecycle management, auto-login, window switching, file and image transfer, Chinese input support, desktop shortcuts, and PCManFM. Most runtime scripts are sampled, but container and desktop integrations are not, so those relationships reflect README documentation.

Main entry points: [`docker-compose.yml`](https://github.com/nickrunning/wechat-selkies/blob/master/docker-compose.yml) (Container Runtime), [`root/scripts/wechat/wechat-start.sh`](https://github.com/nickrunning/wechat-selkies/blob/master/root/scripts/wechat/wechat-start.sh) (WeChat Startup), [`root/scripts/qq/qq-start.sh`](https://github.com/nickrunning/wechat-selkies/blob/master/root/scripts/qq/qq-start.sh) (QQ Startup), [`root/scripts/wechat`](https://github.com/nickrunning/wechat-selkies/tree/master/root/scripts/wechat) (WeChat Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Browser Desktop"]
  node_selkies["Selkies WebRTC"]
end

subgraph group_clients["Messaging Clients"]
  node_wechat["WeChat Client"]
  node_qq["QQ Client"]
end

subgraph group_lifecycle["Client Lifecycle"]
  node_wechat_start["WeChat Startup<br/>[wechat-start.sh]"]
  node_wechat_restart["WeChat Restart<br/>[wechat-restart.sh]"]
  node_nightly["Nightly Schedule"]
  node_auto_login["Auto Login"]
  node_qq_start["QQ Startup<br/>[qq-start.sh]"]
  node_autostart["Autostart Setup"]
end

subgraph group_desktop["Desktop Tools"]
  node_switcher["Window Switcher<br/>[window_switcher.py]"]
  node_menu_refresh["Menu Refresh<br/>[refresh-menu.sh]"]
  node_menu_defaults["Menu Defaults<br/>[menu.xml]"]
  node_file_manager["PCManFM"]
end

subgraph group_state["Container State"]
  node_persistent_data[("Persistent Config Data<br/>[docker-compose.yml]")]
  node_container["Container Runtime<br/>[docker-compose.yml]"]
end

node_user(("Browser User"))

node_user -->|"opens desktop"| node_selkies
node_selkies -->|"displays client"| node_wechat
node_selkies -.->|"displays client"| node_qq
node_container -->|"runs desktop"| node_selkies
node_container -.->|"starts scripts"| node_wechat_start
node_wechat_start -.->|"starts client"| node_wechat
node_wechat_restart -.->|"restarts client"| node_wechat
node_nightly -.->|"schedules restart"| node_wechat_restart
node_wechat_start -.->|"runs after launch"| node_auto_login
node_container -.->|"starts scripts"| node_qq_start
node_qq_start -.->|"starts client"| node_qq
node_autostart -.->|"configures startup"| node_wechat_start
node_autostart -.->|"configures startup"| node_qq_start
node_selkies -.->|"provides desktop UI"| node_switcher
node_menu_refresh -.->|"refreshes menu"| node_menu_defaults
node_menu_refresh -.->|"updates app menu"| node_file_manager
node_container -->|"mounts config"| node_persistent_data
node_selkies -.->|"persists client data"| node_persistent_data

click node_wechat "https://github.com/nickrunning/wechat-selkies/tree/master/root/scripts/wechat"
click node_qq "https://github.com/nickrunning/wechat-selkies/tree/master/root/scripts/qq"
click node_wechat_start "https://github.com/nickrunning/wechat-selkies/blob/master/root/scripts/wechat/wechat-start.sh"
click node_wechat_restart "https://github.com/nickrunning/wechat-selkies/blob/master/root/scripts/wechat/wechat-restart.sh"
click node_nightly "https://github.com/nickrunning/wechat-selkies/blob/master/root/scripts/wechat/wechat-nightly-schedule.sh"
click node_auto_login "https://github.com/nickrunning/wechat-selkies/blob/master/root/scripts/wechat/wechat-auto-login.py"
click node_qq_start "https://github.com/nickrunning/wechat-selkies/blob/master/root/scripts/qq/qq-start.sh"
click node_autostart "https://github.com/nickrunning/wechat-selkies/blob/master/root/defaults/autostart"
click node_switcher "https://github.com/nickrunning/wechat-selkies/blob/master/root/scripts/window_switcher.py"
click node_menu_refresh "https://github.com/nickrunning/wechat-selkies/blob/master/root/scripts/refresh-menu.sh"
click node_menu_defaults "https://github.com/nickrunning/wechat-selkies/blob/master/root/defaults/menu.xml"
click node_persistent_data "https://github.com/nickrunning/wechat-selkies/blob/master/docker-compose.yml"
click node_container "https://github.com/nickrunning/wechat-selkies/blob/master/docker-compose.yml"

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_selkies,node_user toneBlue
class node_wechat,node_qq toneAmber
class node_wechat_start,node_wechat_restart,node_nightly,node_auto_login,node_qq_start,node_autostart toneMint
class node_switcher,node_menu_refresh,node_menu_defaults,node_file_manager toneRose
class node_persistent_data,node_container toneIndigo
```

## Components

### Browser Desktop

- **Selkies WebRTC**

### Messaging Clients

- [WeChat Client](https://github.com/nickrunning/wechat-selkies/tree/master/root/scripts/wechat): `root/scripts/wechat`
- [QQ Client](https://github.com/nickrunning/wechat-selkies/tree/master/root/scripts/qq): `root/scripts/qq`

### Client Lifecycle

- [WeChat Startup](https://github.com/nickrunning/wechat-selkies/blob/master/root/scripts/wechat/wechat-start.sh): `root/scripts/wechat/wechat-start.sh`
- [WeChat Restart](https://github.com/nickrunning/wechat-selkies/blob/master/root/scripts/wechat/wechat-restart.sh): `root/scripts/wechat/wechat-restart.sh`
- [Nightly Schedule](https://github.com/nickrunning/wechat-selkies/blob/master/root/scripts/wechat/wechat-nightly-schedule.sh): `root/scripts/wechat/wechat-nightly-schedule.sh`
- [Auto Login](https://github.com/nickrunning/wechat-selkies/blob/master/root/scripts/wechat/wechat-auto-login.py): `root/scripts/wechat/wechat-auto-login.py`
- [QQ Startup](https://github.com/nickrunning/wechat-selkies/blob/master/root/scripts/qq/qq-start.sh): `root/scripts/qq/qq-start.sh`
- [Autostart Setup](https://github.com/nickrunning/wechat-selkies/blob/master/root/defaults/autostart): `root/defaults/autostart`

### Desktop Tools

- [Window Switcher](https://github.com/nickrunning/wechat-selkies/blob/master/root/scripts/window_switcher.py): `root/scripts/window_switcher.py`
- [Menu Refresh](https://github.com/nickrunning/wechat-selkies/blob/master/root/scripts/refresh-menu.sh): `root/scripts/refresh-menu.sh`
- [Menu Defaults](https://github.com/nickrunning/wechat-selkies/blob/master/root/defaults/menu.xml): `root/defaults/menu.xml`
- **PCManFM**

### Container State

- [Persistent Config Data](https://github.com/nickrunning/wechat-selkies/blob/master/docker-compose.yml): `docker-compose.yml`
- [Container Runtime](https://github.com/nickrunning/wechat-selkies/blob/master/docker-compose.yml): `docker-compose.yml`

### Other components

- **Browser User**

## Connections

- Browser User → Selkies WebRTC: opens desktop (evidence: `README.md`)
- Selkies WebRTC → WeChat Client: displays client (evidence: `README.md`)
- Selkies WebRTC → QQ Client: displays client (evidence: `README.md`)
- Container Runtime → Selkies WebRTC: runs desktop (evidence: `README.md`)
- Container Runtime → WeChat Startup: starts scripts
- WeChat Startup → WeChat Client: starts client
- WeChat Restart → WeChat Client: restarts client
- Nightly Schedule → WeChat Restart: schedules restart (evidence: `README.md`)
- WeChat Startup → Auto Login: runs after launch (evidence: `README.md`)
- Container Runtime → QQ Startup: starts scripts
- QQ Startup → QQ Client: starts client
- Autostart Setup → WeChat Startup: configures startup (evidence: `README.md`)
- Autostart Setup → QQ Startup: configures startup (evidence: `README.md`)
- Selkies WebRTC → Window Switcher: provides desktop UI (evidence: `README.md`)
- Menu Refresh → Menu Defaults: refreshes menu
- Menu Refresh → PCManFM: updates app menu (evidence: `README.md`)
- Container Runtime → Persistent Config Data: mounts config (evidence: `README.md`)
- Selkies WebRTC → Persistent Config Data: persists client data (evidence: `README.md`)
