# 3505675604/g-net architecture

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

- Interactive diagram: https://gitdiagram.com/3505675604/g-net
- Repository: https://github.com/3505675604/g-net
- Video tour (about a minute): https://gitdiagram.com/3505675604/g-net/video

## Overview

G-Network is a Windows-hosted Linux server management toolkit: users manage servers through a local web panel, which dispatches remote SSH operations and presents results. Its major product branches include server administration, node deployment and Clash configuration, file/terminal/desktop access, and local product services. The README documents these capabilities; sampled source and the SOURCE INDEX support the named module relationships, while some feature-specific routing is unsampled, so those links are documented rather than inferred from module names.

Main entry points: [`server-manager/app.py`](https://github.com/3505675604/g-net/blob/main/server-manager/app.py) (Panel API), [`clash_studio.py`](https://github.com/3505675604/g-net/blob/main/clash_studio.py) (Clash Studio), [`script_common.py`](https://github.com/3505675604/g-net/blob/main/script_common.py) (SSH identity and connection), [`remote_ops.py`](https://github.com/3505675604/g-net/blob/main/remote_ops.py) (SSH operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_panel["Web management"]
  node_panel_ui["Management UI<br/>[index.html]"]
  node_api["Panel API<br/>[app.py]"]
  node_server_registry[("Server registry<br/>[app.py]")]
end

subgraph group_nodes["Node configuration"]
  node_clash_studio["Clash Studio<br/>[clash_studio.py]"]
  node_clash_workspace["Multi-node workspace<br/>[clash_workspace.py]"]
  node_clash_import["Profile import<br/>[clash_import.py]"]
  node_clash_export["Profile export<br/>[clash_export.py]"]
  node_routing["Node routing<br/>[node_routing.py]"]
  node_routing_store[("Routing preferences")]
  node_profile_store[("Profile storage")]
end

subgraph group_remote["Remote operations"]
  node_toolbox["Remote toolbox<br/>[app.py]"]
  node_file_manager["Remote files<br/>[app.py]"]
  node_terminal["Web terminal<br/>[app.py]"]
  node_desktop_access["Remote desktop<br/>[app.py]"]
  node_ssh_ops["SSH operations<br/>[remote_ops.py]"]
  node_ssh_common["SSH identity and connection<br/>[script_common.py]"]
end

subgraph group_desktop["Local product services"]
  node_desktop_services["Backup and updates"]
  node_product_integration["Product lifecycle binding"]
  node_local_security["Local credential security<br/>[local_security.py]"]
  node_desktop_app["Desktop application<br/>[desktop_app.py]"]
end

subgraph group_scripts["Standalone tools"]
  node_deploy_xray["Deploy Xray<br/>[deploy_xray.py]"]
  node_tune_xray["Tune Xray<br/>[tune_xray.py]"]
  node_install_desktop["Install desktop<br/>[install_desktop.py]"]
  node_install_dsh["Install dsh<br/>[install_dsh.py]"]
  node_fix_xrdp["Repair xrdp<br/>[fix_xrdp.py]"]
end

node_user(("Administrator"))
node_linux_server(("Managed Linux server"))

node_user -->|"uses"| node_panel_ui
node_panel_ui -.->|"sends requests"| node_api
node_api -.->|"manages"| node_server_registry
node_api -.->|"dispatches"| node_toolbox
node_api -->|"serves file actions"| node_file_manager
node_api -.->|"provides terminal"| node_terminal
node_api -.->|"provides desktop access"| node_desktop_access
node_toolbox -.->|"runs remote commands"| node_ssh_ops
node_file_manager -->|"reads files"| node_linux_server
node_ssh_ops -->|"executes commands"| node_linux_server
node_api -->|"routes configuration"| node_clash_studio
node_clash_studio -->|"imports profiles"| node_clash_import
node_clash_studio -->|"exports profiles"| node_clash_export
node_clash_studio -->|"builds workspace"| node_clash_workspace
node_clash_studio -->|"uses node policies"| node_routing
node_clash_studio -->|"uses profile storage"| node_profile_store
node_api -->|"persists routing"| node_routing_store
node_routing_store -->|"normalizes policies"| node_routing
node_user -->|"runs locally"| node_desktop_app
node_desktop_app -.->|"binds product services"| node_product_integration
node_product_integration -->|"integrates services"| node_desktop_services
node_desktop_services -->|"protects local data"| node_local_security
node_user -->|"runs standalone tools"| node_deploy_xray
node_deploy_xray -->|"connects over SSH"| node_ssh_common
node_deploy_xray -->|"updates Xray config"| node_ssh_ops
node_tune_xray -->|"connects over SSH"| node_ssh_common
node_tune_xray -->|"tunes server"| node_ssh_ops
node_install_desktop -->|"connects over SSH"| node_ssh_common
node_install_desktop -->|"installs desktop"| node_linux_server
node_install_dsh -->|"uses SSH settings"| node_ssh_common
node_fix_xrdp -->|"connects over SSH"| node_ssh_common
node_fix_xrdp -->|"repairs sessions"| node_linux_server

click node_panel_ui "https://github.com/3505675604/g-net/blob/main/server-manager/templates/index.html"
click node_api "https://github.com/3505675604/g-net/blob/main/server-manager/app.py"
click node_server_registry "https://github.com/3505675604/g-net/blob/main/server-manager/app.py"
click node_toolbox "https://github.com/3505675604/g-net/blob/main/server-manager/app.py"
click node_file_manager "https://github.com/3505675604/g-net/blob/main/server-manager/app.py"
click node_terminal "https://github.com/3505675604/g-net/blob/main/server-manager/app.py"
click node_desktop_access "https://github.com/3505675604/g-net/blob/main/server-manager/app.py"
click node_ssh_ops "https://github.com/3505675604/g-net/blob/main/remote_ops.py"
click node_ssh_common "https://github.com/3505675604/g-net/blob/main/script_common.py"
click node_clash_studio "https://github.com/3505675604/g-net/blob/main/clash_studio.py"
click node_clash_workspace "https://github.com/3505675604/g-net/blob/main/clash_workspace.py"
click node_clash_import "https://github.com/3505675604/g-net/blob/main/clash_import.py"
click node_clash_export "https://github.com/3505675604/g-net/blob/main/clash_export.py"
click node_routing "https://github.com/3505675604/g-net/blob/main/node_routing.py"
click node_routing_store "https://github.com/3505675604/g-net/blob/main/node_routing_store.py"
click node_profile_store "https://github.com/3505675604/g-net/blob/main/clash_profile_store.py"
click node_desktop_services "https://github.com/3505675604/g-net/blob/main/desktop_services.py"
click node_product_integration "https://github.com/3505675604/g-net/blob/main/product_integration.py"
click node_local_security "https://github.com/3505675604/g-net/blob/main/local_security.py"
click node_desktop_app "https://github.com/3505675604/g-net/blob/main/desktop_app.py"
click node_deploy_xray "https://github.com/3505675604/g-net/blob/main/deploy_xray.py"
click node_tune_xray "https://github.com/3505675604/g-net/blob/main/tune_xray.py"
click node_install_desktop "https://github.com/3505675604/g-net/blob/main/install_desktop.py"
click node_install_dsh "https://github.com/3505675604/g-net/blob/main/install_dsh.py"
click node_fix_xrdp "https://github.com/3505675604/g-net/blob/main/fix_xrdp.py"

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_panel_ui,node_api,node_server_registry toneBlue
class node_clash_studio,node_clash_workspace,node_clash_import,node_clash_export,node_routing,node_routing_store,node_profile_store toneAmber
class node_toolbox,node_file_manager,node_terminal,node_desktop_access,node_ssh_ops,node_ssh_common,node_linux_server toneMint
class node_desktop_services,node_product_integration,node_local_security,node_desktop_app toneRose
class node_deploy_xray,node_tune_xray,node_install_desktop,node_install_dsh,node_fix_xrdp,node_user toneIndigo
```

## Components

### Web management

- [Management UI](https://github.com/3505675604/g-net/blob/main/server-manager/templates/index.html): `server-manager/templates/index.html`
- [Panel API](https://github.com/3505675604/g-net/blob/main/server-manager/app.py): `server-manager/app.py`
- [Server registry](https://github.com/3505675604/g-net/blob/main/server-manager/app.py): `server-manager/app.py`

### Node configuration

- [Clash Studio](https://github.com/3505675604/g-net/blob/main/clash_studio.py): `clash_studio.py`
- [Multi-node workspace](https://github.com/3505675604/g-net/blob/main/clash_workspace.py): `clash_workspace.py`
- [Profile import](https://github.com/3505675604/g-net/blob/main/clash_import.py): `clash_import.py`
- [Profile export](https://github.com/3505675604/g-net/blob/main/clash_export.py): `clash_export.py`
- [Node routing](https://github.com/3505675604/g-net/blob/main/node_routing.py): `node_routing.py`
- [Routing preferences](https://github.com/3505675604/g-net/blob/main/node_routing_store.py): `node_routing_store.py`
- [Profile storage](https://github.com/3505675604/g-net/blob/main/clash_profile_store.py): `clash_profile_store.py`

### Remote operations

- [Remote toolbox](https://github.com/3505675604/g-net/blob/main/server-manager/app.py): `server-manager/app.py`
- [Remote files](https://github.com/3505675604/g-net/blob/main/server-manager/app.py): `server-manager/app.py`
- [Web terminal](https://github.com/3505675604/g-net/blob/main/server-manager/app.py): `server-manager/app.py`
- [Remote desktop](https://github.com/3505675604/g-net/blob/main/server-manager/app.py): `server-manager/app.py`
- [SSH operations](https://github.com/3505675604/g-net/blob/main/remote_ops.py): `remote_ops.py`
- [SSH identity and connection](https://github.com/3505675604/g-net/blob/main/script_common.py): `script_common.py`

### Local product services

- [Backup and updates](https://github.com/3505675604/g-net/blob/main/desktop_services.py): `desktop_services.py`
- [Product lifecycle binding](https://github.com/3505675604/g-net/blob/main/product_integration.py): `product_integration.py`
- [Local credential security](https://github.com/3505675604/g-net/blob/main/local_security.py): `local_security.py`
- [Desktop application](https://github.com/3505675604/g-net/blob/main/desktop_app.py): `desktop_app.py`

### Standalone tools

- [Deploy Xray](https://github.com/3505675604/g-net/blob/main/deploy_xray.py): `deploy_xray.py`
- [Tune Xray](https://github.com/3505675604/g-net/blob/main/tune_xray.py): `tune_xray.py`
- [Install desktop](https://github.com/3505675604/g-net/blob/main/install_desktop.py): `install_desktop.py`
- [Install dsh](https://github.com/3505675604/g-net/blob/main/install_dsh.py): `install_dsh.py`
- [Repair xrdp](https://github.com/3505675604/g-net/blob/main/fix_xrdp.py): `fix_xrdp.py`

### Other components

- **Administrator**
- **Managed Linux server**

## Connections

- Administrator → Management UI: uses (evidence: `README.md`)
- Management UI → Panel API: sends requests
- Panel API → Server registry: manages (evidence: `server-manager/app.py`)
- Panel API → Remote toolbox: dispatches (evidence: `server-manager/app.py`)
- Panel API → Remote files: serves file actions (evidence: `server-manager/app.py`)
- Panel API → Web terminal: provides terminal (evidence: `server-manager/app.py`)
- Panel API → Remote desktop: provides desktop access (evidence: `server-manager/app.py`)
- Remote toolbox → SSH operations: runs remote commands (evidence: `server-manager/app.py`)
- Remote files → Managed Linux server: reads files (evidence: `server-manager/app.py`)
- SSH operations → Managed Linux server: executes commands (evidence: `README.md`)
- Panel API → Clash Studio: routes configuration (evidence: `server-manager/app.py`)
- Clash Studio → Profile import: imports profiles (evidence: `clash_studio.py`)
- Clash Studio → Profile export: exports profiles (evidence: `clash_studio.py`)
- Clash Studio → Multi-node workspace: builds workspace (evidence: `clash_studio.py`)
- Clash Studio → Node routing: uses node policies (evidence: `clash_studio.py`)
- Clash Studio → Profile storage: uses profile storage (evidence: `clash_studio.py`)
- Panel API → Routing preferences: persists routing (evidence: `server-manager/app.py`)
- Routing preferences → Node routing: normalizes policies (evidence: `node_routing_store.py`)
- Administrator → Desktop application: runs locally (evidence: `README.md`)
- Desktop application → Product lifecycle binding: binds product services
- Product lifecycle binding → Backup and updates: integrates services (evidence: `product_integration.py`)
- Backup and updates → Local credential security: protects local data (evidence: `desktop_services.py`)
- Administrator → Deploy Xray: runs standalone tools (evidence: `README.md`)
- Deploy Xray → SSH identity and connection: connects over SSH (evidence: `deploy_xray.py`)
- Deploy Xray → SSH operations: updates Xray config (evidence: `deploy_xray.py`)
- Tune Xray → SSH identity and connection: connects over SSH (evidence: `tune_xray.py`)
- Tune Xray → SSH operations: tunes server (evidence: `tune_xray.py`)
- Install desktop → SSH identity and connection: connects over SSH (evidence: `install_desktop.py`)
- Install desktop → Managed Linux server: installs desktop (evidence: `README.md`)
- Install dsh → SSH identity and connection: uses SSH settings (evidence: `install_dsh.py`)
- Repair xrdp → SSH identity and connection: connects over SSH (evidence: `fix_xrdp.py`)
- Repair xrdp → Managed Linux server: repairs sessions (evidence: `README.md`)
