# muhammad-ibrar727/currency-converter architecture

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

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

## Overview

##### Project type and purpose
- This is a single-page, front-end only web application (“Currency Converter”) built with HTML, CSS, and JavaScript. It consumes a third-party REST API to retrieve live exchange rates and displays conversion results in the browser.

##### File structure
- Top level:
- index.html – Entry point of the UI
- styles.css – All styling rules for layout and responsiveness
- script.js – Client-side logic: event handling, fetching rates, updating the DOM
- screenshot/ – Sample image showing the rendered UI
- README.md – Project description, features, to-run instructions
- No backend code or database; the only external dependency is the public ExchangeRate-API.

##### README for additional insights
- The README confirms the use of the Fetch API to call “https://api.exchangerate-api.com/v4/latest/USD”
- It lists key technologies (HTML/CSS/JavaScript) and highlights a responsive, modern UI.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interaction
    User["User"]:::user

    %% Browser/UI Layer
    subgraph "Browser / UI Layer"
        direction TB
        Index["index.html"]:::frontend
        Styles["styles.css"]:::frontend
    end

    %% Client Logic Layer
    subgraph "Client Logic"
        direction TB
        Script["script.js<br/>• handleInput()<br/>• fetchRates()<br/>• updateDOM()"]:::logic
    end

    %% Network Layer
    FetchAPI["Fetch API<br/>GET /v4/latest/USD"]:::network

    %% External Service
    ExternalAPI["ExchangeRate-API<br/>JSON rates"]:::external

    %% Documentation & Assets
    subgraph "Project Docs & Assets"
        direction TB
        README["README.md"]:::docs
        Screenshot["screenshot/"]:::asset
    end

    %% Connections
    User -->|"inputs amount & selects currencies"| Index
    Index -->|"loads CSS"| Styles
    Index -->|"executes JS"| Script
    Script -->|"calls Fetch()"| FetchAPI
    FetchAPI -->|"returns JSON rates"| Script
    Script -->|"updates DOM"| Index

    README -.->|"project info"| Index
    Screenshot -.->|"UI example"| Index

    %% Click Events
    click Index "https://github.com/muhammad-ibrar727/currency-converter/blob/main/index.html"
    click Styles "https://github.com/muhammad-ibrar727/currency-converter/blob/main/styles.css"
    click Script "https://github.com/muhammad-ibrar727/currency-converter/blob/main/script.js"
    click README "https://github.com/muhammad-ibrar727/currency-converter/blob/main/README.md"
    click Screenshot "https://github.com/muhammad-ibrar727/currency-converter/tree/main/screenshot/"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366d6,color:#0366d6;
    classDef logic fill:#E0FFDC,stroke:#28A745,color:#155724;
    classDef network fill:#FFE8A1,stroke:#DAA520,color:#8B4513;
    classDef external fill:#FFDDE0,stroke:#B31B1B,color:#721C24;
    classDef docs fill:#F0F0F0,stroke:#6A737D,color:#24292E;
    classDef asset fill:#FFF5CC,stroke:#FFDF00,color:#665C00;
    classDef user fill:#FFFFFF,stroke:#666666,color:#000000;
```
