# fadilsnt/inv-quo-python architecture

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

- Interactive diagram: https://gitdiagram.com/fadilsnt/inv-quo-python
- Repository: https://github.com/fadilsnt/inv-quo-python

## Overview

This desktop invoice and quotation generator accepts data through either a command-line or Tkinter interface, calculates item totals, creates a watermarked PDF, and records invoice data in MySQL. The GUI also supports reviewing, editing, and deleting saved invoices. The excerpts show CLI calls and database access directly; GUI generation calls are not shown, so those links are documented at the product level rather than inferred from imports.

Main entry points: [`GUI_app.py`](https://github.com/fadilsnt/inv-quo-python/blob/main/GUI_app.py) (GUI interface), [`CLI_main.py`](https://github.com/fadilsnt/inv-quo-python/blob/main/CLI_main.py) (CLI interface), [`invoice_generator.py`](https://github.com/fadilsnt/inv-quo-python/blob/main/invoice_generator.py) (PDF generation), [`db_connect.py`](https://github.com/fadilsnt/inv-quo-python/blob/main/db_connect.py) (MySQL connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI interface<br/>[CLI_main.py]"]
  node_gui["GUI interface<br/>[GUI_app.py]"]
  node_cli_input["CLI data entry<br/>[input_collect.py]"]
  node_gui_manager["Invoice manager<br/>[invoice_manager.py]"]
end

subgraph group_invoice_work["Invoice workflow"]
  node_calculation["Totals calculation<br/>[GUI_app.py]"]
  node_pdf_generation["PDF generation"]
end

subgraph group_records["Invoice records"]
  node_invoice_persistence["Invoice persistence"]
  node_record_management["Record queries and edits<br/>[invoice_manager.py]"]
  node_db_connection["MySQL connection<br/>[db_connect.py]"]
  node_mysql[("MySQL database")]
  node_schema["Invoice schema<br/>[invoice_system.sql]"]
end

subgraph group_outputs["Generated files"]
  node_pdf_files["Saved PDFs"]
end

node_user(("User"))

node_user -->|"enters data"| node_cli
node_user -->|"enters data"| node_gui
node_cli -->|"collects data"| node_cli_input
node_cli -->|"generates PDF"| node_pdf_generation
node_cli -->|"saves record"| node_invoice_persistence
node_gui -->|"opens manager"| node_gui_manager
node_gui -.->|"calculates totals"| node_calculation
node_gui -.->|"generates PDF"| node_pdf_generation
node_gui -.->|"saves record"| node_invoice_persistence
node_gui_manager -->|"manages invoices"| node_record_management
node_record_management -->|"queries database"| node_db_connection
node_invoice_persistence -->|"opens connection"| node_db_connection
node_db_connection -->|"connects to"| node_mysql
node_schema -->|"defines tables"| node_mysql
node_pdf_generation -->|"writes PDF"| node_pdf_files

click node_cli "https://github.com/fadilsnt/inv-quo-python/blob/main/CLI_main.py"
click node_gui "https://github.com/fadilsnt/inv-quo-python/blob/main/GUI_app.py"
click node_cli_input "https://github.com/fadilsnt/inv-quo-python/blob/main/input_collect.py"
click node_gui_manager "https://github.com/fadilsnt/inv-quo-python/blob/main/invoice_manager.py"
click node_calculation "https://github.com/fadilsnt/inv-quo-python/blob/main/GUI_app.py"
click node_pdf_generation "https://github.com/fadilsnt/inv-quo-python/blob/main/invoice_generator.py"
click node_invoice_persistence "https://github.com/fadilsnt/inv-quo-python/blob/main/invoice_generator.py"
click node_record_management "https://github.com/fadilsnt/inv-quo-python/blob/main/invoice_manager.py"
click node_db_connection "https://github.com/fadilsnt/inv-quo-python/blob/main/db_connect.py"
click node_schema "https://github.com/fadilsnt/inv-quo-python/blob/main/invoice_system.sql"
click node_pdf_files "https://github.com/fadilsnt/inv-quo-python/tree/main/invoices"

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_cli,node_gui,node_cli_input,node_gui_manager,node_user toneBlue
class node_calculation,node_pdf_generation toneAmber
class node_invoice_persistence,node_record_management,node_db_connection,node_mysql,node_schema toneMint
class node_pdf_files toneRose
```

## Components

### User interfaces

- [CLI interface](https://github.com/fadilsnt/inv-quo-python/blob/main/CLI_main.py): `CLI_main.py`
- [GUI interface](https://github.com/fadilsnt/inv-quo-python/blob/main/GUI_app.py): `GUI_app.py`
- [CLI data entry](https://github.com/fadilsnt/inv-quo-python/blob/main/input_collect.py): `input_collect.py`
- [Invoice manager](https://github.com/fadilsnt/inv-quo-python/blob/main/invoice_manager.py): `invoice_manager.py`

### Invoice workflow

- [Totals calculation](https://github.com/fadilsnt/inv-quo-python/blob/main/GUI_app.py): `GUI_app.py`
- [PDF generation](https://github.com/fadilsnt/inv-quo-python/blob/main/invoice_generator.py): `invoice_generator.py`

### Invoice records

- [Invoice persistence](https://github.com/fadilsnt/inv-quo-python/blob/main/invoice_generator.py): `invoice_generator.py`
- [Record queries and edits](https://github.com/fadilsnt/inv-quo-python/blob/main/invoice_manager.py): `invoice_manager.py`
- [MySQL connection](https://github.com/fadilsnt/inv-quo-python/blob/main/db_connect.py): `db_connect.py`
- **MySQL database**
- [Invoice schema](https://github.com/fadilsnt/inv-quo-python/blob/main/invoice_system.sql): `invoice_system.sql`

### Generated files

- [Saved PDFs](https://github.com/fadilsnt/inv-quo-python/tree/main/invoices): `invoices`

### Other components

- **User**

## Connections

- User → CLI interface: enters data (evidence: `README.md`)
- User → GUI interface: enters data (evidence: `README.md`)
- CLI interface → CLI data entry: collects data (evidence: `CLI_main.py`)
- CLI interface → PDF generation: generates PDF (evidence: `CLI_main.py`)
- CLI interface → Invoice persistence: saves record (evidence: `CLI_main.py`)
- GUI interface → Invoice manager: opens manager (evidence: `GUI_app.py`)
- GUI interface → Totals calculation: calculates totals (evidence: `GUI_app.py`)
- GUI interface → PDF generation: generates PDF (evidence: `GUI_app.py`)
- GUI interface → Invoice persistence: saves record (evidence: `GUI_app.py`)
- Invoice manager → Record queries and edits: manages invoices (evidence: `invoice_manager.py`)
- Record queries and edits → MySQL connection: queries database (evidence: `invoice_manager.py`)
- Invoice persistence → MySQL connection: opens connection (evidence: `invoice_generator.py`)
- MySQL connection → MySQL database: connects to (evidence: `db_connect.py`)
- Invoice schema → MySQL database: defines tables (evidence: `README.md`)
- PDF generation → Saved PDFs: writes PDF (evidence: `README.md`)
