# amapchan/v2rayn_flutter-fork architecture

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

- Interactive diagram: https://gitdiagram.com/amapchan/v2rayn_flutter-fork
- Repository: https://github.com/amapchan/v2rayn_flutter-fork

## Overview

v2rayN Flutter is a desktop client scaffold for account access and proxy-service management, with a documented backend API and UI for lines, account, settings, activity, trading, DNS, and app information. The README says proxy-core control is only a placeholder; the bundled Xray binaries are not evidence of an active runtime integration. Dart sources were not sampled, so links between screens, services, and state are limited to the documented app flow and stated API boundary.

Main entry points: [`lib/pages/main_shell.dart`](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/main_shell.dart) (Main shell), [`lib/main.dart`](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/main.dart) (App entry), [`lib/pages/personal_center_page.dart`](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/personal_center_page.dart) (Personal center), [`lib/pages/settings_page.dart`](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/settings_page.dart) (Settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_main["App entry<br/>[main.dart]"]
  node_shell["Main shell<br/>[main_shell.dart]"]
end

subgraph group_account["Account access"]
  node_login["Login<br/>[login_page.dart]"]
  node_personal["Personal center"]
  node_password["Change password"]
end

subgraph group_features["Client features"]
  node_lines["Lines<br/>[lines_page.dart]"]
  node_settings["Settings<br/>[settings_page.dart]"]
  node_dns["DNS settings"]
  node_activity["Activity<br/>[activity_page.dart]"]
  node_trade["Trade manager"]
  node_about["About<br/>[about_page.dart]"]
end

subgraph group_internal["Services and models"]
  node_api["API service<br/>[api_service.dart]"]
  node_state["App state<br/>[app_state.dart]"]
  node_config_store["Config store"]
  node_token_store["Token store<br/>[token_store.dart]"]
  node_config_model["Client config<br/>[client_config.dart]"]
  node_line_model["Line model<br/>[line_node.dart]"]
  node_user_model["User model<br/>[user_info.dart]"]
end

node_user(("User"))
node_backend["Backend API"]

node_user -->|"opens"| node_main
node_main -->|"starts app"| node_shell
node_user -->|"uses"| node_login
node_shell -->|"presents"| node_lines
node_shell -->|"presents"| node_personal
node_shell -->|"presents"| node_settings
node_shell -->|"presents"| node_activity
node_shell -->|"presents"| node_trade
node_shell -->|"presents"| node_about
node_settings -->|"offers"| node_dns
node_personal -->|"offers"| node_password
node_api -.->|"API requests"| node_backend

click node_main "https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/main.dart"
click node_shell "https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/main_shell.dart"
click node_login "https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/login_page.dart"
click node_personal "https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/personal_center_page.dart"
click node_password "https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/change_password_dialog.dart"
click node_lines "https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/lines_page.dart"
click node_settings "https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/settings_page.dart"
click node_dns "https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/dns_settings_page.dart"
click node_activity "https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/activity_page.dart"
click node_trade "https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/trade_manager_page.dart"
click node_about "https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/about_page.dart"
click node_api "https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/services/api_service.dart"
click node_state "https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/app_state.dart"
click node_config_store "https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/services/client_config_store.dart"
click node_token_store "https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/services/token_store.dart"
click node_config_model "https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/models/client_config.dart"
click node_line_model "https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/models/line_node.dart"
click node_user_model "https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/models/user_info.dart"

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_main,node_shell,node_user toneBlue
class node_login,node_personal,node_password toneAmber
class node_lines,node_settings,node_dns,node_activity,node_trade,node_about,node_backend toneMint
class node_api,node_state,node_config_store,node_token_store,node_config_model,node_line_model,node_user_model toneRose
```

## Components

### App shell

- [App entry](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/main.dart): `lib/main.dart`
- [Main shell](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/main_shell.dart): `lib/pages/main_shell.dart`

### Account access

- [Login](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/login_page.dart): `lib/pages/login_page.dart`
- [Personal center](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/personal_center_page.dart): `lib/pages/personal_center_page.dart`
- [Change password](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/change_password_dialog.dart): `lib/pages/change_password_dialog.dart`

### Client features

- [Lines](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/lines_page.dart): `lib/pages/lines_page.dart`
- [Settings](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/settings_page.dart): `lib/pages/settings_page.dart`
- [DNS settings](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/dns_settings_page.dart): `lib/pages/dns_settings_page.dart`
- [Activity](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/activity_page.dart): `lib/pages/activity_page.dart`
- [Trade manager](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/trade_manager_page.dart): `lib/pages/trade_manager_page.dart`
- [About](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/pages/about_page.dart): `lib/pages/about_page.dart`

### Services and models

- [API service](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/services/api_service.dart): `lib/services/api_service.dart`
- [App state](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/app_state.dart): `lib/app_state.dart`
- [Config store](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/services/client_config_store.dart): `lib/services/client_config_store.dart`
- [Token store](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/services/token_store.dart): `lib/services/token_store.dart`
- [Client config](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/models/client_config.dart): `lib/models/client_config.dart`
- [Line model](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/models/line_node.dart): `lib/models/line_node.dart`
- [User model](https://github.com/amapchan/v2rayn_flutter-fork/blob/master/lib/models/user_info.dart): `lib/models/user_info.dart`

### Other components

- **User**
- **Backend API**

## Connections

- User → App entry: opens
- App entry → Main shell: starts app
- User → Login: uses
- Main shell → Lines: presents
- Main shell → Personal center: presents
- Main shell → Settings: presents
- Main shell → Activity: presents
- Main shell → Trade manager: presents
- Main shell → About: presents
- Settings → DNS settings: offers
- Personal center → Change password: offers
- API service → Backend API: API requests
