# kirito0098/adminpanelaz architecture

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

- Interactive diagram: https://gitdiagram.com/kirito0098/adminpanelaz
- Repository: https://github.com/kirito0098/adminpanelaz

## Overview

AdminPanel AntiZapret is a web control panel for managing AntiZapret VPN servers and clients. An administrator uses the React interface to manage profiles and access, configure routing, and monitor nodes; the FastAPI backend exposes those operations and coordinates node agents and persistent state. A documented CIDR workflow refreshes provider data into the controller’s SQLite database, generates route-list files, previews deployment, then deploys lists to selected nodes; applying routing rules is a separate node-side step. The tree and excerpts establish the main capabilities, but not every router-to-service call, so uncertain links are omitted.

Main entry points: [`backend/app/main.py`](https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/main.py) (Panel API), [`backend/app/services/cidr/pipeline/orchestrator.py`](https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/services/cidr/pipeline/orchestrator.py) (CIDR pipeline), [`frontend/src/App.tsx`](https://github.com/kirito0098/adminpanelaz/blob/main/frontend/src/App.tsx) (React panel), [`frontend/src/components/routing/useRoutingPage.ts`](https://github.com/kirito0098/adminpanelaz/blob/main/frontend/src/components/routing/useRoutingPage.ts) (Routing actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web interface"]
  node_web["React panel<br/>[App.tsx]"]
  node_cidr_ui["CIDR workflow"]
  node_routing_page["Routing actions<br/>[useRoutingPage.ts]"]
  node_api_client["API client<br/>[client.ts]"]
end

subgraph group_backend["Panel backend"]
  node_api["Panel API<br/>[main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_cidr_api["CIDR endpoints<br/>[cidr_db.py]"]
end

subgraph group_vpn["VPN management"]
  node_configs["Client profiles<br/>[configs.py]"]
  node_access["Client access<br/>[client_access.py]"]
  node_portal["Client portal<br/>[client_portal.py]"]
  node_routing["Routing controls<br/>[routing.py]"]
  node_cidr_pipeline["CIDR pipeline<br/>[orchestrator.py]"]
  node_node_admin["Node management<br/>[nodes.py]"]
  node_node_sync["Node synchronization"]
  node_node_agent["VPN node agent<br/>[main.py]"]
  node_proxy_agent["Proxy agent<br/>[main.py]"]
end

subgraph group_ops["Operations"]
  node_cidr_db[("CIDR database<br/>[cidr_database.py]")]
  node_monitoring["Monitoring and NOC<br/>[monitoring.py]"]
  node_traffic["Traffic metrics"]
  node_backups["Backup and restore<br/>[backup_manager.py]"]
  node_telegram["Telegram integration<br/>[telegram_bot.py]"]
  node_state[("Panel database<br/>[database.py]")]
end

node_admin(("Administrator"))
node_provider(("CIDR providers"))
node_vpn_server(("VPN server"))
node_telegram_service(("Telegram service"))

node_admin -->|"uses"| node_web
node_web -->|"requests"| node_api
node_api -->|"routes"| node_auth
node_api -->|"routes"| node_configs
node_api -->|"routes"| node_access
node_api -->|"routes"| node_portal
node_api -->|"routes"| node_routing
node_cidr_ui -->|"invokes"| node_routing_page
node_routing_page -->|"calls"| node_api_client
node_api_client -->|"requests"| node_cidr_api
node_provider -->|"supplies lists"| node_cidr_pipeline
node_cidr_api -->|"runs pipeline"| node_cidr_pipeline
node_cidr_pipeline -->|"reads and updates"| node_cidr_db
node_cidr_pipeline -->|"deploys lists"| node_vpn_server
node_admin -->|"manages nodes"| node_node_admin
node_node_admin -->|"coordinates sync"| node_node_sync
node_node_sync -->|"synchronizes"| node_node_agent
node_node_agent -->|"manages VPN"| node_vpn_server
node_proxy_agent -.->|"updates proxy rules"| node_vpn_server
node_api -->|"routes"| node_monitoring
node_monitoring -->|"reads metrics"| node_traffic
node_admin -->|"manages backups"| node_backups
node_api -->|"handles backup operations"| node_backups
node_api -->|"uses persistence"| node_state
node_telegram -.->|"sends notifications"| node_telegram_service

click node_web "https://github.com/kirito0098/adminpanelaz/blob/main/frontend/src/App.tsx"
click node_api "https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/main.py"
click node_auth "https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/routers/auth.py"
click node_configs "https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/routers/configs.py"
click node_access "https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/routers/client_access.py"
click node_portal "https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/routers/client_portal.py"
click node_routing "https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/routers/routing.py"
click node_cidr_ui "https://github.com/kirito0098/adminpanelaz/blob/main/frontend/src/components/routing/CidrPipelineTab.tsx"
click node_routing_page "https://github.com/kirito0098/adminpanelaz/blob/main/frontend/src/components/routing/useRoutingPage.ts"
click node_api_client "https://github.com/kirito0098/adminpanelaz/blob/main/frontend/src/api/client.ts"
click node_cidr_api "https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/routers/cidr_db.py"
click node_cidr_pipeline "https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/services/cidr/pipeline/orchestrator.py"
click node_cidr_db "https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/cidr_database.py"
click node_node_admin "https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/routers/nodes.py"
click node_node_sync "https://github.com/kirito0098/adminpanelaz/tree/main/backend/app/services/node_sync"
click node_node_agent "https://github.com/kirito0098/adminpanelaz/blob/main/backend/node_agent/main.py"
click node_proxy_agent "https://github.com/kirito0098/adminpanelaz/blob/main/backend/proxy_agent/main.py"
click node_monitoring "https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/routers/monitoring.py"
click node_traffic "https://github.com/kirito0098/adminpanelaz/tree/main/backend/app/services/traffic"
click node_backups "https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/services/backup_manager.py"
click node_telegram "https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/services/telegram_bot.py"
click node_state "https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/database.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_web,node_cidr_ui,node_routing_page,node_api_client toneBlue
class node_api,node_auth,node_cidr_api toneAmber
class node_configs,node_access,node_portal,node_routing,node_cidr_pipeline,node_node_admin,node_node_sync,node_node_agent,node_proxy_agent,node_vpn_server toneMint
class node_cidr_db,node_monitoring,node_traffic,node_backups,node_telegram,node_state toneRose
class node_admin,node_provider,node_telegram_service toneIndigo
```

## Components

### Web interface

- [React panel](https://github.com/kirito0098/adminpanelaz/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [CIDR workflow](https://github.com/kirito0098/adminpanelaz/blob/main/frontend/src/components/routing/CidrPipelineTab.tsx): `frontend/src/components/routing/CidrPipelineTab.tsx`
- [Routing actions](https://github.com/kirito0098/adminpanelaz/blob/main/frontend/src/components/routing/useRoutingPage.ts): `frontend/src/components/routing/useRoutingPage.ts`
- [API client](https://github.com/kirito0098/adminpanelaz/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### Panel backend

- [Panel API](https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication](https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [CIDR endpoints](https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/routers/cidr_db.py): `backend/app/routers/cidr_db.py`

### VPN management

- [Client profiles](https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/routers/configs.py): `backend/app/routers/configs.py`
- [Client access](https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/routers/client_access.py): `backend/app/routers/client_access.py`
- [Client portal](https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/routers/client_portal.py): `backend/app/routers/client_portal.py`
- [Routing controls](https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/routers/routing.py): `backend/app/routers/routing.py`
- [CIDR pipeline](https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/services/cidr/pipeline/orchestrator.py): `backend/app/services/cidr/pipeline/orchestrator.py`
- [Node management](https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/routers/nodes.py): `backend/app/routers/nodes.py`
- [Node synchronization](https://github.com/kirito0098/adminpanelaz/tree/main/backend/app/services/node_sync): `backend/app/services/node_sync`
- [VPN node agent](https://github.com/kirito0098/adminpanelaz/blob/main/backend/node_agent/main.py): `backend/node_agent/main.py`
- [Proxy agent](https://github.com/kirito0098/adminpanelaz/blob/main/backend/proxy_agent/main.py): `backend/proxy_agent/main.py`

### Operations

- [CIDR database](https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/cidr_database.py): `backend/app/cidr_database.py`
- [Monitoring and NOC](https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/routers/monitoring.py): `backend/app/routers/monitoring.py`
- [Traffic metrics](https://github.com/kirito0098/adminpanelaz/tree/main/backend/app/services/traffic): `backend/app/services/traffic`
- [Backup and restore](https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/services/backup_manager.py): `backend/app/services/backup_manager.py`
- [Telegram integration](https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/services/telegram_bot.py): `backend/app/services/telegram_bot.py`
- [Panel database](https://github.com/kirito0098/adminpanelaz/blob/main/backend/app/database.py): `backend/app/database.py`

### Other components

- **Administrator**
- **CIDR providers**
- **VPN server**
- **Telegram service**

## Connections

- Administrator → React panel: uses
- React panel → Panel API: requests
- Panel API → Authentication: routes
- Panel API → Client profiles: routes
- Panel API → Client access: routes
- Panel API → Client portal: routes
- Panel API → Routing controls: routes
- CIDR workflow → Routing actions: invokes
- Routing actions → API client: calls
- API client → CIDR endpoints: requests
- CIDR providers → CIDR pipeline: supplies lists
- CIDR endpoints → CIDR pipeline: runs pipeline
- CIDR pipeline → CIDR database: reads and updates
- CIDR pipeline → VPN server: deploys lists
- Administrator → Node management: manages nodes
- Node management → Node synchronization: coordinates sync
- Node synchronization → VPN node agent: synchronizes
- VPN node agent → VPN server: manages VPN
- Proxy agent → VPN server: updates proxy rules
- Panel API → Monitoring and NOC: routes
- Monitoring and NOC → Traffic metrics: reads metrics
- Administrator → Backup and restore: manages backups
- Panel API → Backup and restore: handles backup operations
- Panel API → Panel database: uses persistence
- Telegram integration → Telegram service: sends notifications
