# anamelesswolf/ledger architecture

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

- Interactive diagram: https://gitdiagram.com/anamelesswolf/ledger
- Repository: https://github.com/anamelesswolf/ledger

## Overview

Ledger is a personal-finance manager whose main workflow is recording and organizing expenses, then reviewing balances and financial activity across cards, wallets, budgets, subscriptions, and financing accounts. The Angular SPA presents these workflows; the Express/TypeORM backend exposes API routes and persists domain data in MySQL. The README also documents offline-first mobile expense capture and database schema/seed management; mobile client implementation is not represented in the supplied source tree. Several feature-specific UI and API links are inferred from product structure, so those edges are dashed and uncited.

Main entry points: [`backend/src/index.ts`](https://github.com/anamelesswolf/ledger/blob/main/backend/src/index.ts) (Express API), [`frontend/src/app/app.routes.ts`](https://github.com/anamelesswolf/ledger/blob/main/frontend/src/app/app.routes.ts) (Angular SPA), [`backend/src/controllers/walletManageController.ts`](https://github.com/anamelesswolf/ledger/blob/main/backend/src/controllers/walletManageController.ts) (Wallet management), [`backend/src/controllers/monthlyController.ts`](https://github.com/anamelesswolf/ledger/blob/main/backend/src/controllers/monthlyController.ts) (Monthly API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Finance interface"]
  node_webapp["Angular SPA<br/>[app.routes.ts]"]
  node_expense_ui["Expense workflows"]
  node_cards_ui["Card workflows"]
  node_wallet_ui["Wallet workflows"]
  node_monthly_ui["Monthly financing"]
  node_budget_ui["Budget workflows"]
  node_account_ui["Accounts"]
  node_subscription_ui["Subscriptions"]
  node_settings_ui["Settings catalogs"]
end

subgraph group_api["Finance API"]
  node_api_entry["Express API<br/>[index.ts]"]
  node_expense_api["Expense API"]
  node_card_api["Card API"]
  node_wallet_api["Wallet management"]
  node_monthly_api["Monthly API"]
  node_account_api["Account API"]
  node_other_api["Other feature APIs"]
end

subgraph group_domain["Finance data"]
  node_expense_models[("Expense records")]
  node_ledger_models[("Ledger records")]
  node_banking_models[("Banking records")]
  node_catalog_models[("Catalog records")]
  node_settings_models[("Settings records")]
end

subgraph group_sync["Mobile sync"]
  node_mobile_sync["Mobile sync service"]
  node_sync_store["Sync persistence"]
end

node_user(("Finance user"))
node_mysql[("MySQL database")]
node_mobile_client(("Offline mobile client"))

node_user -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_expense_ui
node_webapp -->|"routes to"| node_cards_ui
node_webapp -->|"routes to"| node_wallet_ui
node_webapp -->|"routes to"| node_monthly_ui
node_webapp -->|"routes to"| node_budget_ui
node_webapp -->|"routes to"| node_account_ui
node_webapp -->|"routes to"| node_subscription_ui
node_webapp -->|"routes to"| node_settings_ui
node_expense_ui -.->|"requests data"| node_api_entry
node_cards_ui -.->|"requests data"| node_api_entry
node_wallet_ui -.->|"requests data"| node_api_entry
node_monthly_ui -.->|"requests data"| node_api_entry
node_budget_ui -.->|"requests data"| node_api_entry
node_account_ui -.->|"requests data"| node_api_entry
node_subscription_ui -.->|"requests data"| node_api_entry
node_settings_ui -.->|"requests data"| node_api_entry
node_api_entry -.->|"mounts routes"| node_expense_api
node_api_entry -.->|"mounts routes"| node_card_api
node_api_entry -.->|"mounts routes"| node_wallet_api
node_api_entry -.->|"mounts routes"| node_monthly_api
node_api_entry -.->|"mounts routes"| node_account_api
node_api_entry -.->|"mounts routes"| node_other_api
node_expense_api -.->|"reads and writes"| node_expense_models
node_card_api -->|"reads and writes"| node_ledger_models
node_card_api -->|"reads"| node_banking_models
node_wallet_api -->|"reads and writes"| node_ledger_models
node_wallet_api -->|"reads and writes"| node_settings_models
node_wallet_api -->|"reads"| node_catalog_models
node_wallet_api -->|"reads"| node_expense_models
node_monthly_api -->|"reads and writes"| node_banking_models
node_monthly_api -->|"reads"| node_ledger_models
node_monthly_api -->|"reads"| node_expense_models
node_account_api -->|"reads and writes"| node_ledger_models
node_account_api -->|"reads"| node_catalog_models
node_account_api -->|"reads"| node_settings_models
node_api_entry -->|"initializes connection"| node_mysql
node_mobile_client -.->|"syncs expenses"| node_mobile_sync
node_mobile_sync -.->|"uses store"| node_sync_store
node_sync_store -.->|"persists records"| node_mysql

click node_webapp "https://github.com/anamelesswolf/ledger/blob/main/frontend/src/app/app.routes.ts"
click node_expense_ui "https://github.com/anamelesswolf/ledger/tree/main/frontend/src/app/expense"
click node_cards_ui "https://github.com/anamelesswolf/ledger/tree/main/frontend/src/app/card"
click node_wallet_ui "https://github.com/anamelesswolf/ledger/tree/main/frontend/src/app/wallet"
click node_monthly_ui "https://github.com/anamelesswolf/ledger/tree/main/frontend/src/app/monthly"
click node_budget_ui "https://github.com/anamelesswolf/ledger/tree/main/frontend/src/app/budget"
click node_account_ui "https://github.com/anamelesswolf/ledger/tree/main/frontend/src/app/account"
click node_subscription_ui "https://github.com/anamelesswolf/ledger/tree/main/frontend/src/app/subscription"
click node_settings_ui "https://github.com/anamelesswolf/ledger/tree/main/frontend/src/app/settings"
click node_api_entry "https://github.com/anamelesswolf/ledger/blob/main/backend/src/index.ts"
click node_expense_api "https://github.com/anamelesswolf/ledger/blob/main/backend/src/controllers/expenseController.ts"
click node_card_api "https://github.com/anamelesswolf/ledger/blob/main/backend/src/controllers/creditcardController.ts"
click node_wallet_api "https://github.com/anamelesswolf/ledger/blob/main/backend/src/controllers/walletManageController.ts"
click node_monthly_api "https://github.com/anamelesswolf/ledger/blob/main/backend/src/controllers/monthlyController.ts"
click node_account_api "https://github.com/anamelesswolf/ledger/blob/main/backend/src/controllers/accountController.ts"
click node_other_api "https://github.com/anamelesswolf/ledger/tree/main/backend/src/controllers"
click node_expense_models "https://github.com/anamelesswolf/ledger/tree/main/backend/src/models/expenses"
click node_ledger_models "https://github.com/anamelesswolf/ledger/tree/main/backend/src/models/ledger"
click node_banking_models "https://github.com/anamelesswolf/ledger/tree/main/backend/src/models/banking"
click node_catalog_models "https://github.com/anamelesswolf/ledger/tree/main/backend/src/models/catalogs"
click node_settings_models "https://github.com/anamelesswolf/ledger/tree/main/backend/src/models/settings"
click node_mobile_sync "https://github.com/anamelesswolf/ledger/blob/main/backend/src/services/mobileSync/MobileSyncService.ts"
click node_sync_store "https://github.com/anamelesswolf/ledger/blob/main/backend/src/services/mobileSync/TypeOrmMobileSyncStore.ts"

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_webapp,node_expense_ui,node_cards_ui,node_wallet_ui,node_monthly_ui,node_budget_ui,node_account_ui,node_subscription_ui,node_settings_ui,node_user,node_mobile_client toneBlue
class node_api_entry,node_expense_api,node_card_api,node_wallet_api,node_monthly_api,node_account_api,node_other_api,node_mysql toneAmber
class node_expense_models,node_ledger_models,node_banking_models,node_catalog_models,node_settings_models toneMint
class node_mobile_sync,node_sync_store toneRose
```

## Components

### Finance interface

- [Angular SPA](https://github.com/anamelesswolf/ledger/blob/main/frontend/src/app/app.routes.ts): `frontend/src/app/app.routes.ts`
- [Expense workflows](https://github.com/anamelesswolf/ledger/tree/main/frontend/src/app/expense): `frontend/src/app/expense`
- [Card workflows](https://github.com/anamelesswolf/ledger/tree/main/frontend/src/app/card): `frontend/src/app/card`
- [Wallet workflows](https://github.com/anamelesswolf/ledger/tree/main/frontend/src/app/wallet): `frontend/src/app/wallet`
- [Monthly financing](https://github.com/anamelesswolf/ledger/tree/main/frontend/src/app/monthly): `frontend/src/app/monthly`
- [Budget workflows](https://github.com/anamelesswolf/ledger/tree/main/frontend/src/app/budget): `frontend/src/app/budget`
- [Accounts](https://github.com/anamelesswolf/ledger/tree/main/frontend/src/app/account): `frontend/src/app/account`
- [Subscriptions](https://github.com/anamelesswolf/ledger/tree/main/frontend/src/app/subscription): `frontend/src/app/subscription`
- [Settings catalogs](https://github.com/anamelesswolf/ledger/tree/main/frontend/src/app/settings): `frontend/src/app/settings`

### Finance API

- [Express API](https://github.com/anamelesswolf/ledger/blob/main/backend/src/index.ts): `backend/src/index.ts`
- [Expense API](https://github.com/anamelesswolf/ledger/blob/main/backend/src/controllers/expenseController.ts): `backend/src/controllers/expenseController.ts`
- [Card API](https://github.com/anamelesswolf/ledger/blob/main/backend/src/controllers/creditcardController.ts): `backend/src/controllers/creditcardController.ts`
- [Wallet management](https://github.com/anamelesswolf/ledger/blob/main/backend/src/controllers/walletManageController.ts): `backend/src/controllers/walletManageController.ts`
- [Monthly API](https://github.com/anamelesswolf/ledger/blob/main/backend/src/controllers/monthlyController.ts): `backend/src/controllers/monthlyController.ts`
- [Account API](https://github.com/anamelesswolf/ledger/blob/main/backend/src/controllers/accountController.ts): `backend/src/controllers/accountController.ts`
- [Other feature APIs](https://github.com/anamelesswolf/ledger/tree/main/backend/src/controllers): `backend/src/controllers`

### Finance data

- [Expense records](https://github.com/anamelesswolf/ledger/tree/main/backend/src/models/expenses): `backend/src/models/expenses`
- [Ledger records](https://github.com/anamelesswolf/ledger/tree/main/backend/src/models/ledger): `backend/src/models/ledger`
- [Banking records](https://github.com/anamelesswolf/ledger/tree/main/backend/src/models/banking): `backend/src/models/banking`
- [Catalog records](https://github.com/anamelesswolf/ledger/tree/main/backend/src/models/catalogs): `backend/src/models/catalogs`
- [Settings records](https://github.com/anamelesswolf/ledger/tree/main/backend/src/models/settings): `backend/src/models/settings`

### Mobile sync

- [Mobile sync service](https://github.com/anamelesswolf/ledger/blob/main/backend/src/services/mobileSync/MobileSyncService.ts): `backend/src/services/mobileSync/MobileSyncService.ts`
- [Sync persistence](https://github.com/anamelesswolf/ledger/blob/main/backend/src/services/mobileSync/TypeOrmMobileSyncStore.ts): `backend/src/services/mobileSync/TypeOrmMobileSyncStore.ts`

### Other components

- **Finance user**
- **MySQL database**
- **Offline mobile client**

## Connections

- Finance user → Angular SPA: uses (evidence: `README.md`)
- Angular SPA → Expense workflows: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Angular SPA → Card workflows: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Angular SPA → Wallet workflows: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Angular SPA → Monthly financing: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Angular SPA → Budget workflows: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Angular SPA → Accounts: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Angular SPA → Subscriptions: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Angular SPA → Settings catalogs: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Expense workflows → Express API: requests data
- Card workflows → Express API: requests data
- Wallet workflows → Express API: requests data
- Monthly financing → Express API: requests data
- Budget workflows → Express API: requests data
- Accounts → Express API: requests data
- Subscriptions → Express API: requests data
- Settings catalogs → Express API: requests data
- Express API → Expense API: mounts routes
- Express API → Card API: mounts routes (evidence: `backend/src/controllers/creditcardController.ts`)
- Express API → Wallet management: mounts routes (evidence: `backend/src/controllers/walletManageController.ts`)
- Express API → Monthly API: mounts routes (evidence: `backend/src/controllers/monthlyController.ts`)
- Express API → Account API: mounts routes (evidence: `backend/src/controllers/accountController.ts`)
- Express API → Other feature APIs: mounts routes (evidence: `backend/src/controllers/accountController.ts`)
- Expense API → Expense records: reads and writes
- Card API → Ledger records: reads and writes (evidence: `backend/src/controllers/creditcardController.ts`)
- Card API → Banking records: reads (evidence: `backend/src/controllers/creditcardController.ts`)
- Wallet management → Ledger records: reads and writes (evidence: `backend/src/controllers/walletManageController.ts`)
- Wallet management → Settings records: reads and writes (evidence: `backend/src/controllers/walletManageController.ts`)
- Wallet management → Catalog records: reads (evidence: `backend/src/controllers/walletManageController.ts`)
- Wallet management → Expense records: reads (evidence: `backend/src/controllers/walletManageController.ts`)
- Monthly API → Banking records: reads and writes (evidence: `backend/src/controllers/monthlyController.ts`)
- Monthly API → Ledger records: reads (evidence: `backend/src/controllers/monthlyController.ts`)
- Monthly API → Expense records: reads (evidence: `backend/src/controllers/monthlyController.ts`)
- Account API → Ledger records: reads and writes (evidence: `backend/src/controllers/accountController.ts`)
- Account API → Catalog records: reads (evidence: `backend/src/controllers/accountController.ts`)
- Account API → Settings records: reads (evidence: `backend/src/controllers/accountController.ts`)
- Express API → MySQL database: initializes connection (evidence: `backend/src/index.ts`)
- Offline mobile client → Mobile sync service: syncs expenses
- Mobile sync service → Sync persistence: uses store
- Sync persistence → MySQL database: persists records
