# acesarp/exchangeratesapp architecture

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

- Interactive diagram: https://gitdiagram.com/acesarp/exchangeratesapp
- Repository: https://github.com/acesarp/exchangeratesapp

## Overview

Exchange Rates App provides historical currency-pair rates through a React client and a .NET API. The main flow requests currencies and a date range, resolves cached rates and missing dates through central-bank providers, persists new observations and unavailable dates, then returns the series for charting. Separate live features stream crypto prices and database health to the browser; authentication protects administration. The README documents these capabilities, while unsampled implementation details are represented at subsystem level rather than inferred as detailed call chains.

Main entry points: [`Clients/ExchangeRates.Client/exchangerates.client.react/src/App.jsx`](https://github.com/acesarp/exchangeratesapp/blob/main/Clients/ExchangeRates.Client/exchangerates.client.react/src/App.jsx) (React application), [`Server/ExchangeRates.Server/Services/ExchangeRateService.cs`](https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Services/ExchangeRateService.cs) (Exchange rate service), [`Server/ExchangeRates.Server/Workers/BitcoinPriceWorker.cs`](https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Workers/BitcoinPriceWorker.cs) (Bitcoin price worker), [`Server/ExchangeRates.Server/Workers/HealthStatusWorker.cs`](https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Workers/HealthStatusWorker.cs) (Health status worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser clients"]
  node_react["React application<br/>[App.jsx]"]
  node_currency_api["Currency API client<br/>[currencyService.js]"]
  node_health_bar["Database health display<br/>[DbHealthBar.jsx]"]
  node_crypto_bar["Crypto feed display<br/>[CryptoFeedBar.jsx]"]
end

subgraph group_api["API and services"]
  node_quotes["Quotes controller"]
  node_admin["Admin endpoints<br/>[AdminController.cs]"]
  node_rate_service["Exchange rate service"]
  node_health_service["Health status service"]
  node_health_controller["Health endpoint"]
end

subgraph group_rates["Rate sourcing and storage"]
  node_repo["Rate repository"]
  node_db_context["EF database context"]
  node_sql[("SQL Server cache")]
  node_factory["Central bank provider factory"]
  node_bank_providers["Central bank providers<br/>[Providers]"]
  node_fixed_provider["Fixed-rate provider"]
end

subgraph group_live["Live status and feeds"]
  node_bitcoin_worker["Bitcoin price worker"]
  node_crypto_hub["Crypto SignalR hub<br/>[CryptoPriceHub.cs]"]
  node_health_worker["Health status worker"]
  node_health_hub["Health SignalR hub<br/>[HealthStatusHub.cs]"]
end

node_browser(("Browser user"))
node_banks{{"Central bank data sources"}}
node_coinbase{{"Coinbase and Kraken"}}
node_identity{{"OpenID Connect identity"}}

node_browser -->|"uses"| node_react
node_react -->|"requests rates"| node_currency_api
node_currency_api -->|"calls API"| node_quotes
node_quotes -->|"delegates to"| node_rate_service
node_rate_service -->|"reads and writes"| node_repo
node_rate_service -->|"selects provider"| node_factory
node_factory -->|"creates provider"| node_bank_providers
node_bank_providers -->|"fetches rates"| node_banks
node_rate_service -->|"uses fixed rates"| node_fixed_provider
node_repo -->|"queries"| node_db_context
node_db_context -->|"maps cache"| node_sql
node_react -->|"renders"| node_crypto_bar
node_react -->|"renders"| node_health_bar
node_bitcoin_worker -->|"fetches prices"| node_coinbase
node_bitcoin_worker -->|"publishes prices"| node_crypto_hub
node_crypto_bar -->|"receives stream"| node_crypto_hub
node_health_worker -->|"checks database"| node_sql
node_health_worker -->|"publishes status"| node_health_hub
node_health_bar -->|"receives updates"| node_health_hub
node_health_controller -->|"delegates to"| node_health_service
node_admin -->|"authenticates with"| node_identity

click node_react "https://github.com/acesarp/exchangeratesapp/blob/main/Clients/ExchangeRates.Client/exchangerates.client.react/src/App.jsx"
click node_currency_api "https://github.com/acesarp/exchangeratesapp/blob/main/Clients/ExchangeRates.Client/exchangerates.client.react/src/services/currencyService.js"
click node_health_bar "https://github.com/acesarp/exchangeratesapp/blob/main/Clients/ExchangeRates.Client/exchangerates.client.react/src/components/DbHealthBar.jsx"
click node_crypto_bar "https://github.com/acesarp/exchangeratesapp/blob/main/Clients/ExchangeRates.Client/exchangerates.client.react/src/components/CryptoFeedBar.jsx"
click node_quotes "https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Controllers/QuotesController.cs"
click node_admin "https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Controllers/AdminController.cs"
click node_rate_service "https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Services/ExchangeRateService.cs"
click node_health_service "https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Services/HealthStatusService.cs"
click node_repo "https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Infrastructure/Repositories/ExchangeRateRepository.cs"
click node_db_context "https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Infrastructure/Context/ExchangeRatesDbContext.cs"
click node_factory "https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Infrastructure/Providers/CentralBankProviderFactory.cs"
click node_bank_providers "https://github.com/acesarp/exchangeratesapp/tree/main/Server/ExchangeRates.Infrastructure/Providers"
click node_fixed_provider "https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Infrastructure/Providers/FixedExchangeRateProvider.cs"
click node_bitcoin_worker "https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Workers/BitcoinPriceWorker.cs"
click node_crypto_hub "https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Hubs/CryptoPriceHub.cs"
click node_health_worker "https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Workers/HealthStatusWorker.cs"
click node_health_hub "https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Hubs/HealthStatusHub.cs"
click node_health_controller "https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Controllers/AppHealthController.cs"

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_react,node_currency_api,node_health_bar,node_crypto_bar,node_browser toneBlue
class node_quotes,node_admin,node_rate_service,node_health_service,node_health_controller toneAmber
class node_repo,node_db_context,node_sql,node_factory,node_bank_providers,node_fixed_provider toneMint
class node_bitcoin_worker,node_crypto_hub,node_health_worker,node_health_hub toneRose
class node_banks,node_coinbase,node_identity toneIndigo
```

## Components

### Browser clients

- [React application](https://github.com/acesarp/exchangeratesapp/blob/main/Clients/ExchangeRates.Client/exchangerates.client.react/src/App.jsx): `Clients/ExchangeRates.Client/exchangerates.client.react/src/App.jsx`
- [Currency API client](https://github.com/acesarp/exchangeratesapp/blob/main/Clients/ExchangeRates.Client/exchangerates.client.react/src/services/currencyService.js): `Clients/ExchangeRates.Client/exchangerates.client.react/src/services/currencyService.js`
- [Database health display](https://github.com/acesarp/exchangeratesapp/blob/main/Clients/ExchangeRates.Client/exchangerates.client.react/src/components/DbHealthBar.jsx): `Clients/ExchangeRates.Client/exchangerates.client.react/src/components/DbHealthBar.jsx`
- [Crypto feed display](https://github.com/acesarp/exchangeratesapp/blob/main/Clients/ExchangeRates.Client/exchangerates.client.react/src/components/CryptoFeedBar.jsx): `Clients/ExchangeRates.Client/exchangerates.client.react/src/components/CryptoFeedBar.jsx`

### API and services

- [Quotes controller](https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Controllers/QuotesController.cs): `Server/ExchangeRates.Server/Controllers/QuotesController.cs`
- [Admin endpoints](https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Controllers/AdminController.cs): `Server/ExchangeRates.Server/Controllers/AdminController.cs`
- [Exchange rate service](https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Services/ExchangeRateService.cs): `Server/ExchangeRates.Server/Services/ExchangeRateService.cs`
- [Health status service](https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Services/HealthStatusService.cs): `Server/ExchangeRates.Server/Services/HealthStatusService.cs`
- [Health endpoint](https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Controllers/AppHealthController.cs): `Server/ExchangeRates.Server/Controllers/AppHealthController.cs`

### Rate sourcing and storage

- [Rate repository](https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Infrastructure/Repositories/ExchangeRateRepository.cs): `Server/ExchangeRates.Infrastructure/Repositories/ExchangeRateRepository.cs`
- [EF database context](https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Infrastructure/Context/ExchangeRatesDbContext.cs): `Server/ExchangeRates.Infrastructure/Context/ExchangeRatesDbContext.cs`
- **SQL Server cache**
- [Central bank provider factory](https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Infrastructure/Providers/CentralBankProviderFactory.cs): `Server/ExchangeRates.Infrastructure/Providers/CentralBankProviderFactory.cs`
- [Central bank providers](https://github.com/acesarp/exchangeratesapp/tree/main/Server/ExchangeRates.Infrastructure/Providers): `Server/ExchangeRates.Infrastructure/Providers`
- [Fixed-rate provider](https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Infrastructure/Providers/FixedExchangeRateProvider.cs): `Server/ExchangeRates.Infrastructure/Providers/FixedExchangeRateProvider.cs`

### Live status and feeds

- [Bitcoin price worker](https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Workers/BitcoinPriceWorker.cs): `Server/ExchangeRates.Server/Workers/BitcoinPriceWorker.cs`
- [Crypto SignalR hub](https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Hubs/CryptoPriceHub.cs): `Server/ExchangeRates.Server/Hubs/CryptoPriceHub.cs`
- [Health status worker](https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Workers/HealthStatusWorker.cs): `Server/ExchangeRates.Server/Workers/HealthStatusWorker.cs`
- [Health SignalR hub](https://github.com/acesarp/exchangeratesapp/blob/main/Server/ExchangeRates.Server/Hubs/HealthStatusHub.cs): `Server/ExchangeRates.Server/Hubs/HealthStatusHub.cs`

### Other components

- **Browser user**
- **Central bank data sources**
- **Coinbase and Kraken**
- **OpenID Connect identity**

## Connections

- Browser user → React application: uses
- React application → Currency API client: requests rates (evidence: `Clients/ExchangeRates.Client/exchangerates.client.react/src/App.jsx`)
- Currency API client → Quotes controller: calls API
- Quotes controller → Exchange rate service: delegates to (evidence: `Server/ExchangeRates.Server/Controllers/QuotesController.cs`)
- Exchange rate service → Rate repository: reads and writes (evidence: `Server/ExchangeRates.Server/Services/ExchangeRateService.cs`)
- Exchange rate service → Central bank provider factory: selects provider (evidence: `Server/ExchangeRates.Server/Services/ExchangeRateService.cs`)
- Central bank provider factory → Central bank providers: creates provider (evidence: `Server/ExchangeRates.Infrastructure/Providers/CentralBankProviderFactory.cs`)
- Central bank providers → Central bank data sources: fetches rates
- Exchange rate service → Fixed-rate provider: uses fixed rates (evidence: `Server/ExchangeRates.Server/Services/ExchangeRateService.cs`)
- Rate repository → EF database context: queries (evidence: `Server/ExchangeRates.Infrastructure/Repositories/ExchangeRateRepository.cs`)
- EF database context → SQL Server cache: maps cache
- React application → Crypto feed display: renders (evidence: `Clients/ExchangeRates.Client/exchangerates.client.react/src/App.jsx`)
- React application → Database health display: renders (evidence: `Clients/ExchangeRates.Client/exchangerates.client.react/src/App.jsx`)
- Bitcoin price worker → Coinbase and Kraken: fetches prices
- Bitcoin price worker → Crypto SignalR hub: publishes prices (evidence: `Server/ExchangeRates.Server/Workers/BitcoinPriceWorker.cs`)
- Crypto feed display → Crypto SignalR hub: receives stream
- Health status worker → SQL Server cache: checks database
- Health status worker → Health SignalR hub: publishes status
- Database health display → Health SignalR hub: receives updates
- Health endpoint → Health status service: delegates to (evidence: `Server/ExchangeRates.Server/Controllers/AppHealthController.cs`)
- Admin endpoints → OpenID Connect identity: authenticates with
