# syedrahaman92/qsoftware architecture

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

- Interactive diagram: https://gitdiagram.com/syedrahaman92/qsoftware
- Repository: https://github.com/syedrahaman92/qsoftware

## Overview

Qsoftware is an admin web application for maintaining customers and stock, creating and editing quotations/proformas, and printing saved quotations. The main workflow is to sign in, manage customer and product records, compose a quotation, save it, and open its print view. The graph includes the shared bootstrap and database helpers. Some page-to-page relationships are documented by excerpts or the README; unsampled page internals are not assumed.

Main entry points: [`includes/common_function.php`](https://github.com/syedrahaman92/qsoftware/blob/master/includes/common_function.php) (Database helpers and mail), [`includes/main_init.php`](https://github.com/syedrahaman92/qsoftware/blob/master/includes/main_init.php) (Application bootstrap), [`add_quotation.php`](https://github.com/syedrahaman92/qsoftware/blob/master/add_quotation.php) (Quotation creation), [`add_customer.php`](https://github.com/syedrahaman92/qsoftware/blob/master/add_customer.php) (Customer create/edit)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_login["Sign-in and recovery<br/>[index.php]"]
  node_home["Home<br/>[home.php]"]
  node_navigation["Admin navigation<br/>[side_bar.php]"]
end

subgraph group_records["Customer and product records"]
  node_customer_edit["Customer create/edit<br/>[add_customer.php]"]
  node_customer_update["Customer editing<br/>[edit_customer.php]"]
  node_customer_list["Customer listing<br/>[list_customer.php]"]
  node_product_edit["Product create/edit<br/>[add_product.php]"]
  node_product_update["Product editing<br/>[edit_product.php]"]
  node_product_list["Product listing<br/>[list_product.php]"]
  node_company_ajax["Company lookup<br/>[company_ajax.php]"]
  node_autocomplete["Autocomplete lookup<br/>[autocomplete.php]"]
  node_detail_ajax["Product detail lookup<br/>[detail_ajax.php]"]
end

subgraph group_quotes["Quotation workflow"]
  node_quotation_create["Quotation creation<br/>[add_quotation.php]"]
  node_quotation_edit["Quotation editing<br/>[edit_quotation.php]"]
  node_quotation_list["Quotation listing<br/>[list_quotation.php]"]
  node_print["Quotation print view<br/>[print_page.php]"]
end

subgraph group_runtime["Shared runtime"]
  node_bootstrap["Application bootstrap<br/>[main_init.php]"]
  node_csrf["CSRF tokens<br/>[CsrfToken.php]"]
  node_common["Database helpers and mail"]
  node_connection["Database connection<br/>[dbconnection.php]"]
  node_configuration["Database configuration<br/>[config.php]"]
  node_mailer["SMTP mail transport"]
  node_smtp["SMTP protocol client<br/>[class.smtp.php]"]
end

node_admin(("Administrator"))
node_database[("MySQL database")]

node_admin -->|"signs in"| node_login
node_login -->|"initializes"| node_bootstrap
node_admin -.->|"manages records"| node_customer_edit
node_admin -.->|"manages stock"| node_product_edit
node_admin -->|"creates quotation"| node_quotation_create
node_quotation_create -->|"requests company"| node_company_ajax
node_quotation_edit -->|"requests company"| node_company_ajax
node_quotation_create -->|"requests suggestions"| node_autocomplete
node_quotation_edit -->|"requests suggestions"| node_autocomplete
node_customer_edit -->|"requests suggestions"| node_autocomplete
node_customer_edit -->|"requests product details"| node_detail_ajax
node_customer_update -->|"requests product details"| node_detail_ajax
node_quotation_create -->|"redirects after save"| node_print
node_admin -.->|"prints saved quote"| node_print
node_customer_edit -.->|"uses persistence helpers"| node_common
node_customer_update -.->|"uses persistence helpers"| node_common
node_quotation_create -->|"uses persistence helpers"| node_common
node_quotation_edit -->|"uses persistence helpers"| node_common
node_bootstrap -->|"connects database"| node_connection
node_bootstrap -->|"loads helpers"| node_common
node_bootstrap -->|"loads tokens"| node_csrf
node_bootstrap -->|"loads mailer"| node_mailer
node_bootstrap -->|"loads SMTP client"| node_smtp
node_connection -->|"loads settings"| node_configuration
node_connection -->|"opens connection"| node_database
node_common -->|"queries records"| node_database
node_common -->|"sends email"| node_mailer
node_mailer -->|"uses transport"| node_smtp
node_admin -.->|"views customers"| node_customer_list
node_admin -.->|"views products"| node_product_list
node_admin -.->|"views quotations"| node_quotation_list

click node_login "https://github.com/syedrahaman92/qsoftware/blob/master/index.php"
click node_home "https://github.com/syedrahaman92/qsoftware/blob/master/home.php"
click node_navigation "https://github.com/syedrahaman92/qsoftware/blob/master/side_bar.php"
click node_customer_edit "https://github.com/syedrahaman92/qsoftware/blob/master/add_customer.php"
click node_customer_update "https://github.com/syedrahaman92/qsoftware/blob/master/edit_customer.php"
click node_customer_list "https://github.com/syedrahaman92/qsoftware/blob/master/list_customer.php"
click node_product_edit "https://github.com/syedrahaman92/qsoftware/blob/master/add_product.php"
click node_product_update "https://github.com/syedrahaman92/qsoftware/blob/master/edit_product.php"
click node_product_list "https://github.com/syedrahaman92/qsoftware/blob/master/list_product.php"
click node_quotation_create "https://github.com/syedrahaman92/qsoftware/blob/master/add_quotation.php"
click node_quotation_edit "https://github.com/syedrahaman92/qsoftware/blob/master/edit_quotation.php"
click node_quotation_list "https://github.com/syedrahaman92/qsoftware/blob/master/list_quotation.php"
click node_print "https://github.com/syedrahaman92/qsoftware/blob/master/print_page.php"
click node_company_ajax "https://github.com/syedrahaman92/qsoftware/blob/master/company_ajax.php"
click node_autocomplete "https://github.com/syedrahaman92/qsoftware/blob/master/autocomplete.php"
click node_detail_ajax "https://github.com/syedrahaman92/qsoftware/blob/master/detail_ajax.php"
click node_bootstrap "https://github.com/syedrahaman92/qsoftware/blob/master/includes/main_init.php"
click node_csrf "https://github.com/syedrahaman92/qsoftware/blob/master/includes/CsrfToken.php"
click node_common "https://github.com/syedrahaman92/qsoftware/blob/master/includes/common_function.php"
click node_connection "https://github.com/syedrahaman92/qsoftware/blob/master/includes/dbconnection.php"
click node_configuration "https://github.com/syedrahaman92/qsoftware/blob/master/includes/config.php"
click node_mailer "https://github.com/syedrahaman92/qsoftware/blob/master/includes/smtp/class.phpmailer.php"
click node_smtp "https://github.com/syedrahaman92/qsoftware/blob/master/includes/smtp/class.smtp.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_login,node_home,node_navigation toneBlue
class node_customer_edit,node_customer_update,node_customer_list,node_product_edit,node_product_update,node_product_list,node_company_ajax,node_autocomplete,node_detail_ajax,node_database toneAmber
class node_quotation_create,node_quotation_edit,node_quotation_list,node_print toneMint
class node_bootstrap,node_csrf,node_common,node_connection,node_configuration,node_mailer,node_smtp toneRose
class node_admin toneIndigo
```

## Components

### Access and navigation

- [Sign-in and recovery](https://github.com/syedrahaman92/qsoftware/blob/master/index.php): `index.php`
- [Home](https://github.com/syedrahaman92/qsoftware/blob/master/home.php): `home.php`
- [Admin navigation](https://github.com/syedrahaman92/qsoftware/blob/master/side_bar.php): `side_bar.php`

### Customer and product records

- [Customer create/edit](https://github.com/syedrahaman92/qsoftware/blob/master/add_customer.php): `add_customer.php`
- [Customer editing](https://github.com/syedrahaman92/qsoftware/blob/master/edit_customer.php): `edit_customer.php`
- [Customer listing](https://github.com/syedrahaman92/qsoftware/blob/master/list_customer.php): `list_customer.php`
- [Product create/edit](https://github.com/syedrahaman92/qsoftware/blob/master/add_product.php): `add_product.php`
- [Product editing](https://github.com/syedrahaman92/qsoftware/blob/master/edit_product.php): `edit_product.php`
- [Product listing](https://github.com/syedrahaman92/qsoftware/blob/master/list_product.php): `list_product.php`
- [Company lookup](https://github.com/syedrahaman92/qsoftware/blob/master/company_ajax.php): `company_ajax.php`
- [Autocomplete lookup](https://github.com/syedrahaman92/qsoftware/blob/master/autocomplete.php): `autocomplete.php`
- [Product detail lookup](https://github.com/syedrahaman92/qsoftware/blob/master/detail_ajax.php): `detail_ajax.php`

### Quotation workflow

- [Quotation creation](https://github.com/syedrahaman92/qsoftware/blob/master/add_quotation.php): `add_quotation.php`
- [Quotation editing](https://github.com/syedrahaman92/qsoftware/blob/master/edit_quotation.php): `edit_quotation.php`
- [Quotation listing](https://github.com/syedrahaman92/qsoftware/blob/master/list_quotation.php): `list_quotation.php`
- [Quotation print view](https://github.com/syedrahaman92/qsoftware/blob/master/print_page.php): `print_page.php`

### Shared runtime

- [Application bootstrap](https://github.com/syedrahaman92/qsoftware/blob/master/includes/main_init.php): `includes/main_init.php`
- [CSRF tokens](https://github.com/syedrahaman92/qsoftware/blob/master/includes/CsrfToken.php): `includes/CsrfToken.php`
- [Database helpers and mail](https://github.com/syedrahaman92/qsoftware/blob/master/includes/common_function.php): `includes/common_function.php`
- [Database connection](https://github.com/syedrahaman92/qsoftware/blob/master/includes/dbconnection.php): `includes/dbconnection.php`
- [Database configuration](https://github.com/syedrahaman92/qsoftware/blob/master/includes/config.php): `includes/config.php`
- [SMTP mail transport](https://github.com/syedrahaman92/qsoftware/blob/master/includes/smtp/class.phpmailer.php): `includes/smtp/class.phpmailer.php`
- [SMTP protocol client](https://github.com/syedrahaman92/qsoftware/blob/master/includes/smtp/class.smtp.php): `includes/smtp/class.smtp.php`

### Other components

- **Administrator**
- **MySQL database**

## Connections

- Administrator → Sign-in and recovery: signs in (evidence: `index.php`)
- Sign-in and recovery → Application bootstrap: initializes (evidence: `index.php`)
- Administrator → Customer create/edit: manages records
- Administrator → Product create/edit: manages stock
- Administrator → Quotation creation: creates quotation
- Quotation creation → Company lookup: requests company (evidence: `add_quotation.php`)
- Quotation editing → Company lookup: requests company (evidence: `edit_quotation.php`)
- Quotation creation → Autocomplete lookup: requests suggestions (evidence: `add_quotation.php`)
- Quotation editing → Autocomplete lookup: requests suggestions (evidence: `edit_quotation.php`)
- Customer create/edit → Autocomplete lookup: requests suggestions (evidence: `add_customer.php`)
- Customer create/edit → Product detail lookup: requests product details (evidence: `add_customer.php`)
- Customer editing → Product detail lookup: requests product details (evidence: `edit_customer.php`)
- Quotation creation → Quotation print view: redirects after save (evidence: `add_quotation.php`)
- Administrator → Quotation print view: prints saved quote
- Customer create/edit → Database helpers and mail: uses persistence helpers
- Customer editing → Database helpers and mail: uses persistence helpers
- Quotation creation → Database helpers and mail: uses persistence helpers (evidence: `add_quotation.php`)
- Quotation editing → Database helpers and mail: uses persistence helpers (evidence: `edit_quotation.php`)
- Application bootstrap → Database connection: connects database (evidence: `includes/main_init.php`)
- Application bootstrap → Database helpers and mail: loads helpers (evidence: `includes/main_init.php`)
- Application bootstrap → CSRF tokens: loads tokens (evidence: `includes/main_init.php`)
- Application bootstrap → SMTP mail transport: loads mailer (evidence: `includes/main_init.php`)
- Application bootstrap → SMTP protocol client: loads SMTP client (evidence: `includes/main_init.php`)
- Database connection → Database configuration: loads settings (evidence: `includes/dbconnection.php`)
- Database connection → MySQL database: opens connection (evidence: `includes/dbconnection.php`)
- Database helpers and mail → MySQL database: queries records (evidence: `includes/common_function.php`)
- Database helpers and mail → SMTP mail transport: sends email (evidence: `includes/common_function.php`)
- SMTP mail transport → SMTP protocol client: uses transport (evidence: `includes/smtp/class.phpmailer.php`)
- Administrator → Customer listing: views customers
- Administrator → Product listing: views products
- Administrator → Quotation listing: views quotations
