# codepagol/isp-mikrotik-billing architecture

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

- Interactive diagram: https://gitdiagram.com/codepagol/isp-mikrotik-billing
- Repository: https://github.com/codepagol/isp-mikrotik-billing

## Overview

This Laravel ISP platform lets administrators, resellers, and subscribers manage internet packages, customer billing, router access, and payment. The principal flow is a customer payment or voucher redemption, followed by payment reconciliation and billing updates, then subscriber activation on MikroTik; resellers also manage wallets, packages, and vouchers. Admins operate router and audit features through the application. README documents webhook activation, scheduled billing and router-log polling, RBAC, and SMS integrations; some subsystem links are therefore documented rather than source-verified.

Main entry points: [`app/Services/PaymentService.php`](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Services/PaymentService.php) (Payment Reconciliation), [`app/Models/CustomersInfo.php`](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/CustomersInfo.php) (Customer Records), [`app/Http/Controllers/MikrotikController.php`](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Http/Controllers/MikrotikController.php) (Router Management), [`app/Models/Reseller.php`](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/Reseller.php) (Reseller Accounts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Application Access"]
  node_app["Laravel Filament App<br/>[web.php]"]
  node_access_control["Access Control"]
end

subgraph group_subscriber["Subscriber Billing"]
  node_customer_ops["Customer Management"]
  node_customer_records[("Customer Records<br/>[CustomersInfo.php]")]
  node_packages[("Packages<br/>[PackageList.php]")]
  node_billing[("Billing Records<br/>[BillingInfo.php]")]
  node_collections[("Payment Collections")]
  node_payment_summaries[("Payment Summaries<br/>[PaymentSummary.php]")]
end

subgraph group_router["Router Operations"]
  node_router_admin["Router Management"]
  node_router_api["RouterOS API"]
  node_router_ssh["Router SSH"]
  node_router_records[("Router Registry<br/>[RouterList.php]")]
  node_hotspot["Hotspot Vouchers<br/>[HotspotManager.php]"]
  node_polling["Router Log Polling<br/>[PollRouterLogs.php]"]
end

subgraph group_commerce["Payments Resellers"]
  node_payments["Payment Reconciliation<br/>[PaymentService.php]"]
  node_payment_endpoints["Payment Webhooks"]
  node_reseller_admin["Reseller Administration"]
  node_reseller_dashboard["Reseller Dashboard"]
  node_reseller_records[("Reseller Accounts<br/>[Reseller.php]")]
  node_wallet["Reseller Wallet"]
  node_vouchers[("Reseller Vouchers<br/>[Voucher.php]")]
  node_commissions[("Commission Records")]
  node_wallet_transactions[("Wallet Transactions")]
  node_sms["SMS Notifications<br/>[SMSController.php]"]
end

node_client(("Client / Admin"))
node_android(("SMS Forwarder"))
node_bkash(("bKash IPN"))

node_client -->|"uses"| node_app
node_app -->|"checks access"| node_access_control
node_app -.->|"manages subscribers"| node_customer_ops
node_customer_ops -.->|"updates"| node_customer_records
node_customer_records -->|"references package"| node_packages
node_customer_records -->|"links billing"| node_billing
node_customer_records -->|"links collections"| node_collections
node_customer_records -->|"links summaries"| node_payment_summaries
node_client -.->|"sends payment"| node_payment_endpoints
node_android -->|"posts SMS webhook"| node_payment_endpoints
node_bkash -->|"sends IPN"| node_payment_endpoints
node_payment_endpoints -.->|"reconciles payment"| node_payments
node_payments -->|"updates billing"| node_billing
node_payments -->|"records payment"| node_collections
node_payments -->|"updates summary"| node_payment_summaries
node_payments -->|"updates status"| node_customer_records
node_payments -->|"activates subscriber"| node_router_admin
node_payments -->|"sends confirmation"| node_sms
node_router_admin -->|"uses API"| node_router_api
node_router_admin -->|"uses SSH"| node_router_ssh
node_router_admin -->|"loads routers"| node_router_records
node_hotspot -->|"manages router users"| node_router_admin
node_hotspot -->|"syncs vouchers"| node_vouchers
node_polling -->|"polls logs"| node_router_admin
node_polling -->|"reads routers"| node_router_records
node_reseller_admin -->|"manages accounts"| node_reseller_records
node_reseller_dashboard -->|"loads reseller"| node_reseller_records
node_reseller_admin -->|"uses wallet service"| node_wallet
node_wallet -->|"updates balance"| node_reseller_records
node_reseller_records -->|"has transactions"| node_wallet_transactions
node_reseller_records -->|"has commissions"| node_commissions
node_reseller_records -->|"has vouchers"| node_vouchers
node_reseller_dashboard -->|"loads vouchers"| node_vouchers

click node_app "https://github.com/codepagol/isp-mikrotik-billing/blob/main/routes/web.php"
click node_access_control "https://github.com/codepagol/isp-mikrotik-billing/tree/main/app/Http/Middleware"
click node_customer_ops "https://github.com/codepagol/isp-mikrotik-billing/tree/main/app/Livewire"
click node_customer_records "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/CustomersInfo.php"
click node_packages "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/PackageList.php"
click node_billing "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/BillingInfo.php"
click node_collections "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/CollectionSummary.php"
click node_payment_summaries "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/PaymentSummary.php"
click node_router_admin "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Http/Controllers/MikrotikController.php"
click node_router_api "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Services/MikrotikApiService.php"
click node_router_ssh "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Services/MikrotikSSHService.php"
click node_router_records "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/RouterList.php"
click node_hotspot "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Livewire/Mikrotik/HotspotManager.php"
click node_polling "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Console/Commands/PollRouterLogs.php"
click node_payments "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Services/PaymentService.php"
click node_payment_endpoints "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Http/Controllers/Payment/WebhookPaymentController.php"
click node_reseller_admin "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Http/Controllers/Admin/ResellerController.php"
click node_reseller_dashboard "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Http/Controllers/Reseller/ResellerDashboardController.php"
click node_reseller_records "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/Reseller.php"
click node_wallet "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Services/ResellerWalletService.php"
click node_vouchers "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/Voucher.php"
click node_commissions "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/ResellerCommission.php"
click node_wallet_transactions "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/ResellerWalletTransaction.php"
click node_sms "https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Http/Controllers/SMSController.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_app,node_access_control,node_client toneBlue
class node_customer_ops,node_customer_records,node_packages,node_billing,node_collections,node_payment_summaries toneAmber
class node_router_admin,node_router_api,node_router_ssh,node_router_records,node_hotspot,node_polling toneMint
class node_payments,node_payment_endpoints,node_reseller_admin,node_reseller_dashboard,node_reseller_records,node_wallet,node_vouchers,node_commissions,node_wallet_transactions,node_sms toneRose
class node_android,node_bkash toneIndigo
```

## Components

### Application Access

- [Laravel Filament App](https://github.com/codepagol/isp-mikrotik-billing/blob/main/routes/web.php): `routes/web.php`
- [Access Control](https://github.com/codepagol/isp-mikrotik-billing/tree/main/app/Http/Middleware): `app/Http/Middleware`

### Subscriber Billing

- [Customer Management](https://github.com/codepagol/isp-mikrotik-billing/tree/main/app/Livewire): `app/Livewire`
- [Customer Records](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/CustomersInfo.php): `app/Models/CustomersInfo.php`
- [Packages](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/PackageList.php): `app/Models/PackageList.php`
- [Billing Records](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/BillingInfo.php): `app/Models/BillingInfo.php`
- [Payment Collections](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/CollectionSummary.php): `app/Models/CollectionSummary.php`
- [Payment Summaries](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/PaymentSummary.php): `app/Models/PaymentSummary.php`

### Router Operations

- [Router Management](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Http/Controllers/MikrotikController.php): `app/Http/Controllers/MikrotikController.php`
- [RouterOS API](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Services/MikrotikApiService.php): `app/Services/MikrotikApiService.php`
- [Router SSH](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Services/MikrotikSSHService.php): `app/Services/MikrotikSSHService.php`
- [Router Registry](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/RouterList.php): `app/Models/RouterList.php`
- [Hotspot Vouchers](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Livewire/Mikrotik/HotspotManager.php): `app/Livewire/Mikrotik/HotspotManager.php`
- [Router Log Polling](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Console/Commands/PollRouterLogs.php): `app/Console/Commands/PollRouterLogs.php`

### Payments Resellers

- [Payment Reconciliation](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Services/PaymentService.php): `app/Services/PaymentService.php`
- [Payment Webhooks](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Http/Controllers/Payment/WebhookPaymentController.php): `app/Http/Controllers/Payment/WebhookPaymentController.php`
- [Reseller Administration](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Http/Controllers/Admin/ResellerController.php): `app/Http/Controllers/Admin/ResellerController.php`
- [Reseller Dashboard](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Http/Controllers/Reseller/ResellerDashboardController.php): `app/Http/Controllers/Reseller/ResellerDashboardController.php`
- [Reseller Accounts](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/Reseller.php): `app/Models/Reseller.php`
- [Reseller Wallet](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Services/ResellerWalletService.php): `app/Services/ResellerWalletService.php`
- [Reseller Vouchers](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/Voucher.php): `app/Models/Voucher.php`
- [Commission Records](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/ResellerCommission.php): `app/Models/ResellerCommission.php`
- [Wallet Transactions](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Models/ResellerWalletTransaction.php): `app/Models/ResellerWalletTransaction.php`
- [SMS Notifications](https://github.com/codepagol/isp-mikrotik-billing/blob/main/app/Http/Controllers/SMSController.php): `app/Http/Controllers/SMSController.php`

### Other components

- **Client / Admin**
- **SMS Forwarder**
- **bKash IPN**

## Connections

- Client / Admin → Laravel Filament App: uses (evidence: `README.md`)
- Laravel Filament App → Access Control: checks access (evidence: `README.md`)
- Laravel Filament App → Customer Management: manages subscribers
- Customer Management → Customer Records: updates
- Customer Records → Packages: references package (evidence: `app/Models/CustomersInfo.php`)
- Customer Records → Billing Records: links billing (evidence: `app/Models/CustomersInfo.php`)
- Customer Records → Payment Collections: links collections (evidence: `app/Models/CustomersInfo.php`)
- Customer Records → Payment Summaries: links summaries (evidence: `app/Models/CustomersInfo.php`)
- Client / Admin → Payment Webhooks: sends payment
- SMS Forwarder → Payment Webhooks: posts SMS webhook (evidence: `README.md`)
- bKash IPN → Payment Webhooks: sends IPN (evidence: `README.md`)
- Payment Webhooks → Payment Reconciliation: reconciles payment
- Payment Reconciliation → Billing Records: updates billing (evidence: `app/Services/PaymentService.php`)
- Payment Reconciliation → Payment Collections: records payment (evidence: `app/Services/PaymentService.php`)
- Payment Reconciliation → Payment Summaries: updates summary (evidence: `app/Services/PaymentService.php`)
- Payment Reconciliation → Customer Records: updates status (evidence: `app/Services/PaymentService.php`)
- Payment Reconciliation → Router Management: activates subscriber (evidence: `README.md`)
- Payment Reconciliation → SMS Notifications: sends confirmation (evidence: `app/Services/PaymentService.php`)
- Router Management → RouterOS API: uses API (evidence: `app/Http/Controllers/MikrotikController.php`)
- Router Management → Router SSH: uses SSH (evidence: `app/Http/Controllers/MikrotikController.php`)
- Router Management → Router Registry: loads routers (evidence: `app/Http/Controllers/MikrotikController.php`)
- Hotspot Vouchers → Router Management: manages router users (evidence: `app/Livewire/Mikrotik/HotspotManager.php`)
- Hotspot Vouchers → Reseller Vouchers: syncs vouchers (evidence: `app/Livewire/Mikrotik/HotspotManager.php`)
- Router Log Polling → Router Management: polls logs (evidence: `app/Console/Commands/PollRouterLogs.php`)
- Router Log Polling → Router Registry: reads routers (evidence: `app/Console/Commands/PollRouterLogs.php`)
- Reseller Administration → Reseller Accounts: manages accounts (evidence: `app/Http/Controllers/Admin/ResellerController.php`)
- Reseller Dashboard → Reseller Accounts: loads reseller (evidence: `app/Http/Controllers/Reseller/ResellerDashboardController.php`)
- Reseller Administration → Reseller Wallet: uses wallet service (evidence: `app/Http/Controllers/Admin/ResellerController.php`)
- Reseller Wallet → Reseller Accounts: updates balance (evidence: `app/Services/ResellerWalletService.php`)
- Reseller Accounts → Wallet Transactions: has transactions (evidence: `app/Models/Reseller.php`)
- Reseller Accounts → Commission Records: has commissions (evidence: `app/Models/Reseller.php`)
- Reseller Accounts → Reseller Vouchers: has vouchers (evidence: `app/Models/Reseller.php`)
- Reseller Dashboard → Reseller Vouchers: loads vouchers (evidence: `app/Http/Controllers/Reseller/ResellerDashboardController.php`)
