# icanskk9/mikrotik-hotspot-monitoring architecture

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

- Interactive diagram: https://gitdiagram.com/icanskk9/mikrotik-hotspot-monitoring
- Repository: https://github.com/icanskk9/mikrotik-hotspot-monitoring

## Overview

Mikhmon is a PHP web application for administering MikroTik hotspot vouchers and monitoring network devices, with additional PPPoE, traffic, reporting, and router-configuration capabilities. The principal workflow is an administrator opening a routed page, which reads or changes router state through the RouterOS API and presents the result. The graph groups the main product areas and shared configuration/API layer. Several capabilities are documented but their implementation was not sampled; those links are marked unverified.

Main entry points: [`mikhmon/index.php`](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/index.php) (Mikhmon Router), [`mikhmon/voucher/vpreview.php`](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/voucher/vpreview.php) (Voucher Templates), [`mikhmon/lib/routeros_api.class.php`](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/lib/routeros_api.class.php) (RouterOS API Client), [`mikhmon/include/readcfg.php`](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/include/readcfg.php) (Session Configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_router["Mikhmon Router<br/>[index.php]"]
  node_dashboard["Dashboard<br/>[home.php]"]
end

subgraph group_hotspot["Hotspot Management"]
  node_hotspot_users["Hotspot Users<br/>[users.php]"]
  node_voucher_generation["Voucher Generation<br/>[generateuser.php]"]
  node_voucher_templates["Voucher Templates<br/>[vpreview.php]"]
  node_hotspot_activity["Active Sessions<br/>[hotspotactive.php]"]
  node_hotspot_logs["Hotspot Logs<br/>[log.php]"]
end

subgraph group_network["Network Operations"]
  node_ip_addresses["IP Addresses<br/>[addresses.php]"]
  node_hotspot_setup["Hotspot Setup<br/>[hotspot_setup.php]"]
  node_pppoe["PPPoE Management"]
  node_device_monitor["Device Monitoring<br/>[index.php]"]
end

subgraph group_insights["Monitoring &amp; Reports"]
  node_traffic["Live Traffic"]
  node_reports["Sales Reports<br/>[selling.php]"]
  node_user_activity_report["User Activity Report<br/>[userlog.php]"]
end

subgraph group_shared["Shared Runtime"]
  node_config["Session Configuration<br/>[readcfg.php]"]
  node_api["RouterOS API Client"]
  node_formatting["Data Formatting"]
end

node_admin(("Administrator"))
node_mikrotik{{"MikroTik Router"}}

node_admin -->|"opens"| node_router
node_router -->|"routes to"| node_dashboard
node_router -->|"routes to"| node_hotspot_users
node_router -.->|"routes to"| node_voucher_generation
node_router -->|"routes to"| node_hotspot_logs
node_router -->|"routes to"| node_ip_addresses
node_router -->|"routes to"| node_hotspot_setup
node_router -->|"routes to"| node_user_activity_report
node_router -->|"loads"| node_config
node_hotspot_activity -->|"loads"| node_config
node_hotspot_activity -->|"uses"| node_api
node_device_monitor -->|"uses"| node_api
node_device_monitor -->|"formats with"| node_formatting
node_hotspot_setup -->|"configures"| node_mikrotik
node_api -->|"communicates with"| node_mikrotik
node_voucher_templates -->|"loads"| node_config
node_voucher_templates -->|"formats with"| node_formatting
node_voucher_templates -.->|"prints voucher data"| node_mikrotik
node_dashboard -.->|"monitors"| node_mikrotik
node_pppoe -.->|"manages"| node_mikrotik
node_traffic -.->|"monitors"| node_mikrotik
node_reports -.->|"reports on"| node_mikrotik

click node_router "https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/index.php"
click node_dashboard "https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/dashboard/home.php"
click node_hotspot_users "https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/hotspot/users.php"
click node_voucher_generation "https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/hotspot/generateuser.php"
click node_voucher_templates "https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/voucher/vpreview.php"
click node_hotspot_activity "https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/hotspot/hotspotactive.php"
click node_hotspot_logs "https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/hotspot/log.php"
click node_ip_addresses "https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/ip/addresses.php"
click node_hotspot_setup "https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/ip/hotspot_setup.php"
click node_pppoe "https://github.com/icanskk9/mikrotik-hotspot-monitoring/tree/main/mikhmon/ppp"
click node_device_monitor "https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/status/index.php"
click node_traffic "https://github.com/icanskk9/mikrotik-hotspot-monitoring/tree/main/mikhmon/traffic"
click node_reports "https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/report/selling.php"
click node_user_activity_report "https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/report/userlog.php"
click node_config "https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/include/readcfg.php"
click node_api "https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/lib/routeros_api.class.php"
click node_formatting "https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/lib/formatbytesbites.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_router,node_dashboard toneBlue
class node_hotspot_users,node_voucher_generation,node_voucher_templates,node_hotspot_activity,node_hotspot_logs toneAmber
class node_ip_addresses,node_hotspot_setup,node_pppoe,node_device_monitor,node_mikrotik toneMint
class node_traffic,node_reports,node_user_activity_report toneRose
class node_config,node_api,node_formatting,node_admin toneIndigo
```

## Components

### Application

- [Mikhmon Router](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/index.php): `mikhmon/index.php`
- [Dashboard](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/dashboard/home.php): `mikhmon/dashboard/home.php`

### Hotspot Management

- [Hotspot Users](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/hotspot/users.php): `mikhmon/hotspot/users.php`
- [Voucher Generation](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/hotspot/generateuser.php): `mikhmon/hotspot/generateuser.php`
- [Voucher Templates](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/voucher/vpreview.php): `mikhmon/voucher/vpreview.php`
- [Active Sessions](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/hotspot/hotspotactive.php): `mikhmon/hotspot/hotspotactive.php`
- [Hotspot Logs](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/hotspot/log.php): `mikhmon/hotspot/log.php`

### Network Operations

- [IP Addresses](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/ip/addresses.php): `mikhmon/ip/addresses.php`
- [Hotspot Setup](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/ip/hotspot_setup.php): `mikhmon/ip/hotspot_setup.php`
- [PPPoE Management](https://github.com/icanskk9/mikrotik-hotspot-monitoring/tree/main/mikhmon/ppp): `mikhmon/ppp`
- [Device Monitoring](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/status/index.php): `mikhmon/status/index.php`

### Monitoring & Reports

- [Live Traffic](https://github.com/icanskk9/mikrotik-hotspot-monitoring/tree/main/mikhmon/traffic): `mikhmon/traffic`
- [Sales Reports](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/report/selling.php): `mikhmon/report/selling.php`
- [User Activity Report](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/report/userlog.php): `mikhmon/report/userlog.php`

### Shared Runtime

- [Session Configuration](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/include/readcfg.php): `mikhmon/include/readcfg.php`
- [RouterOS API Client](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/lib/routeros_api.class.php): `mikhmon/lib/routeros_api.class.php`
- [Data Formatting](https://github.com/icanskk9/mikrotik-hotspot-monitoring/blob/main/mikhmon/lib/formatbytesbites.php): `mikhmon/lib/formatbytesbites.php`

### Other components

- **Administrator**
- **MikroTik Router**

## Connections

- Administrator → Mikhmon Router: opens
- Mikhmon Router → Dashboard: routes to (evidence: `mikhmon/index.php`)
- Mikhmon Router → Hotspot Users: routes to (evidence: `mikhmon/index.php`)
- Mikhmon Router → Voucher Generation: routes to (evidence: `mikhmon/index.php`)
- Mikhmon Router → Hotspot Logs: routes to (evidence: `mikhmon/index.php`)
- Mikhmon Router → IP Addresses: routes to (evidence: `mikhmon/index.php`)
- Mikhmon Router → Hotspot Setup: routes to (evidence: `mikhmon/index.php`)
- Mikhmon Router → User Activity Report: routes to (evidence: `mikhmon/index.php`)
- Mikhmon Router → Session Configuration: loads (evidence: `mikhmon/index.php`)
- Active Sessions → Session Configuration: loads (evidence: `mikhmon/hotspot/hotspotactive.php`)
- Active Sessions → RouterOS API Client: uses (evidence: `mikhmon/hotspot/hotspotactive.php`)
- Device Monitoring → RouterOS API Client: uses (evidence: `mikhmon/status/index.php`)
- Device Monitoring → Data Formatting: formats with (evidence: `mikhmon/status/index.php`)
- Hotspot Setup → MikroTik Router: configures (evidence: `mikhmon/ip/hotspot_setup.php`)
- RouterOS API Client → MikroTik Router: communicates with (evidence: `mikhmon/lib/routeros_api.class.php`)
- Voucher Templates → Session Configuration: loads (evidence: `mikhmon/voucher/vpreview.php`)
- Voucher Templates → Data Formatting: formats with (evidence: `mikhmon/voucher/vpreview.php`)
- Voucher Templates → MikroTik Router: prints voucher data
- Dashboard → MikroTik Router: monitors
- PPPoE Management → MikroTik Router: manages
- Live Traffic → MikroTik Router: monitors
- Sales Reports → MikroTik Router: reports on
