# letehaha/moneymatter architecture

> Architecture diagram of the GitHub repository letehaha/moneymatter, 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/letehaha/moneymatter
- Repository: https://github.com/letehaha/moneymatter

## Overview

MoneyMatter is a personal-finance application for consolidating account and transaction data into budgets, reports, and net-worth views, with bank sync, investment and loan tracking, imports, AI features, sharing, and backup/export. The principal workflow is users managing or importing financial records, optionally syncing banks, then using reports and related finance features. The graph emphasizes documented product domains and the sampled import/export handlers; exact wiring among unsampled controllers and services is not inferred.

Main entry points: [`packages/backend/src/setup-routes.ts`](https://github.com/letehaha/moneymatter/blob/dev/packages/backend/src/setup-routes.ts) (HTTP API), [`packages/backend/src/controllers/investment-transactions-parser`](https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/investment-transactions-parser) (Investment import), [`packages/backend/src/controllers/statement-parser`](https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/statement-parser) (Statement parsing), [`packages/backend/src/controllers/data-export/export-data.controller.ts`](https://github.com/letehaha/moneymatter/blob/dev/packages/backend/src/controllers/data-export/export-data.controller.ts) (Export and backup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application access"]
  node_api["HTTP API<br/>[setup-routes.ts]"]
  node_auth["Authentication<br/>[auth.ts]"]
end

subgraph group_finance["Core finances"]
  node_accounts["Accounts and currencies"]
  node_transactions["Transactions and rules"]
  node_categories["Categories and payees"]
end

subgraph group_insights["Planning and assets"]
  node_budgets["Budgets and reports"]
  node_subscriptions["Bills and subscriptions"]
  node_loans["Loans"]
  node_investments["Investments"]
end

subgraph group_integrations["Data and integrations"]
  node_banking["Bank connections"]
  node_imports["Import parsing"]
  node_investment_import["Investment import"]
  node_statement["Statement parsing"]
  node_export["Export and backup"]
  node_mcp["MCP access"]
  node_investment_parser_service["Investment parser"]
  node_date_engine["Import date engine<br/>[date-engine.ts]"]
  node_data_export_service["Data export service"]
  node_statement_service["Statement parser service"]
end

subgraph group_platform["Persistence and jobs"]
  node_attachments["Attachment storage<br/>[storage.ts]"]
  node_database[("PostgreSQL<br/>[config.ts]")]
  node_jobs["Background jobs<br/>[background-jobs.ts]"]
end

node_user(("User"))
node_agent(("AI agent"))
node_s3[("S3-compatible storage")]

node_user -->|"sends requests"| node_api
node_api -->|"mounts auth"| node_auth
node_api -->|"dispatches requests"| node_accounts
node_api -->|"dispatches requests"| node_transactions
node_api -->|"dispatches requests"| node_categories
node_api -->|"dispatches requests"| node_budgets
node_api -->|"dispatches requests"| node_subscriptions
node_api -->|"dispatches requests"| node_loans
node_api -->|"dispatches requests"| node_investments
node_api -->|"dispatches requests"| node_banking
node_api -->|"dispatches requests"| node_imports
node_api -->|"dispatches requests"| node_investment_import
node_api -->|"dispatches requests"| node_statement
node_api -->|"dispatches requests"| node_export
node_api -->|"dispatches requests"| node_mcp
node_agent -->|"uses tools"| node_mcp
node_investment_import -->|"parses CSV"| node_investment_parser_service
node_investment_import -->|"extracts text"| node_statement_service
node_investment_parser_service -->|"parses dates"| node_date_engine
node_statement -->|"extracts text"| node_statement_service
node_export -->|"exports user data"| node_data_export_service
node_attachments -.->|"stores objects"| node_s3
node_jobs -->|"uses persisted state"| node_database

click node_api "https://github.com/letehaha/moneymatter/blob/dev/packages/backend/src/setup-routes.ts"
click node_auth "https://github.com/letehaha/moneymatter/blob/dev/packages/backend/src/config/auth.ts"
click node_accounts "https://github.com/letehaha/moneymatter/blob/dev/packages/backend/src/controllers/accounts.controller.ts"
click node_transactions "https://github.com/letehaha/moneymatter/blob/dev/packages/backend/src/controllers/transactions.controller.ts"
click node_categories "https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/categories.controller"
click node_budgets "https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/budgets"
click node_subscriptions "https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/subscriptions"
click node_loans "https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/loans"
click node_investments "https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/investments"
click node_banking "https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/bank-data-providers"
click node_imports "https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/import-export"
click node_investment_import "https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/investment-transactions-parser"
click node_statement "https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/statement-parser"
click node_export "https://github.com/letehaha/moneymatter/blob/dev/packages/backend/src/controllers/data-export/export-data.controller.ts"
click node_mcp "https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/mcp"
click node_attachments "https://github.com/letehaha/moneymatter/blob/dev/packages/backend/src/services/attachments/storage.ts"
click node_database "https://github.com/letehaha/moneymatter/blob/dev/packages/backend/config/db/config.ts"
click node_jobs "https://github.com/letehaha/moneymatter/blob/dev/packages/backend/src/background-jobs.ts"
click node_investment_parser_service "https://github.com/letehaha/moneymatter/blob/dev/packages/backend/src/services/import-export/investment-transactions-parser/csv-parser.service.ts"
click node_date_engine "https://github.com/letehaha/moneymatter/blob/dev/packages/shared/src/import-export/date-engine.ts"
click node_data_export_service "https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/services/data-export"
click node_statement_service "https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/services/import-export/statement-parser"

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_api,node_auth,node_user toneBlue
class node_accounts,node_transactions,node_categories,node_s3 toneAmber
class node_budgets,node_subscriptions,node_loans,node_investments toneMint
class node_banking,node_imports,node_investment_import,node_statement,node_export,node_mcp,node_investment_parser_service,node_date_engine,node_data_export_service,node_statement_service toneRose
class node_attachments,node_database,node_jobs,node_agent toneIndigo
```

## Components

### Application access

- [HTTP API](https://github.com/letehaha/moneymatter/blob/dev/packages/backend/src/setup-routes.ts): `packages/backend/src/setup-routes.ts`
- [Authentication](https://github.com/letehaha/moneymatter/blob/dev/packages/backend/src/config/auth.ts): `packages/backend/src/config/auth.ts`

### Core finances

- [Accounts and currencies](https://github.com/letehaha/moneymatter/blob/dev/packages/backend/src/controllers/accounts.controller.ts): `packages/backend/src/controllers/accounts.controller.ts`
- [Transactions and rules](https://github.com/letehaha/moneymatter/blob/dev/packages/backend/src/controllers/transactions.controller.ts): `packages/backend/src/controllers/transactions.controller.ts`
- [Categories and payees](https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/categories.controller): `packages/backend/src/controllers/categories.controller`

### Planning and assets

- [Budgets and reports](https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/budgets): `packages/backend/src/controllers/budgets`
- [Bills and subscriptions](https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/subscriptions): `packages/backend/src/controllers/subscriptions`
- [Loans](https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/loans): `packages/backend/src/controllers/loans`
- [Investments](https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/investments): `packages/backend/src/controllers/investments`

### Data and integrations

- [Bank connections](https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/bank-data-providers): `packages/backend/src/controllers/bank-data-providers`
- [Import parsing](https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/import-export): `packages/backend/src/controllers/import-export`
- [Investment import](https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/investment-transactions-parser): `packages/backend/src/controllers/investment-transactions-parser`
- [Statement parsing](https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/statement-parser): `packages/backend/src/controllers/statement-parser`
- [Export and backup](https://github.com/letehaha/moneymatter/blob/dev/packages/backend/src/controllers/data-export/export-data.controller.ts): `packages/backend/src/controllers/data-export/export-data.controller.ts`
- [MCP access](https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/controllers/mcp): `packages/backend/src/controllers/mcp`
- [Investment parser](https://github.com/letehaha/moneymatter/blob/dev/packages/backend/src/services/import-export/investment-transactions-parser/csv-parser.service.ts): `packages/backend/src/services/import-export/investment-transactions-parser/csv-parser.service.ts`
- [Import date engine](https://github.com/letehaha/moneymatter/blob/dev/packages/shared/src/import-export/date-engine.ts): `packages/shared/src/import-export/date-engine.ts`
- [Data export service](https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/services/data-export): `packages/backend/src/services/data-export`
- [Statement parser service](https://github.com/letehaha/moneymatter/tree/dev/packages/backend/src/services/import-export/statement-parser): `packages/backend/src/services/import-export/statement-parser`

### Persistence and jobs

- [Attachment storage](https://github.com/letehaha/moneymatter/blob/dev/packages/backend/src/services/attachments/storage.ts): `packages/backend/src/services/attachments/storage.ts`
- [PostgreSQL](https://github.com/letehaha/moneymatter/blob/dev/packages/backend/config/db/config.ts): `packages/backend/config/db/config.ts`
- [Background jobs](https://github.com/letehaha/moneymatter/blob/dev/packages/backend/src/background-jobs.ts): `packages/backend/src/background-jobs.ts`

### Other components

- **User**
- **AI agent**
- **S3-compatible storage**

## Connections

- User → HTTP API: sends requests
- HTTP API → Authentication: mounts auth
- HTTP API → Accounts and currencies: dispatches requests
- HTTP API → Transactions and rules: dispatches requests
- HTTP API → Categories and payees: dispatches requests
- HTTP API → Budgets and reports: dispatches requests
- HTTP API → Bills and subscriptions: dispatches requests
- HTTP API → Loans: dispatches requests
- HTTP API → Investments: dispatches requests
- HTTP API → Bank connections: dispatches requests
- HTTP API → Import parsing: dispatches requests
- HTTP API → Investment import: dispatches requests
- HTTP API → Statement parsing: dispatches requests
- HTTP API → Export and backup: dispatches requests
- HTTP API → MCP access: dispatches requests
- AI agent → MCP access: uses tools
- Investment import → Investment parser: parses CSV
- Investment import → Statement parser service: extracts text
- Investment parser → Import date engine: parses dates
- Statement parsing → Statement parser service: extracts text
- Export and backup → Data export service: exports user data
- Attachment storage → S3-compatible storage: stores objects
- Background jobs → PostgreSQL: uses persisted state
