# robimez/odit-bridge architecture

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

- Interactive diagram: https://gitdiagram.com/robimez/odit-bridge
- Repository: https://github.com/robimez/odit-bridge

## Overview

OditBridge is a macOS companion client for the odit finance tracker. The user loads forwarded bank SMS from the local Messages database, reviews staged messages, and explicitly syncs them to an odit server; the app also fetches existing transactions and reference/summary data for synced, chart, and heatmap views. The graph includes settings, device identity, transaction editing, export, and onboarding. Some subsystem links rely on the SOURCE INDEX or README because the relevant source was only partially sampled.

Main entry points: [`OditBridge/ContentView.swift`](https://github.com/robimez/odit-bridge/blob/master/OditBridge/ContentView.swift) (Main workspace), [`OditBridge/SyncService.swift`](https://github.com/robimez/odit-bridge/blob/master/OditBridge/SyncService.swift) (Sync service), [`OditBridge/AppState.swift`](https://github.com/robimez/odit-bridge/blob/master/OditBridge/AppState.swift) (Runtime state), [`OditBridge/App.swift`](https://github.com/robimez/odit-bridge/blob/master/OditBridge/App.swift) (App bootstrap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and UI"]
  node_app["App bootstrap<br/>[App.swift]"]
  node_workspace["Main workspace<br/>[ContentView.swift]"]
  node_settings_ui["Settings and logs<br/>[Sheets.swift]"]
  node_onboarding["Getting started"]
end

subgraph group_sync["SMS and Sync"]
  node_sync_service["Sync service<br/>[SyncService.swift]"]
  node_messages_db[("Messages database<br/>[ChatDB.swift]")]
  node_app_state["Runtime state<br/>[AppState.swift]"]
end

subgraph group_identity["Settings and Identity"]
  node_device_identity["Device identity"]
  node_keychain[("Keychain storage<br/>[Keychain.swift]")]
end

subgraph group_insights["Transactions and Insights"]
  node_models["Domain models<br/>[Models.swift]"]
  node_csv["CSV export<br/>[CSVExport.swift]"]
  node_charts["Charts and KPIs<br/>[ChartsView.swift]"]
  node_heatmap["Activity heatmap<br/>[HeatmapView.swift]"]
  node_transaction_detail["Transaction editor"]
  node_provider_colors["Provider colors"]
end

node_user(("Mac user"))
node_mac_messages[("macOS Messages store")]
node_odit_api{{"odit API"}}

node_user -->|"uses"| node_workspace
node_app -->|"launches"| node_workspace
node_app -->|"bootstraps"| node_sync_service
node_app -->|"fetches server data"| node_sync_service
node_workspace -->|"loads and syncs"| node_sync_service
node_sync_service -->|"reads staged SMS"| node_messages_db
node_messages_db -->|"queries"| node_mac_messages
node_sync_service -->|"requests and uploads"| node_odit_api
node_sync_service -->|"updates"| node_app_state
node_sync_service -->|"fetches providers and summaries"| node_odit_api
node_workspace -->|"shows"| node_charts
node_workspace -->|"shows"| node_heatmap
node_workspace -->|"opens"| node_transaction_detail
node_workspace -->|"exports"| node_csv
node_workspace -->|"presents"| node_onboarding
node_workspace -.->|"opens settings"| node_settings_ui
node_charts -->|"fetches summaries"| node_sync_service
node_charts -->|"reads transactions"| node_app_state
node_heatmap -->|"reads transactions"| node_app_state
node_transaction_detail -->|"updates transaction"| node_sync_service
node_settings_ui -->|"changes settings"| node_app_state
node_app_state -->|"persists device ID"| node_device_identity
node_device_identity -->|"reads and writes"| node_keychain
node_models -->|"uses color mapping"| node_provider_colors

click node_app "https://github.com/robimez/odit-bridge/blob/master/OditBridge/App.swift"
click node_workspace "https://github.com/robimez/odit-bridge/blob/master/OditBridge/ContentView.swift"
click node_settings_ui "https://github.com/robimez/odit-bridge/blob/master/OditBridge/Sheets.swift"
click node_onboarding "https://github.com/robimez/odit-bridge/blob/master/OditBridge/Views/GettingStartedSheet.swift"
click node_sync_service "https://github.com/robimez/odit-bridge/blob/master/OditBridge/SyncService.swift"
click node_messages_db "https://github.com/robimez/odit-bridge/blob/master/OditBridge/ChatDB.swift"
click node_app_state "https://github.com/robimez/odit-bridge/blob/master/OditBridge/AppState.swift"
click node_models "https://github.com/robimez/odit-bridge/blob/master/OditBridge/Models.swift"
click node_device_identity "https://github.com/robimez/odit-bridge/blob/master/OditBridge/DeviceIdentity.swift"
click node_keychain "https://github.com/robimez/odit-bridge/blob/master/OditBridge/Keychain.swift"
click node_csv "https://github.com/robimez/odit-bridge/blob/master/OditBridge/CSVExport.swift"
click node_charts "https://github.com/robimez/odit-bridge/blob/master/OditBridge/Views/ChartsView.swift"
click node_heatmap "https://github.com/robimez/odit-bridge/blob/master/OditBridge/Views/HeatmapView.swift"
click node_transaction_detail "https://github.com/robimez/odit-bridge/blob/master/OditBridge/Views/TransactionDetailSheet.swift"
click node_provider_colors "https://github.com/robimez/odit-bridge/blob/master/OditBridge/ProviderColors.swift"

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_app,node_workspace,node_settings_ui,node_onboarding,node_user toneBlue
class node_sync_service,node_messages_db,node_app_state,node_mac_messages toneAmber
class node_device_identity,node_keychain,node_odit_api toneMint
class node_models,node_csv,node_charts,node_heatmap,node_transaction_detail,node_provider_colors toneRose
```

## Components

### App and UI

- [App bootstrap](https://github.com/robimez/odit-bridge/blob/master/OditBridge/App.swift): `OditBridge/App.swift`
- [Main workspace](https://github.com/robimez/odit-bridge/blob/master/OditBridge/ContentView.swift): `OditBridge/ContentView.swift`
- [Settings and logs](https://github.com/robimez/odit-bridge/blob/master/OditBridge/Sheets.swift): `OditBridge/Sheets.swift`
- [Getting started](https://github.com/robimez/odit-bridge/blob/master/OditBridge/Views/GettingStartedSheet.swift): `OditBridge/Views/GettingStartedSheet.swift`

### SMS and Sync

- [Sync service](https://github.com/robimez/odit-bridge/blob/master/OditBridge/SyncService.swift): `OditBridge/SyncService.swift`
- [Messages database](https://github.com/robimez/odit-bridge/blob/master/OditBridge/ChatDB.swift): `OditBridge/ChatDB.swift`
- [Runtime state](https://github.com/robimez/odit-bridge/blob/master/OditBridge/AppState.swift): `OditBridge/AppState.swift`

### Settings and Identity

- [Device identity](https://github.com/robimez/odit-bridge/blob/master/OditBridge/DeviceIdentity.swift): `OditBridge/DeviceIdentity.swift`
- [Keychain storage](https://github.com/robimez/odit-bridge/blob/master/OditBridge/Keychain.swift): `OditBridge/Keychain.swift`

### Transactions and Insights

- [Domain models](https://github.com/robimez/odit-bridge/blob/master/OditBridge/Models.swift): `OditBridge/Models.swift`
- [CSV export](https://github.com/robimez/odit-bridge/blob/master/OditBridge/CSVExport.swift): `OditBridge/CSVExport.swift`
- [Charts and KPIs](https://github.com/robimez/odit-bridge/blob/master/OditBridge/Views/ChartsView.swift): `OditBridge/Views/ChartsView.swift`
- [Activity heatmap](https://github.com/robimez/odit-bridge/blob/master/OditBridge/Views/HeatmapView.swift): `OditBridge/Views/HeatmapView.swift`
- [Transaction editor](https://github.com/robimez/odit-bridge/blob/master/OditBridge/Views/TransactionDetailSheet.swift): `OditBridge/Views/TransactionDetailSheet.swift`
- [Provider colors](https://github.com/robimez/odit-bridge/blob/master/OditBridge/ProviderColors.swift): `OditBridge/ProviderColors.swift`

### Other components

- **Mac user**
- **macOS Messages store**
- **odit API**

## Connections

- Mac user → Main workspace: uses (evidence: `README.md`)
- App bootstrap → Main workspace: launches (evidence: `OditBridge/App.swift`)
- App bootstrap → Sync service: bootstraps (evidence: `OditBridge/App.swift`)
- App bootstrap → Sync service: fetches server data (evidence: `OditBridge/App.swift`)
- Main workspace → Sync service: loads and syncs (evidence: `OditBridge/ContentView.swift`)
- Sync service → Messages database: reads staged SMS (evidence: `OditBridge/SyncService.swift`)
- Messages database → macOS Messages store: queries (evidence: `README.md`)
- Sync service → odit API: requests and uploads (evidence: `README.md`)
- Sync service → Runtime state: updates (evidence: `OditBridge/SyncService.swift`)
- Sync service → odit API: fetches providers and summaries
- Main workspace → Charts and KPIs: shows (evidence: `OditBridge/ContentView.swift`)
- Main workspace → Activity heatmap: shows (evidence: `OditBridge/ContentView.swift`)
- Main workspace → Transaction editor: opens (evidence: `OditBridge/ContentView.swift`)
- Main workspace → CSV export: exports (evidence: `OditBridge/ContentView.swift`)
- Main workspace → Getting started: presents (evidence: `OditBridge/ContentView.swift`)
- Main workspace → Settings and logs: opens settings
- Charts and KPIs → Sync service: fetches summaries (evidence: `OditBridge/Views/ChartsView.swift`)
- Charts and KPIs → Runtime state: reads transactions (evidence: `OditBridge/Views/ChartsView.swift`)
- Activity heatmap → Runtime state: reads transactions (evidence: `OditBridge/Views/HeatmapView.swift`)
- Transaction editor → Sync service: updates transaction (evidence: `OditBridge/Views/TransactionDetailSheet.swift`)
- Settings and logs → Runtime state: changes settings (evidence: `OditBridge/Sheets.swift`)
- Runtime state → Device identity: persists device ID (evidence: `OditBridge/AppState.swift`)
- Device identity → Keychain storage: reads and writes (evidence: `OditBridge/DeviceIdentity.swift`)
- Domain models → Provider colors: uses color mapping (evidence: `OditBridge/Models.swift`)
