How acesarp/exchangeratesapp works
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: App.jsx React application · ExchangeRateService.cs Exchange rate service · BitcoinPriceWorker.cs Bitcoin price worker · HealthStatusWorker.cs Health status worker
Components 23
Browser clients
- React application
Clients/ExchangeRates.Client/exchangerates.client.react/src/App.jsx - Currency API client
Clients/ExchangeRates.Client/exchangerates.client.react/src/services/currencyService.js - Database health display
Clients/ExchangeRates.Client/exchangerates.client.react/src/components/DbHealthBar.jsx - Crypto feed display
Clients/ExchangeRates.Client/exchangerates.client.react/src/components/CryptoFeedBar.jsx
API and services
- Quotes controller
Server/ExchangeRates.Server/Controllers/QuotesController.cs - Admin endpoints
Server/ExchangeRates.Server/Controllers/AdminController.cs - Exchange rate service
Server/ExchangeRates.Server/Services/ExchangeRateService.cs - Health status service
Server/ExchangeRates.Server/Services/HealthStatusService.cs - Health endpoint
Server/ExchangeRates.Server/Controllers/AppHealthController.cs
Rate sourcing and storage
- Rate repository
Server/ExchangeRates.Infrastructure/Repositories/ExchangeRateRepository.cs - EF database context
Server/ExchangeRates.Infrastructure/Context/ExchangeRatesDbContext.cs - SQL Server cache
- Central bank provider factory
Server/ExchangeRates.Infrastructure/Providers/CentralBankProviderFactory.cs - Central bank providers
Server/ExchangeRates.Infrastructure/Providers - Fixed-rate provider
Server/ExchangeRates.Infrastructure/Providers/FixedExchangeRateProvider.cs
Live status and feeds
- Bitcoin price worker
Server/ExchangeRates.Server/Workers/BitcoinPriceWorker.cs - Crypto SignalR hub
Server/ExchangeRates.Server/Hubs/CryptoPriceHub.cs - Health status worker
Server/ExchangeRates.Server/Workers/HealthStatusWorker.cs - Health SignalR hub
Server/ExchangeRates.Server/Hubs/HealthStatusHub.cs
Other components
- Browser user
- Central bank data sources
- Coinbase and Kraken
- OpenID Connect identity
Connections 21
- Browser user → React application: uses
- React application → Currency API client: requests rates
Clients/ExchangeRates.Client/exchangerates.client.react/src/App.jsx - Currency API client → Quotes controller: calls API
- Quotes controller → Exchange rate service: delegates to
Server/ExchangeRates.Server/Controllers/QuotesController.cs - Exchange rate service → Rate repository: reads and writes
Server/ExchangeRates.Server/Services/ExchangeRateService.cs - Exchange rate service → Central bank provider factory: selects provider
Server/ExchangeRates.Server/Services/ExchangeRateService.cs - Central bank provider factory → Central bank providers: creates provider
Server/ExchangeRates.Infrastructure/Providers/CentralBankProviderFactory.cs - Central bank providers → Central bank data sources: fetches rates
- Exchange rate service → Fixed-rate provider: uses fixed rates
Server/ExchangeRates.Server/Services/ExchangeRateService.cs - Rate repository → EF database context: queries
Server/ExchangeRates.Infrastructure/Repositories/ExchangeRateRepository.cs - EF database context → SQL Server cache: maps cache
- React application → Crypto feed display: renders
Clients/ExchangeRates.Client/exchangerates.client.react/src/App.jsx - React application → Database health display: renders
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
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
Server/ExchangeRates.Server/Controllers/AppHealthController.cs - Admin endpoints → OpenID Connect identity: authenticates with