# annalo2912/quantiphi-fxflow architecture

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

- Interactive diagram: https://gitdiagram.com/annalo2912/quantiphi-fxflow
- Repository: https://github.com/annalo2912/quantiphi-fxflow

## Overview

FxFlow is a currency-conversion and FX-insights application. Users choose a currency pair and amount to get a live conversion; the dashboard also supports historical-rate charts, saved pairs, conversion history, and multi-currency travel budgeting. The frontend calls a FastAPI backend, whose services use the Frankfurter API and a database-backed cache, with persistent favorites and conversions. The README documents the broader route/service layout; sampled source confirms app wiring, frontend state flow, and currency/rate caching, but not every route implementation.

Main entry points: [`backend/app/services/exchange_rate.py`](https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/services/exchange_rate.py) (Exchange rates), [`backend/app/main.py`](https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/main.py) (FastAPI application), [`frontend/src/pages/Dashboard.jsx`](https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/pages/Dashboard.jsx) (FX dashboard), [`frontend/src/services/api.js`](https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/services/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_app["Application shell<br/>[App.jsx]"]
  node_dashboard["FX dashboard<br/>[Dashboard.jsx]"]
  node_converter["Currency converter<br/>[ConverterCard.jsx]"]
  node_conversion_hook["Conversion query<br/>[useConversion.js]"]
  node_history_hook["Historical query"]
  node_favorites_hook["Favorites query<br/>[useFavorites.js]"]
  node_api_client["API client<br/>[api.js]"]
  node_rate_chart["Rate chart<br/>[RateChart.jsx]"]
  node_favorites_ui["Favorite pairs<br/>[Favorites.jsx]"]
  node_history_ui["Conversion history"]
  node_travel_ui["Travel budget<br/>[TravelBudget.jsx]"]
end

subgraph group_api["REST API"]
  node_backend["FastAPI application<br/>[main.py]"]
  node_conversion_route["Conversion route<br/>[conversion.py]"]
  node_rates_route["Historical rates route<br/>[rates.py]"]
  node_favorites_route["Favorites route<br/>[favorites.py]"]
  node_history_route["History route<br/>[history.py]"]
  node_travel_route["Travel budget route<br/>[travel.py]"]
  node_currencies_route["Currencies route<br/>[currencies.py]"]
end

subgraph group_services["Backend Services"]
  node_conversion_service["Conversion logic<br/>[conversion.py]"]
  node_rate_service["Exchange rates<br/>[exchange_rate.py]"]
  node_favorites_service["Favorites logic<br/>[favorites.py]"]
  node_travel_service["Budget logic<br/>[travel_budget.py]"]
end

subgraph group_data["Data and Integrations"]
  node_database[("Application database<br/>[base.py]")]
  node_models["Persistent models"]
  node_cache_model["Rate cache model<br/>[rate_cache.py]"]
  node_frankfurter{{"Frankfurter API"}}
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_dashboard
node_dashboard -->|"renders"| node_converter
node_dashboard -->|"renders"| node_rate_chart
node_dashboard -->|"renders"| node_favorites_ui
node_dashboard -->|"renders"| node_history_ui
node_dashboard -->|"renders"| node_travel_ui
node_converter -->|"submits conversion"| node_conversion_hook
node_converter -->|"saves pair"| node_favorites_hook
node_rate_chart -->|"requests history"| node_history_hook
node_favorites_ui -->|"loads pairs"| node_favorites_hook
node_history_ui -->|"loads records"| node_api_client
node_travel_ui -->|"requests budget"| node_api_client
node_conversion_hook -->|"requests conversion"| node_api_client
node_history_hook -->|"requests rates"| node_api_client
node_favorites_hook -->|"manages pairs"| node_api_client
node_api_client -->|"HTTP requests"| node_backend
node_backend -->|"mounts router"| node_conversion_route
node_backend -->|"mounts router"| node_rates_route
node_backend -->|"mounts router"| node_favorites_route
node_backend -->|"mounts router"| node_history_route
node_backend -->|"mounts router"| node_travel_route
node_backend -->|"mounts router"| node_currencies_route
node_conversion_route -->|"delegates conversion"| node_conversion_service
node_conversion_route -->|"gets live rate"| node_rate_service
node_rates_route -->|"gets historical rates"| node_rate_service
node_currencies_route -->|"gets currencies"| node_rate_service
node_favorites_route -->|"manages pairs"| node_favorites_service
node_history_route -->|"reads history"| node_models
node_travel_route -->|"calculates budget"| node_travel_service
node_conversion_service -->|"records conversion"| node_models
node_favorites_service -->|"persists favorites"| node_models
node_travel_service -->|"gets rates"| node_rate_service
node_rate_service -->|"uses session"| node_database
node_rate_service -->|"reads and writes cache"| node_cache_model
node_conversion_service -->|"gets live rate"| node_rate_service
node_rate_service -->|"fetches rates"| node_frankfurter

click node_app "https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/App.jsx"
click node_dashboard "https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/pages/Dashboard.jsx"
click node_converter "https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/components/ConverterCard.jsx"
click node_conversion_hook "https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/hooks/useConversion.js"
click node_history_hook "https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/hooks/useHistoricalRates.js"
click node_favorites_hook "https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/hooks/useFavorites.js"
click node_api_client "https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/services/api.js"
click node_rate_chart "https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/components/RateChart.jsx"
click node_favorites_ui "https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/components/Favorites.jsx"
click node_history_ui "https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/components/ConversionHistory.jsx"
click node_travel_ui "https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/components/TravelBudget.jsx"
click node_backend "https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/main.py"
click node_conversion_route "https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/api/conversion.py"
click node_rates_route "https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/api/rates.py"
click node_favorites_route "https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/api/favorites.py"
click node_history_route "https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/api/history.py"
click node_travel_route "https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/api/travel.py"
click node_currencies_route "https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/api/currencies.py"
click node_conversion_service "https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/services/conversion.py"
click node_rate_service "https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/services/exchange_rate.py"
click node_favorites_service "https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/services/favorites.py"
click node_travel_service "https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/services/travel_budget.py"
click node_database "https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/database/base.py"
click node_models "https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/models/conversion_history.py"
click node_cache_model "https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/models/rate_cache.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_app,node_dashboard,node_converter,node_conversion_hook,node_history_hook,node_favorites_hook,node_api_client,node_rate_chart,node_favorites_ui,node_history_ui,node_travel_ui,node_user toneBlue
class node_backend,node_conversion_route,node_rates_route,node_favorites_route,node_history_route,node_travel_route,node_currencies_route toneAmber
class node_conversion_service,node_rate_service,node_favorites_service,node_travel_service toneMint
class node_database,node_models,node_cache_model,node_frankfurter toneRose
```

## Components

### Frontend

- [Application shell](https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [FX dashboard](https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Currency converter](https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/components/ConverterCard.jsx): `frontend/src/components/ConverterCard.jsx`
- [Conversion query](https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/hooks/useConversion.js): `frontend/src/hooks/useConversion.js`
- [Historical query](https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/hooks/useHistoricalRates.js): `frontend/src/hooks/useHistoricalRates.js`
- [Favorites query](https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/hooks/useFavorites.js): `frontend/src/hooks/useFavorites.js`
- [API client](https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Rate chart](https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/components/RateChart.jsx): `frontend/src/components/RateChart.jsx`
- [Favorite pairs](https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/components/Favorites.jsx): `frontend/src/components/Favorites.jsx`
- [Conversion history](https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/components/ConversionHistory.jsx): `frontend/src/components/ConversionHistory.jsx`
- [Travel budget](https://github.com/annalo2912/quantiphi-fxflow/blob/main/frontend/src/components/TravelBudget.jsx): `frontend/src/components/TravelBudget.jsx`

### REST API

- [FastAPI application](https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/main.py): `backend/app/main.py`
- [Conversion route](https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/api/conversion.py): `backend/app/api/conversion.py`
- [Historical rates route](https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/api/rates.py): `backend/app/api/rates.py`
- [Favorites route](https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/api/favorites.py): `backend/app/api/favorites.py`
- [History route](https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/api/history.py): `backend/app/api/history.py`
- [Travel budget route](https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/api/travel.py): `backend/app/api/travel.py`
- [Currencies route](https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/api/currencies.py): `backend/app/api/currencies.py`

### Backend Services

- [Conversion logic](https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/services/conversion.py): `backend/app/services/conversion.py`
- [Exchange rates](https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/services/exchange_rate.py): `backend/app/services/exchange_rate.py`
- [Favorites logic](https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/services/favorites.py): `backend/app/services/favorites.py`
- [Budget logic](https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/services/travel_budget.py): `backend/app/services/travel_budget.py`

### Data and Integrations

- [Application database](https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/database/base.py): `backend/app/database/base.py`
- [Persistent models](https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/models/conversion_history.py): `backend/app/models/conversion_history.py`
- [Rate cache model](https://github.com/annalo2912/quantiphi-fxflow/blob/main/backend/app/models/rate_cache.py): `backend/app/models/rate_cache.py`
- **Frankfurter API**

### Other components

- **User**

## Connections

- User → Application shell: uses
- Application shell → FX dashboard: renders
- FX dashboard → Currency converter: renders
- FX dashboard → Rate chart: renders
- FX dashboard → Favorite pairs: renders
- FX dashboard → Conversion history: renders
- FX dashboard → Travel budget: renders
- Currency converter → Conversion query: submits conversion
- Currency converter → Favorites query: saves pair
- Rate chart → Historical query: requests history
- Favorite pairs → Favorites query: loads pairs
- Conversion history → API client: loads records
- Travel budget → API client: requests budget
- Conversion query → API client: requests conversion
- Historical query → API client: requests rates
- Favorites query → API client: manages pairs
- API client → FastAPI application: HTTP requests
- FastAPI application → Conversion route: mounts router
- FastAPI application → Historical rates route: mounts router
- FastAPI application → Favorites route: mounts router
- FastAPI application → History route: mounts router
- FastAPI application → Travel budget route: mounts router
- FastAPI application → Currencies route: mounts router
- Conversion route → Conversion logic: delegates conversion
- Conversion route → Exchange rates: gets live rate
- Historical rates route → Exchange rates: gets historical rates
- Currencies route → Exchange rates: gets currencies
- Favorites route → Favorites logic: manages pairs
- History route → Persistent models: reads history
- Travel budget route → Budget logic: calculates budget
- Conversion logic → Persistent models: records conversion
- Favorites logic → Persistent models: persists favorites
- Budget logic → Exchange rates: gets rates
- Exchange rates → Application database: uses session
- Exchange rates → Rate cache model: reads and writes cache
- Conversion logic → Exchange rates: gets live rate
- Exchange rates → Frankfurter API: fetches rates
