# technodweep/gst-invoice architecture

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

- Interactive diagram: https://gitdiagram.com/technodweep/gst-invoice
- Repository: https://github.com/technodweep/gst-invoice

## Overview

GST Invoice is a PHP/Yii2 web application for maintaining customers, products and tax/business settings, then creating and printing GST invoices. The visible invoice controller loads and saves invoice models, reads settings and tax rates, and prepares invoice-item forms; customer and product controllers provide related CRUD and lookup workflows. The README documents MySQL-backed self-hosting and invoice PDF/print output. Source excerpts establish controller/model interactions, but do not show the full persistence or routing implementation, so those links are omitted or marked unverified.

Main entry points: [`views/layouts/main.php`](https://github.com/technodweep/gst-invoice/blob/github/views/layouts/main.php) (Navigation layout), [`controllers/InvoiceOrderController.php`](https://github.com/technodweep/gst-invoice/blob/github/controllers/InvoiceOrderController.php) (Invoice workflow), [`controllers/CustomersController.php`](https://github.com/technodweep/gst-invoice/blob/github/controllers/CustomersController.php) (Customer management), [`controllers/ProductsController.php`](https://github.com/technodweep/gst-invoice/blob/github/controllers/ProductsController.php) (Product management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_entry["Web entry<br/>[index.php]"]
  node_config["App configuration<br/>[web.php]"]
  node_layout["Navigation layout<br/>[main.php]"]
  node_site["Site and login<br/>[SiteController.php]"]
end

subgraph group_billing["Billing records"]
  node_orders["Invoice workflow"]
  node_order_model["Invoice records<br/>[InvoiceOrder.php]"]
  node_order_views["Invoice screens"]
  node_customers["Customer management"]
  node_customer_model["Customer records<br/>[Customers.php]"]
  node_customer_views["Customer screens"]
end

subgraph group_catalog["Business data"]
  node_products["Product management"]
  node_product_model["Product records<br/>[Products.php]"]
  node_product_views["Product screens"]
  node_settings["Business settings"]
  node_settings_model["Settings records<br/>[Settings.php]"]
  node_tax["Tax settings"]
  node_tax_model["Tax records<br/>[TaxSettings.php]"]
end

subgraph group_persistence["Persistence"]
  node_db_config["Database connection<br/>[db.php]"]
  node_mysql[("MySQL database")]
end

node_user(("Business user"))

node_user -->|"opens app"| node_entry
node_entry -->|"loads config"| node_config
node_config -->|"loads connection"| node_db_config
node_layout -->|"links orders"| node_orders
node_layout -->|"links products"| node_products
node_layout -->|"links customers"| node_customers
node_layout -->|"links settings"| node_settings
node_layout -->|"links tax settings"| node_tax
node_orders -->|"loads and saves"| node_order_model
node_orders -->|"reads settings"| node_settings_model
node_orders -->|"reads tax rates"| node_tax_model
node_customers -->|"loads and saves"| node_customer_model
node_customers -->|"renders screens"| node_customer_views
node_products -->|"loads and saves"| node_product_model
node_settings -->|"loads and saves"| node_settings_model
node_tax -->|"loads and saves"| node_tax_model
node_db_config -.->|"connects to"| node_mysql
node_order_model -.->|"persists records"| node_mysql
node_customer_model -.->|"persists records"| node_mysql
node_product_model -.->|"persists records"| node_mysql
node_order_views -.->|"serves invoice UI"| node_orders
node_product_views -.->|"serves product UI"| node_products
node_site -.->|"authenticates"| node_user

click node_entry "https://github.com/technodweep/gst-invoice/blob/github/web/index.php"
click node_config "https://github.com/technodweep/gst-invoice/blob/github/config/web.php"
click node_layout "https://github.com/technodweep/gst-invoice/blob/github/views/layouts/main.php"
click node_site "https://github.com/technodweep/gst-invoice/blob/github/controllers/SiteController.php"
click node_orders "https://github.com/technodweep/gst-invoice/blob/github/controllers/InvoiceOrderController.php"
click node_order_model "https://github.com/technodweep/gst-invoice/blob/github/models/InvoiceOrder.php"
click node_order_views "https://github.com/technodweep/gst-invoice/tree/github/views/invoice-order"
click node_customers "https://github.com/technodweep/gst-invoice/blob/github/controllers/CustomersController.php"
click node_customer_model "https://github.com/technodweep/gst-invoice/blob/github/models/Customers.php"
click node_customer_views "https://github.com/technodweep/gst-invoice/tree/github/views/customers"
click node_products "https://github.com/technodweep/gst-invoice/blob/github/controllers/ProductsController.php"
click node_product_model "https://github.com/technodweep/gst-invoice/blob/github/models/Products.php"
click node_product_views "https://github.com/technodweep/gst-invoice/tree/github/views/products"
click node_settings "https://github.com/technodweep/gst-invoice/blob/github/controllers/SettingsController.php"
click node_settings_model "https://github.com/technodweep/gst-invoice/blob/github/models/Settings.php"
click node_tax "https://github.com/technodweep/gst-invoice/blob/github/controllers/TaxSettingsController.php"
click node_tax_model "https://github.com/technodweep/gst-invoice/blob/github/models/TaxSettings.php"
click node_db_config "https://github.com/technodweep/gst-invoice/blob/github/config/db.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_entry,node_config,node_layout,node_site,node_user toneBlue
class node_orders,node_order_model,node_order_views,node_customers,node_customer_model,node_customer_views toneAmber
class node_products,node_product_model,node_product_views,node_settings,node_settings_model,node_tax,node_tax_model toneMint
class node_db_config,node_mysql toneRose
```

## Components

### Web application

- [Web entry](https://github.com/technodweep/gst-invoice/blob/github/web/index.php): `web/index.php`
- [App configuration](https://github.com/technodweep/gst-invoice/blob/github/config/web.php): `config/web.php`
- [Navigation layout](https://github.com/technodweep/gst-invoice/blob/github/views/layouts/main.php): `views/layouts/main.php`
- [Site and login](https://github.com/technodweep/gst-invoice/blob/github/controllers/SiteController.php): `controllers/SiteController.php`

### Billing records

- [Invoice workflow](https://github.com/technodweep/gst-invoice/blob/github/controllers/InvoiceOrderController.php): `controllers/InvoiceOrderController.php`
- [Invoice records](https://github.com/technodweep/gst-invoice/blob/github/models/InvoiceOrder.php): `models/InvoiceOrder.php`
- [Invoice screens](https://github.com/technodweep/gst-invoice/tree/github/views/invoice-order): `views/invoice-order`
- [Customer management](https://github.com/technodweep/gst-invoice/blob/github/controllers/CustomersController.php): `controllers/CustomersController.php`
- [Customer records](https://github.com/technodweep/gst-invoice/blob/github/models/Customers.php): `models/Customers.php`
- [Customer screens](https://github.com/technodweep/gst-invoice/tree/github/views/customers): `views/customers`

### Business data

- [Product management](https://github.com/technodweep/gst-invoice/blob/github/controllers/ProductsController.php): `controllers/ProductsController.php`
- [Product records](https://github.com/technodweep/gst-invoice/blob/github/models/Products.php): `models/Products.php`
- [Product screens](https://github.com/technodweep/gst-invoice/tree/github/views/products): `views/products`
- [Business settings](https://github.com/technodweep/gst-invoice/blob/github/controllers/SettingsController.php): `controllers/SettingsController.php`
- [Settings records](https://github.com/technodweep/gst-invoice/blob/github/models/Settings.php): `models/Settings.php`
- [Tax settings](https://github.com/technodweep/gst-invoice/blob/github/controllers/TaxSettingsController.php): `controllers/TaxSettingsController.php`
- [Tax records](https://github.com/technodweep/gst-invoice/blob/github/models/TaxSettings.php): `models/TaxSettings.php`

### Persistence

- [Database connection](https://github.com/technodweep/gst-invoice/blob/github/config/db.php): `config/db.php`
- **MySQL database**

### Other components

- **Business user**

## Connections

- Business user → Web entry: opens app (evidence: `web/index.php`)
- Web entry → App configuration: loads config (evidence: `web/index.php`)
- App configuration → Database connection: loads connection (evidence: `config/web.php`)
- Navigation layout → Invoice workflow: links orders (evidence: `views/layouts/main.php`)
- Navigation layout → Product management: links products (evidence: `views/layouts/main.php`)
- Navigation layout → Customer management: links customers (evidence: `views/layouts/main.php`)
- Navigation layout → Business settings: links settings (evidence: `views/layouts/main.php`)
- Navigation layout → Tax settings: links tax settings (evidence: `views/layouts/main.php`)
- Invoice workflow → Invoice records: loads and saves (evidence: `controllers/InvoiceOrderController.php`)
- Invoice workflow → Settings records: reads settings (evidence: `controllers/InvoiceOrderController.php`)
- Invoice workflow → Tax records: reads tax rates (evidence: `controllers/InvoiceOrderController.php`)
- Customer management → Customer records: loads and saves (evidence: `controllers/CustomersController.php`)
- Customer management → Customer screens: renders screens (evidence: `controllers/CustomersController.php`)
- Product management → Product records: loads and saves (evidence: `controllers/ProductsController.php`)
- Business settings → Settings records: loads and saves (evidence: `controllers/SettingsController.php`)
- Tax settings → Tax records: loads and saves (evidence: `controllers/TaxSettingsController.php`)
- Database connection → MySQL database: connects to (evidence: `README.md`)
- Invoice records → MySQL database: persists records
- Customer records → MySQL database: persists records
- Product records → MySQL database: persists records
- Invoice screens → Invoice workflow: serves invoice UI
- Product screens → Product management: serves product UI
- Site and login → Business user: authenticates
