# orvice/ss-panel architecture

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

- Interactive diagram: https://gitdiagram.com/orvice/ss-panel
- Repository: https://github.com/orvice/ss-panel

## Overview

ss-panel is a Shadowsocks account and server-management panel with a Vue interface and a PHP API. Users register with an invite code or log in, then use the panel to manage account settings and view service information; administrators manage users, nodes, invitations, configuration, and traffic records. Server-side Mu and MuV2 endpoints support the documented Shadowsocks variants, with MuV2 also providing V2Ray-related behavior. The excerpts show authentication and token-storage calls; other subsystem links are limited to README statements and source-index references.

Main entry points: [`app/Controllers/MuV2`](https://github.com/orvice/ss-panel/tree/master/app/Controllers/MuV2) (MuV2 protocol API), [`app/Controllers/Api/TokenController.php`](https://github.com/orvice/ss-panel/blob/master/app/Controllers/Api/TokenController.php) (Authentication API), [`app/Models/User.php`](https://github.com/orvice/ss-panel/blob/master/app/Models/User.php) (User accounts), [`app/Controllers/Api/Admin`](https://github.com/orvice/ss-panel/tree/master/app/Controllers/Api/Admin) (Admin API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_vueapp["Vue panel shell<br/>[App.vue]"]
  node_userpages["User pages"]
  node_adminpages["Admin pages"]
end

subgraph group_api["Panel API"]
  node_tokenapi["Authentication API"]
  node_userapi["User API<br/>[UserController.php]"]
  node_adminapi["Admin API"]
  node_tokencontroller["Token controller"]
end

subgraph group_servers["Server protocols"]
  node_muapi["Mu protocol API"]
  node_muv2api["MuV2 protocol API"]
  node_v2ray["V2Ray generation<br/>[V2rayGenerator.php]"]
end

subgraph group_domain["Domain and storage"]
  node_users[("User accounts<br/>[User.php]")]
  node_nodes[("Server nodes<br/>[Node.php]")]
  node_traffic[("Traffic records<br/>[TrafficLog.php]")]
  node_invites[("Invite codes<br/>[InviteCode.php]")]
end

subgraph group_services["Shared services"]
  node_factory["Service factory<br/>[Factory.php]"]
  node_tokenprovider["Token provider"]
  node_tokenstorage["Token storage<br/>[TokenStorage.php]"]
  node_logger["Logging service<br/>[Logger.php]"]
end

node_user(("Panel user"))
node_admin(("Administrator"))
node_shadowsocks{{"Shadowsocks servers"}}

node_user -->|"uses panel"| node_vueapp
node_admin -->|"manages panel"| node_adminpages
node_vueapp -->|"renders"| node_userpages
node_tokenapi -->|"looks up and saves"| node_users
node_tokenapi -->|"validates and consumes"| node_invites
node_tokenapi -->|"requests token storage"| node_factory
node_tokenprovider -->|"registers"| node_tokenstorage
node_tokenstorage -->|"stores user ID"| node_users
node_muapi -->|"serves protocol"| node_shadowsocks
node_muv2api -->|"serves protocol"| node_shadowsocks
node_muv2api -->|"uses generator"| node_v2ray
node_muv2api -->|"reads node data"| node_nodes
node_muv2api -->|"uses traffic records"| node_traffic
node_userapi -->|"uses account model"| node_users
node_adminapi -->|"manages nodes"| node_nodes
node_adminapi -->|"reads traffic"| node_traffic

click node_vueapp "https://github.com/orvice/ss-panel/blob/master/src/App.vue"
click node_userpages "https://github.com/orvice/ss-panel/tree/master/src/pages"
click node_adminpages "https://github.com/orvice/ss-panel/tree/master/src/pages/Admin"
click node_tokenapi "https://github.com/orvice/ss-panel/blob/master/app/Controllers/Api/TokenController.php"
click node_userapi "https://github.com/orvice/ss-panel/blob/master/app/Controllers/Api/UserController.php"
click node_adminapi "https://github.com/orvice/ss-panel/tree/master/app/Controllers/Api/Admin"
click node_muapi "https://github.com/orvice/ss-panel/tree/master/app/Controllers/Mu"
click node_muv2api "https://github.com/orvice/ss-panel/tree/master/app/Controllers/MuV2"
click node_v2ray "https://github.com/orvice/ss-panel/blob/master/app/Services/V2rayGenerator.php"
click node_users "https://github.com/orvice/ss-panel/blob/master/app/Models/User.php"
click node_nodes "https://github.com/orvice/ss-panel/blob/master/app/Models/Node.php"
click node_traffic "https://github.com/orvice/ss-panel/blob/master/app/Models/TrafficLog.php"
click node_invites "https://github.com/orvice/ss-panel/blob/master/app/Models/InviteCode.php"
click node_tokencontroller "https://github.com/orvice/ss-panel/blob/master/app/Controllers/Api/TokenController.php"
click node_factory "https://github.com/orvice/ss-panel/blob/master/app/Services/Factory.php"
click node_tokenprovider "https://github.com/orvice/ss-panel/blob/master/app/Providers/TokenStorageServiceProvider.php"
click node_tokenstorage "https://github.com/orvice/ss-panel/blob/master/app/Services/Auth/TokenStorage.php"
click node_logger "https://github.com/orvice/ss-panel/blob/master/app/Services/Logger.php"

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_vueapp,node_userpages,node_adminpages,node_user toneBlue
class node_tokenapi,node_userapi,node_adminapi,node_tokencontroller toneAmber
class node_muapi,node_muv2api,node_v2ray,node_shadowsocks toneMint
class node_users,node_nodes,node_traffic,node_invites toneRose
class node_factory,node_tokenprovider,node_tokenstorage,node_logger,node_admin toneIndigo
```

## Components

### Web client

- [Vue panel shell](https://github.com/orvice/ss-panel/blob/master/src/App.vue): `src/App.vue`
- [User pages](https://github.com/orvice/ss-panel/tree/master/src/pages): `src/pages`
- [Admin pages](https://github.com/orvice/ss-panel/tree/master/src/pages/Admin): `src/pages/Admin`

### Panel API

- [Authentication API](https://github.com/orvice/ss-panel/blob/master/app/Controllers/Api/TokenController.php): `app/Controllers/Api/TokenController.php`
- [User API](https://github.com/orvice/ss-panel/blob/master/app/Controllers/Api/UserController.php): `app/Controllers/Api/UserController.php`
- [Admin API](https://github.com/orvice/ss-panel/tree/master/app/Controllers/Api/Admin): `app/Controllers/Api/Admin`
- [Token controller](https://github.com/orvice/ss-panel/blob/master/app/Controllers/Api/TokenController.php): `app/Controllers/Api/TokenController.php`

### Server protocols

- [Mu protocol API](https://github.com/orvice/ss-panel/tree/master/app/Controllers/Mu): `app/Controllers/Mu`
- [MuV2 protocol API](https://github.com/orvice/ss-panel/tree/master/app/Controllers/MuV2): `app/Controllers/MuV2`
- [V2Ray generation](https://github.com/orvice/ss-panel/blob/master/app/Services/V2rayGenerator.php): `app/Services/V2rayGenerator.php`

### Domain and storage

- [User accounts](https://github.com/orvice/ss-panel/blob/master/app/Models/User.php): `app/Models/User.php`
- [Server nodes](https://github.com/orvice/ss-panel/blob/master/app/Models/Node.php): `app/Models/Node.php`
- [Traffic records](https://github.com/orvice/ss-panel/blob/master/app/Models/TrafficLog.php): `app/Models/TrafficLog.php`
- [Invite codes](https://github.com/orvice/ss-panel/blob/master/app/Models/InviteCode.php): `app/Models/InviteCode.php`

### Shared services

- [Service factory](https://github.com/orvice/ss-panel/blob/master/app/Services/Factory.php): `app/Services/Factory.php`
- [Token provider](https://github.com/orvice/ss-panel/blob/master/app/Providers/TokenStorageServiceProvider.php): `app/Providers/TokenStorageServiceProvider.php`
- [Token storage](https://github.com/orvice/ss-panel/blob/master/app/Services/Auth/TokenStorage.php): `app/Services/Auth/TokenStorage.php`
- [Logging service](https://github.com/orvice/ss-panel/blob/master/app/Services/Logger.php): `app/Services/Logger.php`

### Other components

- **Panel user**
- **Administrator**
- **Shadowsocks servers**

## Connections

- Panel user → Vue panel shell: uses panel (evidence: `README.md`)
- Administrator → Admin pages: manages panel (evidence: `README.md`)
- Vue panel shell → User pages: renders (evidence: `src/App.vue`)
- Authentication API → User accounts: looks up and saves (evidence: `app/Controllers/Api/TokenController.php`)
- Authentication API → Invite codes: validates and consumes (evidence: `app/Controllers/Api/TokenController.php`)
- Authentication API → Service factory: requests token storage (evidence: `app/Controllers/Api/TokenController.php`)
- Token provider → Token storage: registers (evidence: `app/Providers/TokenStorageServiceProvider.php`)
- Token storage → User accounts: stores user ID (evidence: `app/Services/Auth/TokenStorage.php`)
- Mu protocol API → Shadowsocks servers: serves protocol (evidence: `README.md`)
- MuV2 protocol API → Shadowsocks servers: serves protocol (evidence: `README.md`)
- MuV2 protocol API → V2Ray generation: uses generator (evidence: `app/Controllers/MuV2/NodeController.php`)
- MuV2 protocol API → Server nodes: reads node data (evidence: `app/Controllers/MuV2/NodeController.php`)
- MuV2 protocol API → Traffic records: uses traffic records (evidence: `app/Controllers/MuV2/NodeController.php`)
- User API → User accounts: uses account model (evidence: `app/Controllers/Api/UserController.php`)
- Admin API → Server nodes: manages nodes (evidence: `app/Controllers/Api/Admin/NodeController.php`)
- Admin API → Traffic records: reads traffic (evidence: `app/Controllers/Api/Admin/NodeController.php`)
