# hanselt/cotizaciones architecture

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

- Interactive diagram: https://gitdiagram.com/hanselt/cotizaciones
- Repository: https://github.com/hanselt/cotizaciones
- Video tour (about a minute): https://gitdiagram.com/hanselt/cotizaciones/video

## Overview

Cotizaciones is a small browser-based quotation generator. The user enters client details and line items; the app calculates each line total plus subtotal, 18% IGV, and total, then overlays the quote data onto the supplied PDF template and downloads the result. The sampled JavaScript supports these workflow links; the HTML and styling files are present in the tree, but their contents were not sampled.

Main entry points: [`script.js`](https://github.com/hanselt/cotizaciones/blob/main/script.js) (PDF generator), [`index.html`](https://github.com/hanselt/cotizaciones/blob/main/index.html) (Quote form), [`cotizacion.pdf`](https://github.com/hanselt/cotizaciones/blob/main/cotizacion.pdf) (PDF template)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Quote entry"]
  node_form["Quote form<br/>[index.html]"]
  node_editor["Line-item editor<br/>[script.js]"]
end

subgraph group_totals["Quote totals"]
  node_calculator["Totals calculator<br/>[script.js]"]
end

subgraph group_pdf["PDF generation"]
  node_template["PDF template<br/>[cotizacion.pdf]"]
  node_generator["PDF generator<br/>[script.js]"]
  node_pdflib["PDFLib"]
  node_download["Downloaded quote"]
end

node_user(("User"))

node_user -->|"enters details"| node_form
node_form -->|"captures items"| node_editor
node_editor -->|"updates totals"| node_calculator
node_user -->|"requests PDF"| node_generator
node_generator -->|"reads quote data"| node_form
node_generator -->|"fetches template"| node_template
node_generator -->|"loads and edits"| node_pdflib
node_generator -->|"downloads PDF"| node_download

click node_form "https://github.com/hanselt/cotizaciones/blob/main/index.html"
click node_editor "https://github.com/hanselt/cotizaciones/blob/main/script.js"
click node_calculator "https://github.com/hanselt/cotizaciones/blob/main/script.js"
click node_template "https://github.com/hanselt/cotizaciones/blob/main/cotizacion.pdf"
click node_generator "https://github.com/hanselt/cotizaciones/blob/main/script.js"

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_form,node_editor,node_user toneBlue
class node_calculator toneAmber
class node_template,node_generator,node_pdflib,node_download toneMint
```

## Components

### Quote entry

- [Quote form](https://github.com/hanselt/cotizaciones/blob/main/index.html): `index.html`
- [Line-item editor](https://github.com/hanselt/cotizaciones/blob/main/script.js): `script.js`

### Quote totals

- [Totals calculator](https://github.com/hanselt/cotizaciones/blob/main/script.js): `script.js`

### PDF generation

- [PDF template](https://github.com/hanselt/cotizaciones/blob/main/cotizacion.pdf): `cotizacion.pdf`
- [PDF generator](https://github.com/hanselt/cotizaciones/blob/main/script.js): `script.js`
- **PDFLib**
- **Downloaded quote**

### Other components

- **User**

## Connections

- User → Quote form: enters details
- Quote form → Line-item editor: captures items
- Line-item editor → Totals calculator: updates totals
- User → PDF generator: requests PDF
- PDF generator → Quote form: reads quote data
- PDF generator → PDF template: fetches template
- PDF generator → PDFLib: loads and edits
- PDF generator → Downloaded quote: downloads PDF
