# aathisankar7/invoicegen architecture

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

- Interactive diagram: https://gitdiagram.com/aathisankar7/invoicegen
- Repository: https://github.com/aathisankar7/invoicegen

## Overview

This is an interactive terminal GST invoice generator. A user enters a customer and ordered line items; the CLI looks up product tax metadata, computes invoice totals, prints a summary, and fills a PDF form for output. The runtime is concentrated in `main.py`, so several distinct workflow stages share that path. The README documents the catalog and PDF capabilities; relationships shown here are supported by the `main.py` excerpt or README.

Main entry points: [`main.py`](https://github.com/aathisankar7/invoicegen/blob/main/main.py) (Interactive CLI), [`products.json`](https://github.com/aathisankar7/invoicegen/blob/main/products.json) (Product catalog), [`template.pdf`](https://github.com/aathisankar7/invoicegen/blob/main/template.pdf) (AcroForm template)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_invoice_flow["Invoice workflow"]
  node_cli["Interactive CLI<br/>[main.py]"]
  node_customer_items["Customer and items<br/>[main.py]"]
  node_tax_calculation["Tax calculations<br/>[main.py]"]
  node_summary["Terminal summary<br/>[main.py]"]
end

subgraph group_catalog["Product catalog"]
  node_catalog_lookup["Catalog lookup<br/>[main.py]"]
  node_product_data[("Product catalog<br/>[products.json]")]
end

subgraph group_pdf_output["PDF output"]
  node_form_filler["PDF form filling<br/>[main.py]"]
  node_pdf_template["AcroForm template<br/>[template.pdf]"]
  node_invoice_pdf["Invoice PDF"]
end

node_user(("Invoice user"))

node_user -->|"starts"| node_cli
node_cli -->|"prompts for"| node_customer_items
node_cli -->|"loads catalog"| node_catalog_lookup
node_catalog_lookup -->|"reads"| node_product_data
node_cli -->|"computes totals"| node_tax_calculation
node_cli -->|"prints"| node_summary
node_cli -->|"fills form"| node_form_filler
node_form_filler -->|"reads template"| node_pdf_template
node_form_filler -->|"writes"| node_invoice_pdf

click node_cli "https://github.com/aathisankar7/invoicegen/blob/main/main.py"
click node_customer_items "https://github.com/aathisankar7/invoicegen/blob/main/main.py"
click node_tax_calculation "https://github.com/aathisankar7/invoicegen/blob/main/main.py"
click node_summary "https://github.com/aathisankar7/invoicegen/blob/main/main.py"
click node_catalog_lookup "https://github.com/aathisankar7/invoicegen/blob/main/main.py"
click node_product_data "https://github.com/aathisankar7/invoicegen/blob/main/products.json"
click node_form_filler "https://github.com/aathisankar7/invoicegen/blob/main/main.py"
click node_pdf_template "https://github.com/aathisankar7/invoicegen/blob/main/template.pdf"

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_customer_items,node_tax_calculation,node_summary,node_user toneBlue
class node_catalog_lookup,node_product_data toneAmber
class node_form_filler,node_pdf_template,node_invoice_pdf toneMint
```

## Components

### Invoice workflow

- [Interactive CLI](https://github.com/aathisankar7/invoicegen/blob/main/main.py): `main.py`
- [Customer and items](https://github.com/aathisankar7/invoicegen/blob/main/main.py): `main.py`
- [Tax calculations](https://github.com/aathisankar7/invoicegen/blob/main/main.py): `main.py`
- [Terminal summary](https://github.com/aathisankar7/invoicegen/blob/main/main.py): `main.py`

### Product catalog

- [Catalog lookup](https://github.com/aathisankar7/invoicegen/blob/main/main.py): `main.py`
- [Product catalog](https://github.com/aathisankar7/invoicegen/blob/main/products.json): `products.json`

### PDF output

- [PDF form filling](https://github.com/aathisankar7/invoicegen/blob/main/main.py): `main.py`
- [AcroForm template](https://github.com/aathisankar7/invoicegen/blob/main/template.pdf): `template.pdf`
- **Invoice PDF**

### Other components

- **Invoice user**

## Connections

- Invoice user → Interactive CLI: starts (evidence: `README.md`)
- Interactive CLI → Customer and items: prompts for (evidence: `main.py`)
- Interactive CLI → Catalog lookup: loads catalog (evidence: `main.py`)
- Catalog lookup → Product catalog: reads (evidence: `main.py`)
- Interactive CLI → Tax calculations: computes totals (evidence: `main.py`)
- Interactive CLI → Terminal summary: prints (evidence: `main.py`)
- Interactive CLI → PDF form filling: fills form (evidence: `main.py`)
- PDF form filling → AcroForm template: reads template (evidence: `main.py`)
- PDF form filling → Invoice PDF: writes (evidence: `main.py`)
