# sergiosnw/fintech-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/sergiosnw/fintech-dashboard
- Repository: https://github.com/sergiosnw/fintech-dashboard

## Overview

Fintech Dashboard is a desktop crypto portfolio tracker. Users manage assets in the portfolio UI; the app persists changes locally, refreshes portfolio prices and global market data, then presents valuation, currency conversions, allocation charts, and market analytics. The main entry point coordinates startup and the async refresh workflow. The graph includes documented UI and worker capabilities, but source excerpts do not show every UI-to-callback or worker wiring detail; those uncertain links are omitted.

Main entry points: [`main.py`](https://github.com/sergiosnw/fintech-dashboard/blob/main/main.py) (App Coordinator), [`src/ui/main_window.py`](https://github.com/sergiosnw/fintech-dashboard/blob/main/src/ui/main_window.py) (Dashboard Window), [`src/use_cases/update_portfolio.py`](https://github.com/sergiosnw/fintech-dashboard/blob/main/src/use_cases/update_portfolio.py) (Portfolio Valuation), [`src/use_cases/fetch_global_market_data.py`](https://github.com/sergiosnw/fintech-dashboard/blob/main/src/use_cases/fetch_global_market_data.py) (Global Market Fetch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_entry["App Coordinator<br/>[main.py]"]
end

subgraph group_domain["Portfolio Domain"]
  node_models["Portfolio Models<br/>[models.py]"]
end

subgraph group_market["Market Data"]
  node_update["Portfolio Valuation"]
  node_prices["Asset Price Fetch"]
  node_global["Global Market Fetch"]
  node_api["Market API Client<br/>[api_client.py]"]
end

subgraph group_storage["Persistence"]
  node_repository["Portfolio Repository"]
  node_sqlite[("SQLite Portfolio Store")]
end

subgraph group_presentation["Desktop UI"]
  node_window["Dashboard Window<br/>[main_window.py]"]
  node_add["Add Asset Dialog"]
  node_edit["Edit Asset Dialog"]
  node_workers["Background Workers<br/>[workers.py]"]
  node_update_worker["Portfolio Worker"]
  node_global_worker["Market Worker"]
end

node_user(("Portfolio User"))
node_coingecko{{"CoinGecko"}}

node_user -->|"manages portfolio"| node_window
node_entry -->|"creates"| node_window
node_entry -->|"loads and saves"| node_repository
node_repository -->|"reads and writes"| node_sqlite
node_repository -->|"creates assets"| node_models
node_entry -->|"builds portfolio"| node_models
node_entry -->|"runs refresh"| node_update
node_entry -->|"runs refresh"| node_global
node_update -->|"fetches prices"| node_prices
node_prices -->|"requests prices"| node_api
node_global -->|"requests market data"| node_api
node_api -->|"sends HTTP requests"| node_coingecko
node_entry -->|"supplies refreshed data"| node_window
node_window -->|"opens dialog"| node_add
node_window -->|"opens dialog"| node_edit
node_window -->|"fetches chart history"| node_api
node_workers -->|"runs valuation"| node_update
node_workers -->|"fetches market data"| node_global
node_update_worker -->|"runs valuation"| node_update
node_global_worker -->|"fetches market data"| node_global

click node_entry "https://github.com/sergiosnw/fintech-dashboard/blob/main/main.py"
click node_models "https://github.com/sergiosnw/fintech-dashboard/blob/main/src/domain/models.py"
click node_update "https://github.com/sergiosnw/fintech-dashboard/blob/main/src/use_cases/update_portfolio.py"
click node_prices "https://github.com/sergiosnw/fintech-dashboard/blob/main/src/use_cases/fetch_market_data.py"
click node_global "https://github.com/sergiosnw/fintech-dashboard/blob/main/src/use_cases/fetch_global_market_data.py"
click node_api "https://github.com/sergiosnw/fintech-dashboard/blob/main/src/infrastructure/api_client.py"
click node_repository "https://github.com/sergiosnw/fintech-dashboard/blob/main/src/infrastructure/portfolio_repository.py"
click node_window "https://github.com/sergiosnw/fintech-dashboard/blob/main/src/ui/main_window.py"
click node_add "https://github.com/sergiosnw/fintech-dashboard/blob/main/src/ui/components/add_asset_dialog.py"
click node_edit "https://github.com/sergiosnw/fintech-dashboard/blob/main/src/ui/components/edit_asset_dialog.py"
click node_workers "https://github.com/sergiosnw/fintech-dashboard/blob/main/src/ui/workers.py"
click node_update_worker "https://github.com/sergiosnw/fintech-dashboard/blob/main/src/ui/workers/update_portfolio_worker.py"
click node_global_worker "https://github.com/sergiosnw/fintech-dashboard/blob/main/src/ui/workers/global_market_worker.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_entry,node_user toneBlue
class node_models toneAmber
class node_update,node_prices,node_global,node_api toneMint
class node_repository,node_sqlite toneRose
class node_window,node_add,node_edit,node_workers,node_update_worker,node_global_worker,node_coingecko toneIndigo
```

## Components

### Application

- [App Coordinator](https://github.com/sergiosnw/fintech-dashboard/blob/main/main.py): `main.py`

### Portfolio Domain

- [Portfolio Models](https://github.com/sergiosnw/fintech-dashboard/blob/main/src/domain/models.py): `src/domain/models.py`

### Market Data

- [Portfolio Valuation](https://github.com/sergiosnw/fintech-dashboard/blob/main/src/use_cases/update_portfolio.py): `src/use_cases/update_portfolio.py`
- [Asset Price Fetch](https://github.com/sergiosnw/fintech-dashboard/blob/main/src/use_cases/fetch_market_data.py): `src/use_cases/fetch_market_data.py`
- [Global Market Fetch](https://github.com/sergiosnw/fintech-dashboard/blob/main/src/use_cases/fetch_global_market_data.py): `src/use_cases/fetch_global_market_data.py`
- [Market API Client](https://github.com/sergiosnw/fintech-dashboard/blob/main/src/infrastructure/api_client.py): `src/infrastructure/api_client.py`

### Persistence

- [Portfolio Repository](https://github.com/sergiosnw/fintech-dashboard/blob/main/src/infrastructure/portfolio_repository.py): `src/infrastructure/portfolio_repository.py`
- **SQLite Portfolio Store**

### Desktop UI

- [Dashboard Window](https://github.com/sergiosnw/fintech-dashboard/blob/main/src/ui/main_window.py): `src/ui/main_window.py`
- [Add Asset Dialog](https://github.com/sergiosnw/fintech-dashboard/blob/main/src/ui/components/add_asset_dialog.py): `src/ui/components/add_asset_dialog.py`
- [Edit Asset Dialog](https://github.com/sergiosnw/fintech-dashboard/blob/main/src/ui/components/edit_asset_dialog.py): `src/ui/components/edit_asset_dialog.py`
- [Background Workers](https://github.com/sergiosnw/fintech-dashboard/blob/main/src/ui/workers.py): `src/ui/workers.py`
- [Portfolio Worker](https://github.com/sergiosnw/fintech-dashboard/blob/main/src/ui/workers/update_portfolio_worker.py): `src/ui/workers/update_portfolio_worker.py`
- [Market Worker](https://github.com/sergiosnw/fintech-dashboard/blob/main/src/ui/workers/global_market_worker.py): `src/ui/workers/global_market_worker.py`

### Other components

- **Portfolio User**
- **CoinGecko**

## Connections

- Portfolio User → Dashboard Window: manages portfolio (evidence: `README.md`)
- App Coordinator → Dashboard Window: creates (evidence: `main.py`)
- App Coordinator → Portfolio Repository: loads and saves (evidence: `main.py`)
- Portfolio Repository → SQLite Portfolio Store: reads and writes (evidence: `src/infrastructure/portfolio_repository.py`)
- Portfolio Repository → Portfolio Models: creates assets (evidence: `src/infrastructure/portfolio_repository.py`)
- App Coordinator → Portfolio Models: builds portfolio (evidence: `main.py`)
- App Coordinator → Portfolio Valuation: runs refresh (evidence: `main.py`)
- App Coordinator → Global Market Fetch: runs refresh (evidence: `main.py`)
- Portfolio Valuation → Asset Price Fetch: fetches prices (evidence: `src/use_cases/update_portfolio.py`)
- Asset Price Fetch → Market API Client: requests prices (evidence: `src/use_cases/fetch_market_data.py`)
- Global Market Fetch → Market API Client: requests market data (evidence: `src/use_cases/fetch_global_market_data.py`)
- Market API Client → CoinGecko: sends HTTP requests (evidence: `src/infrastructure/api_client.py`)
- App Coordinator → Dashboard Window: supplies refreshed data (evidence: `main.py`)
- Dashboard Window → Add Asset Dialog: opens dialog (evidence: `src/ui/main_window.py`)
- Dashboard Window → Edit Asset Dialog: opens dialog (evidence: `src/ui/main_window.py`)
- Dashboard Window → Market API Client: fetches chart history (evidence: `src/ui/main_window.py`)
- Background Workers → Portfolio Valuation: runs valuation (evidence: `src/ui/workers.py`)
- Background Workers → Global Market Fetch: fetches market data (evidence: `src/ui/workers.py`)
- Portfolio Worker → Portfolio Valuation: runs valuation (evidence: `src/ui/workers/update_portfolio_worker.py`)
- Market Worker → Global Market Fetch: fetches market data (evidence: `src/ui/workers/global_market_worker.py`)
