# jaybeloc/joc-pdf-to-excel architecture

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

- Interactive diagram: https://gitdiagram.com/jaybeloc/joc-pdf-to-excel
- Repository: https://github.com/jaybeloc/joc-pdf-to-excel

## Overview

Jaybel PDF → Excel is an offline, browser-only converter for customer statements and tax invoices. Users choose a document type, add up to ten PDFs, convert each to a corresponding Excel workbook, and download files individually or as a ZIP. The main path runs through the UI batch controller, PDF text extraction and document-specific parsing, then workbook generation and download handling. The README documents three invoice layouts, statement ageing and payment details, line-item total checks, and local-only processing; these are represented without assuming unshown parser internals.

Main entry points: [`app.js`](https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/app.js) (Batch and downloads), [`index.html`](https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/index.html) (Conversion interface), [`src/excel.js`](https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/src/excel.js) (Statement workbook), [`src/core.js`](https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/src/core.js) (PDF text extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Browser workflow"]
  node_interface["Conversion interface<br/>[index.html]"]
  node_batch["Batch and downloads<br/>[app.js]"]
end

subgraph group_parse["PDF interpretation"]
  node_pdf["PDF text extraction<br/>[core.js]"]
  node_kind["Document detection<br/>[core.js]"]
  node_statement["Statement parsing<br/>[core.js]"]
  node_invoice["Invoice parsing<br/>[core.js]"]
end

subgraph group_output["Excel output"]
  node_stmtbook["Statement workbook<br/>[excel.js]"]
  node_invbook["Invoice workbook<br/>[excel.js]"]
end

node_user(("User"))
node_files["PDF files"]
node_result["XLSX files"]
node_zip["ZIP archive"]

node_user -->|"chooses and adds"| node_interface
node_interface -->|"submits files"| node_batch
node_files -->|"provides PDFs"| node_batch
node_batch -->|"extracts lines"| node_pdf
node_batch -->|"detects type"| node_kind
node_batch -->|"parses statements"| node_statement
node_batch -->|"parses invoices"| node_invoice
node_batch -->|"builds workbook"| node_stmtbook
node_batch -->|"builds workbook"| node_invbook
node_stmtbook -->|"writes statement XLSX"| node_result
node_invbook -->|"writes invoice XLSX"| node_result
node_batch -->|"packages outputs"| node_zip
node_batch -->|"offers downloads"| node_user

click node_interface "https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/index.html"
click node_batch "https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/app.js"
click node_pdf "https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/src/core.js"
click node_kind "https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/src/core.js"
click node_statement "https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/src/core.js"
click node_invoice "https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/src/core.js"
click node_stmtbook "https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/src/excel.js"
click node_invbook "https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/src/excel.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_interface,node_batch,node_user toneBlue
class node_pdf,node_kind,node_statement,node_invoice toneAmber
class node_stmtbook,node_invbook toneMint
class node_files,node_result,node_zip toneIndigo
```

## Components

### Browser workflow

- [Conversion interface](https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/index.html): `index.html`
- [Batch and downloads](https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/app.js): `app.js`

### PDF interpretation

- [PDF text extraction](https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/src/core.js): `src/core.js`
- [Document detection](https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/src/core.js): `src/core.js`
- [Statement parsing](https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/src/core.js): `src/core.js`
- [Invoice parsing](https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/src/core.js): `src/core.js`

### Excel output

- [Statement workbook](https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/src/excel.js): `src/excel.js`
- [Invoice workbook](https://github.com/jaybeloc/joc-pdf-to-excel/blob/main/src/excel.js): `src/excel.js`

### Other components

- **User**
- **PDF files**
- **XLSX files**
- **ZIP archive**

## Connections

- User → Conversion interface: chooses and adds (evidence: `README.md`)
- Conversion interface → Batch and downloads: submits files (evidence: `app.js`)
- PDF files → Batch and downloads: provides PDFs (evidence: `app.js`)
- Batch and downloads → PDF text extraction: extracts lines (evidence: `app.js`)
- Batch and downloads → Document detection: detects type (evidence: `app.js`)
- Batch and downloads → Statement parsing: parses statements (evidence: `app.js`)
- Batch and downloads → Invoice parsing: parses invoices (evidence: `app.js`)
- Batch and downloads → Statement workbook: builds workbook (evidence: `app.js`)
- Batch and downloads → Invoice workbook: builds workbook (evidence: `app.js`)
- Statement workbook → XLSX files: writes statement XLSX (evidence: `src/excel.js`)
- Invoice workbook → XLSX files: writes invoice XLSX (evidence: `src/excel.js`)
- Batch and downloads → ZIP archive: packages outputs (evidence: `app.js`)
- Batch and downloads → User: offers downloads (evidence: `app.js`)
