# subbu6699/slowbooks-pro-2026 architecture

> Architecture diagram of the GitHub repository subbu6699/slowbooks-pro-2026, 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/subbu6699/slowbooks-pro-2026
- Repository: https://github.com/subbu6699/slowbooks-pro-2026

## Overview

Slowbooks Pro is a local-first bookkeeping and accounting application, usable from a desktop browser or as a multi-user server. The main user workflow runs from the browser interface through the local REST API to bookkeeping operations and stored records, with reports and exports presenting results. Major product branches include banking, payroll, nonprofit accounting, migration, and receipt OCR. The tree and README establish these capabilities; sampled source confirms the app shell, database session layer, and selected service behavior, but not every route-to-service connection.

Main entry points: [`app/routes`](https://github.com/subbu6699/slowbooks-pro-2026/tree/main/app/routes) (API routes), [`app/services/ocr_service.py`](https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/services/ocr_service.py) (Receipt OCR), [`app/static/js/app.js`](https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/static/js/app.js) (Browser UI), [`app/static/js/api.js`](https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/static/js/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_browser["Browser UI<br/>[app.js]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["Application API"]
  node_api_app["REST application<br/>[main.py]"]
  node_routes["API routes"]
end

subgraph group_finance["Accounting workflows"]
  node_accounting["Ledger and transactions<br/>[accounting.py]"]
  node_reports["Financial reports"]
  node_banking["Banking and feeds<br/>[banking.py]"]
  node_bank_rules["Bank categorization"]
  node_receivables["Invoices and payments"]
  node_payables["Bills and purchasing<br/>[bills.py]"]
end

subgraph group_operations["Business operations"]
  node_payroll["Payroll and HR"]
  node_payroll_engine["Payroll calculations<br/>[payroll_service.py]"]
  node_nonprofit["Nonprofit accounting<br/>[nonprofit.py]"]
  node_migration["Data migration<br/>[migration.py]"]
  node_ocr["Receipt OCR<br/>[ocr_service.py]"]
  node_ocr_engines["OCR engines<br/>[ocr_engines.py]"]
  node_ai["AI insights<br/>[ai_service.py]"]
end

subgraph group_persistence["Data and files"]
  node_models["Domain models"]
  node_db[("Accounting database<br/>[database.py]")]
  node_files["User files<br/>[storage.py]"]
end

node_user(("Bookkeeper"))
node_ai_provider{{"AI providers"}}

node_user -->|"uses"| node_browser
node_browser -->|"calls"| node_api_client
node_api_client -->|"HTTP requests"| node_api_app
node_api_app -->|"dispatches"| node_routes
node_routes -->|"request sessions"| node_db
node_db -->|"maps records"| node_models
node_routes -->|"accounting operations"| node_accounting
node_routes -->|"requests reports"| node_reports
node_routes -->|"bank operations"| node_banking
node_banking -->|"applies rules"| node_bank_rules
node_routes -->|"invoice operations"| node_receivables
node_routes -->|"bill operations"| node_payables
node_routes -->|"payroll operations"| node_payroll
node_payroll -->|"calculates pay"| node_payroll_engine
node_routes -->|"nonprofit operations"| node_nonprofit
node_routes -->|"imports data"| node_migration
node_routes -->|"receipt intake"| node_ocr
node_ocr -->|"selects engine"| node_ocr_engines
node_ocr -->|"reads uploads"| node_files
node_routes -.->|"requests insights"| node_ai
node_ai -.->|"sends prompts"| node_ai_provider

click node_browser "https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/static/js/app.js"
click node_api_client "https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/static/js/api.js"
click node_api_app "https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/main.py"
click node_routes "https://github.com/subbu6699/slowbooks-pro-2026/tree/main/app/routes"
click node_models "https://github.com/subbu6699/slowbooks-pro-2026/tree/main/app/models"
click node_db "https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/database.py"
click node_accounting "https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/services/accounting.py"
click node_reports "https://github.com/subbu6699/slowbooks-pro-2026/tree/main/app/routes/reports"
click node_banking "https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/routes/banking.py"
click node_bank_rules "https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/services/bank_rules_engine.py"
click node_receivables "https://github.com/subbu6699/slowbooks-pro-2026/tree/main/app/routes/invoices"
click node_payables "https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/routes/bills.py"
click node_payroll "https://github.com/subbu6699/slowbooks-pro-2026/tree/main/app/routes/payroll"
click node_payroll_engine "https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/services/payroll_service.py"
click node_nonprofit "https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/services/nonprofit.py"
click node_migration "https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/routes/migration.py"
click node_ocr "https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/services/ocr_service.py"
click node_ocr_engines "https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/services/ocr_engines.py"
click node_files "https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/services/storage.py"
click node_ai "https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/services/ai_service.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_browser,node_api_client toneBlue
class node_api_app,node_routes toneAmber
class node_accounting,node_reports,node_banking,node_bank_rules,node_receivables,node_payables toneMint
class node_payroll,node_payroll_engine,node_nonprofit,node_migration,node_ocr,node_ocr_engines,node_ai toneRose
class node_models,node_db,node_files,node_user,node_ai_provider toneIndigo
```

## Components

### User interface

- [Browser UI](https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/static/js/app.js): `app/static/js/app.js`
- [API client](https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/static/js/api.js): `app/static/js/api.js`

### Application API

- [REST application](https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/main.py): `app/main.py`
- [API routes](https://github.com/subbu6699/slowbooks-pro-2026/tree/main/app/routes): `app/routes`

### Accounting workflows

- [Ledger and transactions](https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/services/accounting.py): `app/services/accounting.py`
- [Financial reports](https://github.com/subbu6699/slowbooks-pro-2026/tree/main/app/routes/reports): `app/routes/reports`
- [Banking and feeds](https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/routes/banking.py): `app/routes/banking.py`
- [Bank categorization](https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/services/bank_rules_engine.py): `app/services/bank_rules_engine.py`
- [Invoices and payments](https://github.com/subbu6699/slowbooks-pro-2026/tree/main/app/routes/invoices): `app/routes/invoices`
- [Bills and purchasing](https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/routes/bills.py): `app/routes/bills.py`

### Business operations

- [Payroll and HR](https://github.com/subbu6699/slowbooks-pro-2026/tree/main/app/routes/payroll): `app/routes/payroll`
- [Payroll calculations](https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/services/payroll_service.py): `app/services/payroll_service.py`
- [Nonprofit accounting](https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/services/nonprofit.py): `app/services/nonprofit.py`
- [Data migration](https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/routes/migration.py): `app/routes/migration.py`
- [Receipt OCR](https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/services/ocr_service.py): `app/services/ocr_service.py`
- [OCR engines](https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/services/ocr_engines.py): `app/services/ocr_engines.py`
- [AI insights](https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/services/ai_service.py): `app/services/ai_service.py`

### Data and files

- [Domain models](https://github.com/subbu6699/slowbooks-pro-2026/tree/main/app/models): `app/models`
- [Accounting database](https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/database.py): `app/database.py`
- [User files](https://github.com/subbu6699/slowbooks-pro-2026/blob/main/app/services/storage.py): `app/services/storage.py`

### Other components

- **Bookkeeper**
- **AI providers**

## Connections

- Bookkeeper → Browser UI: uses
- Browser UI → API client: calls
- API client → REST application: HTTP requests
- REST application → API routes: dispatches
- API routes → Accounting database: request sessions
- Accounting database → Domain models: maps records
- API routes → Ledger and transactions: accounting operations
- API routes → Financial reports: requests reports
- API routes → Banking and feeds: bank operations
- Banking and feeds → Bank categorization: applies rules
- API routes → Invoices and payments: invoice operations
- API routes → Bills and purchasing: bill operations
- API routes → Payroll and HR: payroll operations
- Payroll and HR → Payroll calculations: calculates pay
- API routes → Nonprofit accounting: nonprofit operations
- API routes → Data migration: imports data
- API routes → Receipt OCR: receipt intake
- Receipt OCR → OCR engines: selects engine
- Receipt OCR → User files: reads uploads
- API routes → AI insights: requests insights
- AI insights → AI providers: sends prompts
