# adrianmoreland/finally architecture

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

- Interactive diagram: https://gitdiagram.com/adrianmoreland/finally
- Repository: https://github.com/adrianmoreland/finally

## Overview

Finally is a personal-finance product for one person in Ireland, delivered through web/PWA and mobile apps. The main flow links bank accounts, ingests payments, categorises them (asking the user about unknown merchants), then derives budgets, reviews and insights. A separate investing branch tracks holdings, market data, rule-based signals and Irish tax estimates. The graph combines README-documented capabilities with sampled API relationships; unsampled service wiring is not inferred beyond explicit documentation or SOURCE INDEX references.

Main entry points: [`packages/finance-core/src/ledger.ts`](https://github.com/adrianmoreland/finally/blob/main/packages/finance-core/src/ledger.ts) (Finance calculations), [`apps/api/src/tools/tools.controller.ts`](https://github.com/adrianmoreland/finally/blob/main/apps/api/src/tools/tools.controller.ts) (Finance calculators), [`apps/api/src/categorisation/categorisation.service.ts`](https://github.com/adrianmoreland/finally/blob/main/apps/api/src/categorisation/categorisation.service.ts) (Payment categorisation), [`apps/api/src/investments/investments.service.ts`](https://github.com/adrianmoreland/finally/blob/main/apps/api/src/investments/investments.service.ts) (Holdings and signals)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User apps"]
  node_web["Web and PWA<br/>[index.tsx]"]
  node_mobile["iOS and Android<br/>[index.tsx]"]
end

subgraph group_shared["Shared interfaces"]
  node_api_client["Typed API client<br/>[client.ts]"]
  node_contracts["Request contracts<br/>[app.ts]"]
end

subgraph group_money["Money management"]
  node_banking["Bank connections<br/>[bank-provider.ts]"]
  node_ingest["Payment ingestion<br/>[ingest.service.ts]"]
  node_categorise["Payment categorisation"]
  node_push["Push notifications<br/>[push.service.ts]"]
  node_ledger["Finance data and ledger"]
  node_budgets["Budgets and reviews<br/>[budgets.service.ts]"]
  node_insights["Insights and overview"]
  node_ask["Ask finance<br/>[ask.service.ts]"]
end

subgraph group_invest["Investing and advice"]
  node_investments["Holdings and signals"]
  node_market["Market and FX data"]
  node_tax["Irish tax estimates<br/>[tax.service.ts]"]
  node_tools["Finance calculators"]
end

subgraph group_runtime["API and data"]
  node_finance_core["Finance calculations<br/>[ledger.ts]"]
  node_db[("Postgres data<br/>[index.ts]")]
  node_jobs["Scheduled jobs<br/>[jobs.service.ts]"]
end

node_person(("Finance user"))

node_person -->|"uses"| node_web
node_person -->|"uses"| node_mobile
node_web -->|"calls"| node_api_client
node_mobile -->|"shares client"| node_api_client
node_api_client -->|"validates shapes"| node_contracts
node_banking -->|"supplies payments"| node_ingest
node_ingest -->|"writes payments"| node_db
node_ingest -->|"normalises data"| node_finance_core
node_categorise -->|"reads and writes"| node_db
node_categorise -->|"requests alerts"| node_push
node_categorise -->|"schedules work"| node_jobs
node_push -->|"asks merchant"| node_person
node_ledger -->|"reads finance data"| node_db
node_ledger -->|"uses calculations"| node_finance_core
node_budgets -->|"loads finance data"| node_ledger
node_budgets -->|"calculates budgets"| node_finance_core
node_insights -.->|"derives insights"| node_finance_core
node_ask -->|"evaluates questions"| node_finance_core
node_investments -->|"loads market data"| node_market
node_investments -->|"sends signals"| node_push
node_investments -->|"uses finance maths"| node_finance_core
node_tax -.->|"estimates tax"| node_finance_core
node_tools -->|"loads user data"| node_ledger
node_tools -->|"loads tax rules"| node_investments
node_tools -->|"converts currency"| node_market
node_tools -->|"calculates results"| node_finance_core
node_jobs -.->|"refreshes accounts"| node_banking
node_jobs -.->|"runs pipeline"| node_categorise

click node_web "https://github.com/adrianmoreland/finally/blob/main/apps/web/src/routes/_app/index.tsx"
click node_mobile "https://github.com/adrianmoreland/finally/blob/main/apps/mobile/app/(tabs)/index.tsx"
click node_api_client "https://github.com/adrianmoreland/finally/blob/main/packages/api-client/src/client.ts"
click node_contracts "https://github.com/adrianmoreland/finally/blob/main/packages/contracts/src/app.ts"
click node_banking "https://github.com/adrianmoreland/finally/blob/main/apps/api/src/banking/providers/bank-provider.ts"
click node_ingest "https://github.com/adrianmoreland/finally/blob/main/apps/api/src/banking/ingest.service.ts"
click node_categorise "https://github.com/adrianmoreland/finally/blob/main/apps/api/src/categorisation/categorisation.service.ts"
click node_push "https://github.com/adrianmoreland/finally/blob/main/apps/api/src/notifications/push.service.ts"
click node_ledger "https://github.com/adrianmoreland/finally/blob/main/apps/api/src/data/finance-data.service.ts"
click node_budgets "https://github.com/adrianmoreland/finally/blob/main/apps/api/src/budgets/budgets.service.ts"
click node_insights "https://github.com/adrianmoreland/finally/blob/main/apps/api/src/insights/insights.service.ts"
click node_ask "https://github.com/adrianmoreland/finally/blob/main/apps/api/src/ask/ask.service.ts"
click node_investments "https://github.com/adrianmoreland/finally/blob/main/apps/api/src/investments/investments.service.ts"
click node_market "https://github.com/adrianmoreland/finally/blob/main/apps/api/src/market-data/market-data.service.ts"
click node_tax "https://github.com/adrianmoreland/finally/blob/main/apps/api/src/tax/tax.service.ts"
click node_tools "https://github.com/adrianmoreland/finally/blob/main/apps/api/src/tools/tools.controller.ts"
click node_finance_core "https://github.com/adrianmoreland/finally/blob/main/packages/finance-core/src/ledger.ts"
click node_db "https://github.com/adrianmoreland/finally/blob/main/packages/db/src/index.ts"
click node_jobs "https://github.com/adrianmoreland/finally/blob/main/apps/api/src/jobs/jobs.service.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_web,node_mobile,node_person toneBlue
class node_api_client,node_contracts toneAmber
class node_banking,node_ingest,node_categorise,node_push,node_ledger,node_budgets,node_insights,node_ask toneMint
class node_investments,node_market,node_tax,node_tools toneRose
class node_finance_core,node_db,node_jobs toneIndigo
```

## Components

### User apps

- [Web and PWA](https://github.com/adrianmoreland/finally/blob/main/apps/web/src/routes/_app/index.tsx): `apps/web/src/routes/_app/index.tsx`
- [iOS and Android](https://github.com/adrianmoreland/finally/blob/main/apps/mobile/app/(tabs)/index.tsx): `apps/mobile/app/(tabs)/index.tsx`

### Shared interfaces

- [Typed API client](https://github.com/adrianmoreland/finally/blob/main/packages/api-client/src/client.ts): `packages/api-client/src/client.ts`
- [Request contracts](https://github.com/adrianmoreland/finally/blob/main/packages/contracts/src/app.ts): `packages/contracts/src/app.ts`

### Money management

- [Bank connections](https://github.com/adrianmoreland/finally/blob/main/apps/api/src/banking/providers/bank-provider.ts): `apps/api/src/banking/providers/bank-provider.ts`
- [Payment ingestion](https://github.com/adrianmoreland/finally/blob/main/apps/api/src/banking/ingest.service.ts): `apps/api/src/banking/ingest.service.ts`
- [Payment categorisation](https://github.com/adrianmoreland/finally/blob/main/apps/api/src/categorisation/categorisation.service.ts): `apps/api/src/categorisation/categorisation.service.ts`
- [Push notifications](https://github.com/adrianmoreland/finally/blob/main/apps/api/src/notifications/push.service.ts): `apps/api/src/notifications/push.service.ts`
- [Finance data and ledger](https://github.com/adrianmoreland/finally/blob/main/apps/api/src/data/finance-data.service.ts): `apps/api/src/data/finance-data.service.ts`
- [Budgets and reviews](https://github.com/adrianmoreland/finally/blob/main/apps/api/src/budgets/budgets.service.ts): `apps/api/src/budgets/budgets.service.ts`
- [Insights and overview](https://github.com/adrianmoreland/finally/blob/main/apps/api/src/insights/insights.service.ts): `apps/api/src/insights/insights.service.ts`
- [Ask finance](https://github.com/adrianmoreland/finally/blob/main/apps/api/src/ask/ask.service.ts): `apps/api/src/ask/ask.service.ts`

### Investing and advice

- [Holdings and signals](https://github.com/adrianmoreland/finally/blob/main/apps/api/src/investments/investments.service.ts): `apps/api/src/investments/investments.service.ts`
- [Market and FX data](https://github.com/adrianmoreland/finally/blob/main/apps/api/src/market-data/market-data.service.ts): `apps/api/src/market-data/market-data.service.ts`
- [Irish tax estimates](https://github.com/adrianmoreland/finally/blob/main/apps/api/src/tax/tax.service.ts): `apps/api/src/tax/tax.service.ts`
- [Finance calculators](https://github.com/adrianmoreland/finally/blob/main/apps/api/src/tools/tools.controller.ts): `apps/api/src/tools/tools.controller.ts`

### API and data

- [Finance calculations](https://github.com/adrianmoreland/finally/blob/main/packages/finance-core/src/ledger.ts): `packages/finance-core/src/ledger.ts`
- [Postgres data](https://github.com/adrianmoreland/finally/blob/main/packages/db/src/index.ts): `packages/db/src/index.ts`
- [Scheduled jobs](https://github.com/adrianmoreland/finally/blob/main/apps/api/src/jobs/jobs.service.ts): `apps/api/src/jobs/jobs.service.ts`

### Other components

- **Finance user**

## Connections

- Finance user → Web and PWA: uses (evidence: `README.md`)
- Finance user → iOS and Android: uses (evidence: `README.md`)
- Web and PWA → Typed API client: calls
- iOS and Android → Typed API client: shares client (evidence: `README.md`)
- Typed API client → Request contracts: validates shapes (evidence: `packages/api-client/src/client.ts`)
- Bank connections → Payment ingestion: supplies payments (evidence: `README.md`)
- Payment ingestion → Postgres data: writes payments (evidence: `apps/api/src/banking/ingest.service.ts`)
- Payment ingestion → Finance calculations: normalises data (evidence: `apps/api/src/banking/ingest.service.ts`)
- Payment categorisation → Postgres data: reads and writes (evidence: `apps/api/src/categorisation/categorisation.service.ts`)
- Payment categorisation → Push notifications: requests alerts (evidence: `apps/api/src/categorisation/categorisation.service.ts`)
- Payment categorisation → Scheduled jobs: schedules work (evidence: `apps/api/src/categorisation/categorisation.service.ts`)
- Push notifications → Finance user: asks merchant (evidence: `README.md`)
- Finance data and ledger → Postgres data: reads finance data (evidence: `apps/api/src/data/finance-data.service.ts`)
- Finance data and ledger → Finance calculations: uses calculations (evidence: `apps/api/src/data/finance-data.service.ts`)
- Budgets and reviews → Finance data and ledger: loads finance data (evidence: `apps/api/src/budgets/budgets.service.ts`)
- Budgets and reviews → Finance calculations: calculates budgets (evidence: `apps/api/src/budgets/budgets.service.ts`)
- Insights and overview → Finance calculations: derives insights (evidence: `README.md`)
- Ask finance → Finance calculations: evaluates questions (evidence: `apps/api/src/ask/ask.service.ts`)
- Holdings and signals → Market and FX data: loads market data (evidence: `apps/api/src/investments/investments.service.ts`)
- Holdings and signals → Push notifications: sends signals (evidence: `apps/api/src/investments/investments.service.ts`)
- Holdings and signals → Finance calculations: uses finance maths (evidence: `apps/api/src/investments/investments.service.ts`)
- Irish tax estimates → Finance calculations: estimates tax (evidence: `README.md`)
- Finance calculators → Finance data and ledger: loads user data (evidence: `apps/api/src/tools/tools.controller.ts`)
- Finance calculators → Holdings and signals: loads tax rules (evidence: `apps/api/src/tools/tools.controller.ts`)
- Finance calculators → Market and FX data: converts currency (evidence: `apps/api/src/tools/tools.controller.ts`)
- Finance calculators → Finance calculations: calculates results (evidence: `apps/api/src/tools/tools.controller.ts`)
- Scheduled jobs → Bank connections: refreshes accounts (evidence: `README.md`)
- Scheduled jobs → Payment categorisation: runs pipeline (evidence: `README.md`)
