# rammeshgar/exchange_universe_shiny architecture

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

- Interactive diagram: https://gitdiagram.com/rammeshgar/exchange_universe_shiny
- Repository: https://github.com/rammeshgar/exchange_universe_shiny

## Overview

Exchange Universe is an R Shiny currency-atlas dashboard. Users select a base and up to six currencies, explore quotes and daily history through charts and a world map, convert amounts, inspect statistics, and save or share comparisons. The README identifies APILayer as the rates and symbols provider and describes shared caching and request controls. Source excerpts are limited to browser scripts, so backend call ownership and several internal data flows are not verified; the graph keeps those links conservative.

Main entry points: [`app.R`](https://github.com/rammeshgar/exchange_universe_shiny/blob/main/app.R) (Shiny app), [`www/app.js`](https://github.com/rammeshgar/exchange_universe_shiny/blob/main/www/app.js) (Dashboard interactions), [`www/analytics.js`](https://github.com/rammeshgar/exchange_universe_shiny/blob/main/www/analytics.js) (Privacy-aware analytics), [`R/provider.R`](https://github.com/rammeshgar/exchange_universe_shiny/blob/main/R/provider.R) (Rates provider)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard experience"]
  node_shiny_app["Shiny app<br/>[app.R]"]
  node_dashboard_ui["Dashboard UI<br/>[ui.R]"]
end

subgraph group_market_data["Market data"]
  node_settings["Configuration<br/>[config.R]"]
  node_provider["Rates provider<br/>[provider.R]"]
  node_cache_queue[("Cache and request queue<br/>[store.R]")]
  node_rate_data["Rate data<br/>[data.R]"]
end

subgraph group_analysis["Analysis and geography"]
  node_analytics["Rate calculations<br/>[analytics.R]"]
  node_comparison_charts["Comparison charts<br/>[charts.R]"]
  node_world_map["Currency world map<br/>[world.rds]"]
  node_country_metadata["Country metadata<br/>[countries.csv]"]
end

subgraph group_client["Client experience"]
  node_browser_state["Browser state and sharing<br/>[app.js]"]
  node_web_controls["Dashboard interactions<br/>[app.js]"]
  node_analytics_client["Privacy-aware analytics<br/>[analytics.js]"]
end

node_visitor(("Visitor"))
node_apilayer["APILayer"]
node_ga4["Google Analytics 4"]
node_clarity["Microsoft Clarity"]

node_visitor -->|"uses dashboard"| node_shiny_app
node_shiny_app -->|"presents views"| node_dashboard_ui
node_shiny_app -.->|"uses configuration"| node_settings
node_provider -->|"fetches rates"| node_apilayer
node_cache_queue -->|"reduces requests"| node_provider
node_shiny_app -.->|"uses shared caching"| node_cache_queue
node_shiny_app -.->|"uses rates"| node_rate_data
node_rate_data -.->|"supports statistics"| node_analytics
node_analytics -.->|"feeds comparisons"| node_comparison_charts
node_visitor -->|"selects currencies"| node_world_map
node_country_metadata -.->|"maps countries"| node_world_map
node_visitor -->|"controls dashboard"| node_web_controls
node_web_controls -->|"saves and shares"| node_browser_state
node_web_controls -->|"sets privacy choice"| node_analytics_client
node_analytics_client -->|"loads conditionally"| node_ga4
node_analytics_client -->|"loads conditionally"| node_clarity

click node_shiny_app "https://github.com/rammeshgar/exchange_universe_shiny/blob/main/app.R"
click node_dashboard_ui "https://github.com/rammeshgar/exchange_universe_shiny/blob/main/R/ui.R"
click node_browser_state "https://github.com/rammeshgar/exchange_universe_shiny/blob/main/www/app.js"
click node_settings "https://github.com/rammeshgar/exchange_universe_shiny/blob/main/R/config.R"
click node_provider "https://github.com/rammeshgar/exchange_universe_shiny/blob/main/R/provider.R"
click node_cache_queue "https://github.com/rammeshgar/exchange_universe_shiny/blob/main/R/store.R"
click node_rate_data "https://github.com/rammeshgar/exchange_universe_shiny/blob/main/R/data.R"
click node_analytics "https://github.com/rammeshgar/exchange_universe_shiny/blob/main/R/analytics.R"
click node_comparison_charts "https://github.com/rammeshgar/exchange_universe_shiny/blob/main/R/charts.R"
click node_world_map "https://github.com/rammeshgar/exchange_universe_shiny/blob/main/data/world.rds"
click node_country_metadata "https://github.com/rammeshgar/exchange_universe_shiny/blob/main/data/countries.csv"
click node_web_controls "https://github.com/rammeshgar/exchange_universe_shiny/blob/main/www/app.js"
click node_analytics_client "https://github.com/rammeshgar/exchange_universe_shiny/blob/main/www/analytics.js"

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_shiny_app,node_dashboard_ui toneBlue
class node_settings,node_provider,node_cache_queue,node_rate_data toneAmber
class node_analytics,node_comparison_charts,node_world_map,node_country_metadata,node_apilayer toneMint
class node_browser_state,node_web_controls,node_analytics_client toneRose
class node_visitor,node_ga4,node_clarity toneIndigo
```

## Components

### Dashboard experience

- [Shiny app](https://github.com/rammeshgar/exchange_universe_shiny/blob/main/app.R): `app.R`
- [Dashboard UI](https://github.com/rammeshgar/exchange_universe_shiny/blob/main/R/ui.R): `R/ui.R`

### Market data

- [Configuration](https://github.com/rammeshgar/exchange_universe_shiny/blob/main/R/config.R): `R/config.R`
- [Rates provider](https://github.com/rammeshgar/exchange_universe_shiny/blob/main/R/provider.R): `R/provider.R`
- [Cache and request queue](https://github.com/rammeshgar/exchange_universe_shiny/blob/main/R/store.R): `R/store.R`
- [Rate data](https://github.com/rammeshgar/exchange_universe_shiny/blob/main/R/data.R): `R/data.R`

### Analysis and geography

- [Rate calculations](https://github.com/rammeshgar/exchange_universe_shiny/blob/main/R/analytics.R): `R/analytics.R`
- [Comparison charts](https://github.com/rammeshgar/exchange_universe_shiny/blob/main/R/charts.R): `R/charts.R`
- [Currency world map](https://github.com/rammeshgar/exchange_universe_shiny/blob/main/data/world.rds): `data/world.rds`
- [Country metadata](https://github.com/rammeshgar/exchange_universe_shiny/blob/main/data/countries.csv): `data/countries.csv`

### Client experience

- [Browser state and sharing](https://github.com/rammeshgar/exchange_universe_shiny/blob/main/www/app.js): `www/app.js`
- [Dashboard interactions](https://github.com/rammeshgar/exchange_universe_shiny/blob/main/www/app.js): `www/app.js`
- [Privacy-aware analytics](https://github.com/rammeshgar/exchange_universe_shiny/blob/main/www/analytics.js): `www/analytics.js`

### Other components

- **Visitor**
- **APILayer**
- **Google Analytics 4**
- **Microsoft Clarity**

## Connections

- Visitor → Shiny app: uses dashboard (evidence: `README.md`)
- Shiny app → Dashboard UI: presents views (evidence: `README.md`)
- Shiny app → Configuration: uses configuration
- Rates provider → APILayer: fetches rates (evidence: `README.md`)
- Cache and request queue → Rates provider: reduces requests (evidence: `README.md`)
- Shiny app → Cache and request queue: uses shared caching (evidence: `README.md`)
- Shiny app → Rate data: uses rates
- Rate data → Rate calculations: supports statistics
- Rate calculations → Comparison charts: feeds comparisons
- Visitor → Currency world map: selects currencies (evidence: `README.md`)
- Country metadata → Currency world map: maps countries
- Visitor → Dashboard interactions: controls dashboard (evidence: `README.md`)
- Dashboard interactions → Browser state and sharing: saves and shares (evidence: `www/app.js`)
- Dashboard interactions → Privacy-aware analytics: sets privacy choice (evidence: `www/analytics.js`)
- Privacy-aware analytics → Google Analytics 4: loads conditionally (evidence: `www/analytics.js`)
- Privacy-aware analytics → Microsoft Clarity: loads conditionally (evidence: `www/analytics.js`)
