# pasha1neo/luci-app-adguardvpn architecture

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

- Interactive diagram: https://gitdiagram.com/pasha1neo/luci-app-adguardvpn
- Repository: https://github.com/pasha1neo/luci-app-adguardvpn

## Overview

This repository is an OpenWrt LuCI interface for managing AdGuard VPN. The main workflow is to inspect status and account information, choose connection settings or a location, and operate the VPN through the CLI; users can also authenticate and inspect client logs. The sampled settings view shows CLI and login-helper calls, while the README documents service management and configuration-triggered restarts. Other setting-to-service details are documented but their implementation was not sampled.

Main entry points: [`htdocs/luci-static/resources/view/adguardvpn/settings.js`](https://github.com/pasha1neo/luci-app-adguardvpn/blob/main/htdocs/luci-static/resources/view/adguardvpn/settings.js) (Status and settings), [`htdocs/luci-static/resources/view/adguardvpn/logs.js`](https://github.com/pasha1neo/luci-app-adguardvpn/blob/main/htdocs/luci-static/resources/view/adguardvpn/logs.js) (Log viewer), [`root/usr/libexec/adguardvpn-login`](https://github.com/pasha1neo/luci-app-adguardvpn/blob/main/root/usr/libexec/adguardvpn-login) (Login helper), [`root/etc/config/adguardvpn`](https://github.com/pasha1neo/luci-app-adguardvpn/blob/main/root/etc/config/adguardvpn) (VPN configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["LuCI interface"]
  node_settings["Status and settings<br/>[settings.js]"]
  node_logs["Log viewer<br/>[logs.js]"]
end

subgraph group_runtime["VPN runtime"]
  node_login["Login helper"]
  node_cli["AdGuard VPN CLI"]
  node_logfiles["VPN log files"]
end

subgraph group_system["OpenWrt integration"]
  node_config["VPN configuration"]
  node_service["Init service<br/>[adguardvpn]"]
  node_menu["LuCI menu entry"]
  node_acl["RPC access rules"]
end

node_user(("Router administrator"))

node_user -->|"manages VPN"| node_settings
node_user -->|"views logs"| node_logs
node_settings -->|"runs commands"| node_cli
node_settings -->|"starts or stops"| node_login
node_login -.->|"supports login"| node_cli
node_logs -->|"tails selected log"| node_logfiles
node_service -->|"manages client"| node_cli
node_config -->|"triggers restart"| node_service
node_settings -->|"sets connection options"| node_config

click node_settings "https://github.com/pasha1neo/luci-app-adguardvpn/blob/main/htdocs/luci-static/resources/view/adguardvpn/settings.js"
click node_logs "https://github.com/pasha1neo/luci-app-adguardvpn/blob/main/htdocs/luci-static/resources/view/adguardvpn/logs.js"
click node_login "https://github.com/pasha1neo/luci-app-adguardvpn/blob/main/root/usr/libexec/adguardvpn-login"
click node_config "https://github.com/pasha1neo/luci-app-adguardvpn/blob/main/root/etc/config/adguardvpn"
click node_service "https://github.com/pasha1neo/luci-app-adguardvpn/blob/main/root/etc/init.d/adguardvpn"
click node_menu "https://github.com/pasha1neo/luci-app-adguardvpn/blob/main/root/usr/share/luci/menu.d/luci-app-adguardvpn.json"
click node_acl "https://github.com/pasha1neo/luci-app-adguardvpn/blob/main/root/usr/share/rpcd/acl.d/luci-app-adguardvpn.json"

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_settings,node_logs toneBlue
class node_login,node_cli,node_logfiles toneAmber
class node_config,node_service,node_menu,node_acl,node_user toneMint
```

## Components

### LuCI interface

- [Status and settings](https://github.com/pasha1neo/luci-app-adguardvpn/blob/main/htdocs/luci-static/resources/view/adguardvpn/settings.js): `htdocs/luci-static/resources/view/adguardvpn/settings.js`
- [Log viewer](https://github.com/pasha1neo/luci-app-adguardvpn/blob/main/htdocs/luci-static/resources/view/adguardvpn/logs.js): `htdocs/luci-static/resources/view/adguardvpn/logs.js`

### VPN runtime

- [Login helper](https://github.com/pasha1neo/luci-app-adguardvpn/blob/main/root/usr/libexec/adguardvpn-login): `root/usr/libexec/adguardvpn-login`
- **AdGuard VPN CLI**
- **VPN log files**

### OpenWrt integration

- [VPN configuration](https://github.com/pasha1neo/luci-app-adguardvpn/blob/main/root/etc/config/adguardvpn): `root/etc/config/adguardvpn`
- [Init service](https://github.com/pasha1neo/luci-app-adguardvpn/blob/main/root/etc/init.d/adguardvpn): `root/etc/init.d/adguardvpn`
- [LuCI menu entry](https://github.com/pasha1neo/luci-app-adguardvpn/blob/main/root/usr/share/luci/menu.d/luci-app-adguardvpn.json): `root/usr/share/luci/menu.d/luci-app-adguardvpn.json`
- [RPC access rules](https://github.com/pasha1neo/luci-app-adguardvpn/blob/main/root/usr/share/rpcd/acl.d/luci-app-adguardvpn.json): `root/usr/share/rpcd/acl.d/luci-app-adguardvpn.json`

### Other components

- **Router administrator**

## Connections

- Router administrator → Status and settings: manages VPN (evidence: `README.md`)
- Router administrator → Log viewer: views logs (evidence: `README.md`)
- Status and settings → AdGuard VPN CLI: runs commands (evidence: `htdocs/luci-static/resources/view/adguardvpn/settings.js`)
- Status and settings → Login helper: starts or stops (evidence: `htdocs/luci-static/resources/view/adguardvpn/settings.js`)
- Login helper → AdGuard VPN CLI: supports login
- Log viewer → VPN log files: tails selected log (evidence: `htdocs/luci-static/resources/view/adguardvpn/logs.js`)
- Init service → AdGuard VPN CLI: manages client (evidence: `README.md`)
- VPN configuration → Init service: triggers restart (evidence: `README.md`)
- Status and settings → VPN configuration: sets connection options (evidence: `README.md`)
