# reloadly/sample-airtime-topup-platform architecture

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

- Interactive diagram: https://gitdiagram.com/reloadly/sample-airtime-topup-platform
- Repository: https://github.com/reloadly/sample-airtime-topup-platform

## Overview

Reloadly Sample Topup is a Laravel/Vue airtime top-up platform with gift-card sales, invoices and wallets, account administration, and Reloadly integrations. A user can submit a phone-number file, have entries matched to operators, configure and schedule top-ups, then have pending top-ups sent to Reloadly. Gift-card purchases and invoice payments are separate product branches. The graph emphasizes workflows visible in excerpts and documented routes; several controller and payment details are represented only at the subsystem level because their implementation was not sampled.

Main entry points: [`app/Http/Controllers/WizardController.php`](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Http/Controllers/WizardController.php) (File and scheduling workflow), [`app/Http/Controllers/GiftCardProductsController.php`](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Http/Controllers/GiftCardProductsController.php) (Gift-card sales), [`routes/web.php`](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/routes/web.php) (Web routes), [`app/Models/System.php`](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/System.php) (Operator detection and payments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_topup["Airtime top-ups"]
  node_wizardui["Top-up wizard UI<br/>[TopupWizard.vue]"]
  node_sendui["Send top-up UI<br/>[SendTopup.vue]"]
  node_wizard["File and scheduling workflow"]
  node_file["File processing<br/>[File.php]"]
  node_topupmodel["Top-up execution<br/>[Topup.php]"]
  node_country[("Countries<br/>[Country.php]")]
  node_operator[("Operators<br/>[Operator.php]")]
end

subgraph group_gift["Gift cards"]
  node_giftcontroller["Gift-card sales"]
  node_giftui["Gift-card wizard UI<br/>[GiftsWizard.vue]"]
  node_giftproducts[("Gift-card products")]
  node_gifttransactions[("Gift-card transactions")]
end

subgraph group_account["Accounts and billing"]
  node_system["Operator detection and payments<br/>[System.php]"]
  node_invoicecontroller["Invoice management"]
  node_invoice[("Invoices<br/>[Invoice.php]")]
  node_transactions[("Account transactions")]
  node_useraccount[("User accounts<br/>[User.php]")]
  node_paymenttraits["Payment providers<br/>[StripeSystem.php]"]
end

subgraph group_platform["Web application"]
  node_web["Web routes<br/>[web.php]"]
  node_vueboot["Vue registration<br/>[app.js]"]
end

node_user(("User"))
node_reloadly{{"Reloadly API"}}
node_database[("Application database")]

node_user -->|"uses"| node_web
node_web -->|"routes to"| node_wizard
node_web -->|"routes to"| node_giftcontroller
node_web -->|"routes to"| node_invoicecontroller
node_vueboot -->|"registers"| node_wizardui
node_vueboot -->|"registers"| node_sendui
node_vueboot -->|"registers"| node_giftui
node_wizard -->|"reads entries"| node_file
node_file -->|"detects operator"| node_system
node_system -->|"looks up"| node_operator
node_wizard -->|"loads operator"| node_operator
node_wizard -->|"creates"| node_invoice
node_wizard -->|"creates"| node_topupmodel
node_topupmodel -->|"sends top-up"| node_reloadly
node_giftcontroller -->|"queries"| node_giftproducts
node_giftcontroller -->|"creates or checks"| node_gifttransactions
node_giftcontroller -->|"creates"| node_invoice
node_invoicecontroller -->|"loads and updates"| node_invoice
node_invoicecontroller -->|"updates payment"| node_system
node_system -->|"uses"| node_paymenttraits
node_topupmodel -.->|"persists status"| node_database
node_invoice -.->|"persists records"| node_database
node_transactions -.->|"persists records"| node_database
node_useraccount -.->|"persists accounts"| node_database
node_giftproducts -.->|"stores catalog"| node_database
node_gifttransactions -.->|"stores purchases"| node_database
node_country -.->|"stores catalog"| node_database
node_operator -.->|"stores catalog"| node_database

click node_web "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/routes/web.php"
click node_wizardui "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/resources/js/components/TopupWizard.vue"
click node_sendui "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/resources/js/components/SendTopup.vue"
click node_vueboot "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/resources/js/app.js"
click node_wizard "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Http/Controllers/WizardController.php"
click node_file "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/File.php"
click node_system "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/System.php"
click node_topupmodel "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/Topup.php"
click node_giftcontroller "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Http/Controllers/GiftCardProductsController.php"
click node_giftui "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/resources/js/components/GiftCards/GiftsWizard.vue"
click node_invoicecontroller "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Http/Controllers/InvoicesController.php"
click node_invoice "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/Invoice.php"
click node_transactions "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/AccountTransaction.php"
click node_useraccount "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/User.php"
click node_giftproducts "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/GiftCardProduct.php"
click node_gifttransactions "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/GiftCardTransaction.php"
click node_country "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/Country.php"
click node_operator "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/Operator.php"
click node_paymenttraits "https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Traits/StripeSystem.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_wizardui,node_sendui,node_wizard,node_file,node_topupmodel,node_country,node_operator,node_user toneBlue
class node_giftcontroller,node_giftui,node_giftproducts,node_gifttransactions,node_database toneAmber
class node_system,node_invoicecontroller,node_invoice,node_transactions,node_useraccount,node_paymenttraits,node_reloadly toneMint
class node_web,node_vueboot toneRose
```

## Components

### Airtime top-ups

- [Top-up wizard UI](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/resources/js/components/TopupWizard.vue): `resources/js/components/TopupWizard.vue`
- [Send top-up UI](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/resources/js/components/SendTopup.vue): `resources/js/components/SendTopup.vue`
- [File and scheduling workflow](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Http/Controllers/WizardController.php): `app/Http/Controllers/WizardController.php`
- [File processing](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/File.php): `app/Models/File.php`
- [Top-up execution](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/Topup.php): `app/Models/Topup.php`
- [Countries](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/Country.php): `app/Models/Country.php`
- [Operators](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/Operator.php): `app/Models/Operator.php`

### Gift cards

- [Gift-card sales](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Http/Controllers/GiftCardProductsController.php): `app/Http/Controllers/GiftCardProductsController.php`
- [Gift-card wizard UI](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/resources/js/components/GiftCards/GiftsWizard.vue): `resources/js/components/GiftCards/GiftsWizard.vue`
- [Gift-card products](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/GiftCardProduct.php): `app/Models/GiftCardProduct.php`
- [Gift-card transactions](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/GiftCardTransaction.php): `app/Models/GiftCardTransaction.php`

### Accounts and billing

- [Operator detection and payments](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/System.php): `app/Models/System.php`
- [Invoice management](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Http/Controllers/InvoicesController.php): `app/Http/Controllers/InvoicesController.php`
- [Invoices](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/Invoice.php): `app/Models/Invoice.php`
- [Account transactions](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/AccountTransaction.php): `app/Models/AccountTransaction.php`
- [User accounts](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Models/User.php): `app/Models/User.php`
- [Payment providers](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/app/Traits/StripeSystem.php): `app/Traits/StripeSystem.php`

### Web application

- [Web routes](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/routes/web.php): `routes/web.php`
- [Vue registration](https://github.com/reloadly/sample-airtime-topup-platform/blob/main/resources/js/app.js): `resources/js/app.js`

### Other components

- **User**
- **Reloadly API**
- **Application database**

## Connections

- User → Web routes: uses (evidence: `README.md`)
- Web routes → File and scheduling workflow: routes to (evidence: `routes/web.php`)
- Web routes → Gift-card sales: routes to (evidence: `routes/web.php`)
- Web routes → Invoice management: routes to (evidence: `routes/web.php`)
- Vue registration → Top-up wizard UI: registers (evidence: `resources/js/app.js`)
- Vue registration → Send top-up UI: registers (evidence: `resources/js/app.js`)
- Vue registration → Gift-card wizard UI: registers (evidence: `resources/js/app.js`)
- File and scheduling workflow → File processing: reads entries (evidence: `app/Http/Controllers/WizardController.php`)
- File processing → Operator detection and payments: detects operator (evidence: `app/Models/File.php`)
- Operator detection and payments → Operators: looks up (evidence: `app/Models/System.php`)
- File and scheduling workflow → Operators: loads operator (evidence: `app/Http/Controllers/WizardController.php`)
- File and scheduling workflow → Invoices: creates (evidence: `app/Http/Controllers/WizardController.php`)
- File and scheduling workflow → Top-up execution: creates (evidence: `app/Http/Controllers/WizardController.php`)
- Top-up execution → Reloadly API: sends top-up (evidence: `app/Models/Topup.php`)
- Gift-card sales → Gift-card products: queries (evidence: `app/Http/Controllers/GiftCardProductsController.php`)
- Gift-card sales → Gift-card transactions: creates or checks (evidence: `app/Http/Controllers/GiftCardProductsController.php`)
- Gift-card sales → Invoices: creates (evidence: `app/Http/Controllers/GiftCardProductsController.php`)
- Invoice management → Invoices: loads and updates (evidence: `app/Http/Controllers/InvoicesController.php`)
- Invoice management → Operator detection and payments: updates payment (evidence: `app/Http/Controllers/InvoicesController.php`)
- Operator detection and payments → Payment providers: uses (evidence: `app/Models/System.php`)
- Top-up execution → Application database: persists status
- Invoices → Application database: persists records
- Account transactions → Application database: persists records
- User accounts → Application database: persists accounts
- Gift-card products → Application database: stores catalog
- Gift-card transactions → Application database: stores purchases
- Countries → Application database: stores catalog
- Operators → Application database: stores catalog
