# nayana-m12/reconcilr architecture

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

- Interactive diagram: https://gitdiagram.com/nayana-m12/reconcilr
- Repository: https://github.com/nayana-m12/reconcilr

## Overview

Reconcilr is an accounts-payable reconciliation product: users import or extract financial records, match invoices against purchase orders and payments, review exceptions and AI suggestions, and investigate or resolve cases. The graph includes the frontend entry point, backend routing, domain processing, and persistence/audit layers. Some frontend-to-backend wiring and unsampled API behavior are shown only as unverified; edges otherwise reflect cited imports, calls, or documented routing.

Main entry points: [`frontend/src/App.tsx`](https://github.com/nayana-m12/reconcilr/blob/main/frontend/src/App.tsx) (Reconciliation UI), [`backend/app/main.py`](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/main.py) (API application), [`backend/app/agent/investigate.py`](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/agent/investigate.py) (Case investigation), [`backend/app/api/auth.py`](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/api/auth.py) (Login routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interface"]
  node_web["Reconciliation UI<br/>[App.tsx]"]
  node_clientapi["API client<br/>[api.ts]"]
end

subgraph group_entry["API and identity"]
  node_router["API application<br/>[main.py]"]
  node_authroutes["Login routes<br/>[auth.py]"]
  node_auth["Authentication<br/>[auth.py]"]
end

subgraph group_records["Record processing"]
  node_documents["Document intake<br/>[documents.py]"]
  node_extractor["Document extraction<br/>[extractor.py]"]
  node_importer["Record import<br/>[importer.py]"]
  node_matching["Invoice matching<br/>[engine.py]"]
  node_matchrules["Match strategies<br/>[common.py]"]
end

subgraph group_review["Review and resolution"]
  node_exceptions["Exception detection<br/>[engine.py]"]
  node_detectors["Exception detectors<br/>[detectors.py]"]
  node_suggestions["AI suggestions<br/>[suggestions.py]"]
  node_investigation["Case investigation<br/>[investigate.py]"]
  node_solutions["Resolution planning<br/>[solutions.py]"]
  node_verifier["Action verification<br/>[verifier.py]"]
  node_adjustments["Adjustments and approvals<br/>[adjustments.py]"]
end

subgraph group_foundation["Persistence and audit"]
  node_database[("Database session<br/>[database.py]")]
  node_entities[("Finance records<br/>[entities.py]")]
  node_audit["Audit logging<br/>[audit.py]"]
  node_privacy["Audit redaction<br/>[privacy.py]"]
end

node_user(("Finance user"))

node_user -->|"uses"| node_web
node_web -->|"requests"| node_clientapi
node_clientapi -.->|"calls API"| node_router
node_router -->|"registers"| node_authroutes
node_router -->|"registers"| node_documents
node_router -->|"checks tokens"| node_auth
node_authroutes -->|"creates tokens"| node_auth
node_documents -->|"extracts files"| node_extractor
node_documents -->|"imports records"| node_importer
node_matching -->|"uses strategies"| node_matchrules
node_exceptions -->|"gets findings"| node_detectors
node_investigation -->|"requests plan"| node_solutions
node_investigation -->|"verifies actions"| node_verifier
node_investigation -->|"records activity"| node_audit
node_audit -->|"redacts data"| node_privacy
node_authroutes -->|"records activity"| node_audit
node_database -->|"maps records"| node_entities
node_web -.->|"reviews suggestions"| node_suggestions
node_web -.->|"reviews adjustments"| node_adjustments

click node_web "https://github.com/nayana-m12/reconcilr/blob/main/frontend/src/App.tsx"
click node_clientapi "https://github.com/nayana-m12/reconcilr/blob/main/frontend/src/api.ts"
click node_router "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/main.py"
click node_authroutes "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/api/auth.py"
click node_auth "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/auth.py"
click node_documents "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/api/documents.py"
click node_extractor "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/services/extractor.py"
click node_importer "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/services/importer.py"
click node_matching "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/services/matching/engine.py"
click node_matchrules "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/services/matching/common.py"
click node_exceptions "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/services/exceptions/engine.py"
click node_detectors "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/services/exceptions/detectors.py"
click node_suggestions "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/ai/suggestions.py"
click node_investigation "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/agent/investigate.py"
click node_solutions "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/agent/solutions.py"
click node_verifier "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/agent/verifier.py"
click node_adjustments "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/services/adjustments.py"
click node_database "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/database.py"
click node_entities "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/models/entities.py"
click node_audit "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/services/audit.py"
click node_privacy "https://github.com/nayana-m12/reconcilr/blob/main/backend/app/services/privacy.py"

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_web,node_clientapi,node_user toneBlue
class node_router,node_authroutes,node_auth toneAmber
class node_documents,node_extractor,node_importer,node_matching,node_matchrules toneMint
class node_exceptions,node_detectors,node_suggestions,node_investigation,node_solutions,node_verifier,node_adjustments toneRose
class node_database,node_entities,node_audit,node_privacy toneIndigo
```

## Components

### User interface

- [Reconciliation UI](https://github.com/nayana-m12/reconcilr/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API client](https://github.com/nayana-m12/reconcilr/blob/main/frontend/src/api.ts): `frontend/src/api.ts`

### API and identity

- [API application](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/main.py): `backend/app/main.py`
- [Login routes](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/api/auth.py): `backend/app/api/auth.py`
- [Authentication](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/auth.py): `backend/app/auth.py`

### Record processing

- [Document intake](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/api/documents.py): `backend/app/api/documents.py`
- [Document extraction](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/services/extractor.py): `backend/app/services/extractor.py`
- [Record import](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/services/importer.py): `backend/app/services/importer.py`
- [Invoice matching](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/services/matching/engine.py): `backend/app/services/matching/engine.py`
- [Match strategies](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/services/matching/common.py): `backend/app/services/matching/common.py`

### Review and resolution

- [Exception detection](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/services/exceptions/engine.py): `backend/app/services/exceptions/engine.py`
- [Exception detectors](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/services/exceptions/detectors.py): `backend/app/services/exceptions/detectors.py`
- [AI suggestions](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/ai/suggestions.py): `backend/app/ai/suggestions.py`
- [Case investigation](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/agent/investigate.py): `backend/app/agent/investigate.py`
- [Resolution planning](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/agent/solutions.py): `backend/app/agent/solutions.py`
- [Action verification](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/agent/verifier.py): `backend/app/agent/verifier.py`
- [Adjustments and approvals](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/services/adjustments.py): `backend/app/services/adjustments.py`

### Persistence and audit

- [Database session](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/database.py): `backend/app/database.py`
- [Finance records](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/models/entities.py): `backend/app/models/entities.py`
- [Audit logging](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/services/audit.py): `backend/app/services/audit.py`
- [Audit redaction](https://github.com/nayana-m12/reconcilr/blob/main/backend/app/services/privacy.py): `backend/app/services/privacy.py`

### Other components

- **Finance user**

## Connections

- Finance user → Reconciliation UI: uses (evidence: `frontend/src/App.tsx`)
- Reconciliation UI → API client: requests (evidence: `frontend/src/App.tsx`)
- API client → API application: calls API
- API application → Login routes: registers (evidence: `backend/app/main.py`)
- API application → Document intake: registers (evidence: `backend/app/main.py`)
- API application → Authentication: checks tokens (evidence: `backend/app/main.py`)
- Login routes → Authentication: creates tokens (evidence: `backend/app/api/auth.py`)
- Document intake → Document extraction: extracts files (evidence: `backend/app/api/documents.py`)
- Document intake → Record import: imports records (evidence: `backend/app/api/documents.py`)
- Invoice matching → Match strategies: uses strategies (evidence: `backend/app/services/matching/engine.py`)
- Exception detection → Exception detectors: gets findings (evidence: `backend/app/services/exceptions/engine.py`)
- Case investigation → Resolution planning: requests plan (evidence: `backend/app/agent/investigate.py`)
- Case investigation → Action verification: verifies actions (evidence: `backend/app/agent/investigate.py`)
- Case investigation → Audit logging: records activity (evidence: `backend/app/agent/investigate.py`)
- Audit logging → Audit redaction: redacts data (evidence: `backend/app/services/audit.py`)
- Login routes → Audit logging: records activity (evidence: `backend/app/api/auth.py`)
- Database session → Finance records: maps records (evidence: `backend/app/models/entities.py`)
- Reconciliation UI → AI suggestions: reviews suggestions
- Reconciliation UI → Adjustments and approvals: reviews adjustments
