# muhammadduryabbakht/currency-converter architecture

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

- Interactive diagram: https://gitdiagram.com/muhammadduryabbakht/currency-converter
- Repository: https://github.com/muhammadduryabbakht/currency-converter

## Overview

This is a browser-based currency converter. A user selects currencies and enters an amount; the JavaScript fetches rates, calculates the converted amount, and updates the displayed result. It also populates currency selectors and updates country flags. The conversion and flag-service calls are visible in the sampled JavaScript; the README describes the page structure and capabilities, but HTML and CSS source were not sampled.

Main entry points: [`script.js`](https://github.com/muhammadduryabbakht/currency-converter/blob/main/script.js) (Conversion and UI logic), [`index.html`](https://github.com/muhammadduryabbakht/currency-converter/blob/main/index.html) (Converter page), [`style.css`](https://github.com/muhammadduryabbakht/currency-converter/blob/main/style.css) (Responsive styling), [`countrycode.js`](https://github.com/muhammadduryabbakht/currency-converter/blob/main/countrycode.js) (Currency-country map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Web interface"]
  node_page["Converter page<br/>[index.html]"]
  node_styling["Responsive styling<br/>[style.css]"]
end

subgraph group_conversion["Currency conversion"]
  node_converter["Conversion and UI logic<br/>[script.js]"]
end

subgraph group_reference["Currency and flags"]
  node_currency_codes["Currency-country map<br/>[countrycode.js]"]
end

node_user(("User"))
node_rates_api{{"Currency rates API"}}
node_flags_api{{"FlagsAPI"}}

node_user -->|"uses"| node_page
node_page -->|"provides inputs"| node_converter
node_converter -->|"looks up codes"| node_currency_codes
node_converter -->|"fetches rates"| node_rates_api
node_converter -->|"loads flags"| node_flags_api
node_page -->|"uses styles"| node_styling

click node_page "https://github.com/muhammadduryabbakht/currency-converter/blob/main/index.html"
click node_styling "https://github.com/muhammadduryabbakht/currency-converter/blob/main/style.css"
click node_converter "https://github.com/muhammadduryabbakht/currency-converter/blob/main/script.js"
click node_currency_codes "https://github.com/muhammadduryabbakht/currency-converter/blob/main/countrycode.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_page,node_styling,node_user toneBlue
class node_converter toneAmber
class node_currency_codes,node_rates_api,node_flags_api toneMint
```

## Components

### Web interface

- [Converter page](https://github.com/muhammadduryabbakht/currency-converter/blob/main/index.html): `index.html`
- [Responsive styling](https://github.com/muhammadduryabbakht/currency-converter/blob/main/style.css): `style.css`

### Currency conversion

- [Conversion and UI logic](https://github.com/muhammadduryabbakht/currency-converter/blob/main/script.js): `script.js`

### Currency and flags

- [Currency-country map](https://github.com/muhammadduryabbakht/currency-converter/blob/main/countrycode.js): `countrycode.js`

### Other components

- **User**
- **Currency rates API**
- **FlagsAPI**

## Connections

- User → Converter page: uses (evidence: `README.md`)
- Converter page → Conversion and UI logic: provides inputs (evidence: `README.md`)
- Conversion and UI logic → Currency-country map: looks up codes (evidence: `script.js`)
- Conversion and UI logic → Currency rates API: fetches rates (evidence: `script.js`)
- Conversion and UI logic → FlagsAPI: loads flags (evidence: `script.js`)
- Converter page → Responsive styling: uses styles (evidence: `README.md`)
