# ayushexploring/statement-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/ayushexploring/statement-analyzer
- Repository: https://github.com/ayushexploring/statement-analyzer

## Overview

This is a browser-based SBI statement analyzer. The user uploads a selectable-text PDF; the app extracts page text, parses transactions, classifies card payments, and presents summaries and transaction views with CSV export. Card matching rules are configurable. The excerpts show PDF.js usage and the parsing and classification logic, but omit some wiring in the app, so links to those processing modules are marked unverified.

Main entry points: [`js/app.js`](https://github.com/ayushexploring/statement-analyzer/blob/master/js/app.js) (Upload and report UI), [`js/parser.js`](https://github.com/ayushexploring/statement-analyzer/blob/master/js/parser.js) (Statement parser), [`js/classifier.js`](https://github.com/ayushexploring/statement-analyzer/blob/master/js/classifier.js) (Payment classifier), [`js/config.js`](https://github.com/ayushexploring/statement-analyzer/blob/master/js/config.js) (Card rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Browser application"]
  node_app["Upload and report UI<br/>[app.js]"]
  node_pdfjs["PDF.js"]
end

subgraph group_processing["Statement processing"]
  node_parser["Statement parser<br/>[parser.js]"]
  node_classifier["Payment classifier<br/>[classifier.js]"]
end

subgraph group_configuration["Card matching"]
  node_cardconfig["Card rules<br/>[config.js]"]
end

node_user(("Statement user"))

node_user -->|"uploads PDF"| node_app
node_app -->|"extracts text"| node_pdfjs
node_app -.->|"parses statement"| node_parser
node_app -.->|"classifies transactions"| node_classifier
node_app -.->|"loads card rules"| node_cardconfig

click node_app "https://github.com/ayushexploring/statement-analyzer/blob/master/js/app.js"
click node_parser "https://github.com/ayushexploring/statement-analyzer/blob/master/js/parser.js"
click node_classifier "https://github.com/ayushexploring/statement-analyzer/blob/master/js/classifier.js"
click node_cardconfig "https://github.com/ayushexploring/statement-analyzer/blob/master/js/config.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_app,node_pdfjs,node_user toneBlue
class node_parser,node_classifier toneAmber
class node_cardconfig toneMint
```

## Components

### Browser application

- [Upload and report UI](https://github.com/ayushexploring/statement-analyzer/blob/master/js/app.js): `js/app.js`
- **PDF.js**

### Statement processing

- [Statement parser](https://github.com/ayushexploring/statement-analyzer/blob/master/js/parser.js): `js/parser.js`
- [Payment classifier](https://github.com/ayushexploring/statement-analyzer/blob/master/js/classifier.js): `js/classifier.js`

### Card matching

- [Card rules](https://github.com/ayushexploring/statement-analyzer/blob/master/js/config.js): `js/config.js`

### Other components

- **Statement user**

## Connections

- Statement user → Upload and report UI: uploads PDF (evidence: `js/app.js`)
- Upload and report UI → PDF.js: extracts text (evidence: `js/app.js`)
- Upload and report UI → Statement parser: parses statement
- Upload and report UI → Payment classifier: classifies transactions
- Upload and report UI → Card rules: loads card rules
