# jindal2004keshav/currency-exchange architecture

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

- Interactive diagram: https://gitdiagram.com/jindal2004keshav/currency-exchange
- Repository: https://github.com/jindal2004keshav/currency-exchange

## Overview

##### Project Type & Purpose
- This is a front-end project with a focus on currency conversion.
- It is built entirely with HTML, CSS, and JavaScript and uses an external Exchange Rate API for real-time data.
- The application is simple and user-friendly, focusing on converting one currency to another with a clean interface.

##### Analyzing the File Structure
- Top-level Files:
- index.html: The primary entry point that constructs the web page UI.
- style.css: Handles the visual styling of the UI.
- app.js and code.js: Contain the application’s main logic. They likely handle user interactions, API calls, and calculations.
- vanilla-tilt.js: Adds dynamic visual effects to the interface for an enhanced user experience.
- README.md: Documentation outlining primary functionalities.
- There is no explicit backend folder or server-side code; the logic is fully contained in the client side.

a. Main Components to Include:
- User Interface Layer:
- Represented by index.html and styled by style.css.
- Contains interactive elements enhanced by vanilla-tilt.js.
- Application Logic:
- Represented by app.js and code.js.
- Manages user inputs, interactions, and internal state.
- External Service:
- Exchange Rate API, which supplies the real-time currency data.

b. Relationships and Interactions:
- The UI layer receives input from the user (currency selection, amount, etc.) and passes these inputs to the application logic.
- The application logic processes the input and then makes asynchronous calls to the external Exchange Rate API.
- Updated currency conversion data is then returned to the application logic, which updates the UI with the correct exchange information.

c. Architectural Patterns:
- This project is structured following a client-side separation between presentation (HTML/CSS) and business logic (JavaScript modules).
- It follows a simple MVC or separation-of-concerns approach where the view is the HTML/CSS, the controller logic is spread out in JS files, and the model is represented by the external API data.

d. Relevant Technologies & Libraries:
- HTML and CSS: For structuring and styling the UI.
- Vanilla JavaScript: Handles the business and interaction logic.
- vanilla-tilt.js: A library for implementing interactive effects.
- Third-party Exchange Rate API: Provides dynamic exchange rate data.

## Diagram (Mermaid)

```mermaid
flowchart TD
    U("User"):::user

    subgraph "User Interface Layer"
        UI1("index.html"):::ui
        UI2("style.css"):::ui
        UI3("vanilla-tilt.js"):::ui
    end

    subgraph "Application Logic"
        AL1("app.js"):::logic
        AL2("code.js"):::logic
    end

    E("Exchange Rate API"):::api

    U -->|"providesInput"| UI1
    U -->|"providesInput"| UI2
    U -->|"providesInput"| UI3
    UI1 -->|"triggersLogic"| AL1
    UI2 -->|"aidingDisplay"| AL1
    UI3 -->|"enhancesUI"| UI1
    AL1 -->|"processes"| AL2
    AL1 -->|"callAPI"| E
    E -->|"returnData"| AL1
    AL1 -->|"updateUI"| UI1
    AL1 -->|"updateStyle"| UI2

    click UI1 "https://github.com/jindal2004keshav/currency-exchange/blob/main/index.html"
    click UI2 "https://github.com/jindal2004keshav/currency-exchange/blob/main/style.css"
    click UI3 "https://github.com/jindal2004keshav/currency-exchange/blob/main/vanilla-tilt.js"
    click AL1 "https://github.com/jindal2004keshav/currency-exchange/blob/main/app.js"
    click AL2 "https://github.com/jindal2004keshav/currency-exchange/blob/main/code.js"

    classDef ui fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef logic fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef api fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef user fill:#fff3cd,stroke:#856404,stroke-width:2px;
```
