# goodviet/currency-converter architecture

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

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

## Overview

##### Project type and purpose
- This is a cross-platform mobile (and desktop/web) Currency Converter app built with Flutter (Dart).
- It fetches real-time exchange rates from a third-party API (exchangerate-api.com) and exposes a simple UI for users to enter an amount, pick base and target currencies, and view conversion results.

##### File structure analysis
- Top-level “currency” folder contains platform integrations (android/, ios/, linux/, macos/, windows/, web/) generated by Flutter.
- The application logic lives under lib/:
- lib/main.dart – app entrypoint and routing
- lib/home.screen.dart – main UI screen
- lib/service/service.app.dart – HTTP client for exchangerate-api.com
- lib/widget/*.dart – reusable UI components (button, dropdown, textfield)
- pubspec.yaml / pubspec.lock declare Flutter and Dart dependencies.
- test/ holds widget tests.

##### README insights
- Describes features (currency selection, amount entry, auto-update rates, reset).
- Technology stack: Flutter/Dart + exchangerate-api.com HTTP API.
- No custom backend—relies entirely on a remote REST API.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Platform Layer
    subgraph "Platform Layer"
        Android["Android"]:::platform
        iOS["iOS"]:::platform
        Web["Web"]:::platform
        Linux["Linux"]:::platform
        macOS["macOS"]:::platform
        Windows["Windows"]:::platform
    end

    %% Engine Layer
    subgraph "Flutter Engine & Framework"
        DartVM["Dart VM & Rendering"]:::engine
        LinuxEngine["Linux Engine Bindings"]:::engine
        MacOSPlugin["macOS Plugin Registrant"]:::engine
        WindowsPlugin["Windows Plugin Registrant"]:::engine
    end

    %% Application Code
    subgraph "Application Code"
        subgraph "UI Layer (Widgets)"
            HomeScreen["Home Screen"]:::ui
            Button["Button Widget"]:::ui
            Dropdown["Dropdown Widget"]:::ui
            TextField["TextField Widget"]:::ui
        end
        subgraph "Service Layer (HTTP Client)"
            ServiceApp["Service Layer"]:::service
        end
    end

    %% External API
    ExternalAPI["exchangerate-api.com REST API"]:::external

    %% Test Harness
    TestHarness["Widget Tests"]:::test

    %% Connections
    Android --> DartVM
    iOS --> DartVM
    Web --> DartVM
    Linux --> LinuxEngine
    macOS --> MacOSPlugin
    Windows --> WindowsPlugin

    DartVM --> HomeScreen
    DartVM --> ServiceApp

    HomeScreen -->|user action| ServiceApp
    ServiceApp -->|HTTP GET| ExternalAPI
    ExternalAPI -->|JSON response| ServiceApp
    ServiceApp -->|data| HomeScreen
    HomeScreen -->|render/update| HomeScreen

    TestHarness -->|widget tests| HomeScreen

    %% Click Events
    click Android "https://github.com/goodviet/currency-converter/tree/master/currency/android"
    click iOS "https://github.com/goodviet/currency-converter/tree/master/currency/ios"
    click Web "https://github.com/goodviet/currency-converter/tree/master/currency/web"
    click Linux "https://github.com/goodviet/currency-converter/tree/master/currency/linux"
    click macOS "https://github.com/goodviet/currency-converter/tree/master/currency/macos"
    click Windows "https://github.com/goodviet/currency-converter/tree/master/currency/windows"
    click LinuxEngine "https://github.com/goodviet/currency-converter/tree/master/currency/linux/flutter"
    click MacOSPlugin "https://github.com/goodviet/currency-converter/tree/master/currency/macos/Flutter"
    click WindowsPlugin "https://github.com/goodviet/currency-converter/tree/master/currency/windows/flutter"
    click HomeScreen "https://github.com/goodviet/currency-converter/blob/master/lib/home.screen.dart"
    click Button "https://github.com/goodviet/currency-converter/blob/master/lib/widget/button.widget.dart"
    click Dropdown "https://github.com/goodviet/currency-converter/blob/master/lib/widget/dropdown.widget.dart"
    click TextField "https://github.com/goodviet/currency-converter/blob/master/lib/widget/textfield.widget.dart"
    click ServiceApp "https://github.com/goodviet/currency-converter/blob/master/lib/service/service.app.dart"
    click TestHarness "https://github.com/goodviet/currency-converter/blob/master/test/widget_test.dart"

    %% Styles
    classDef platform fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef engine fill:#90EE90,stroke:#000,stroke-width:1px
    classDef ui fill:#FFFACD,stroke:#000,stroke-width:1px
    classDef service fill:#E0FFFF,stroke:#000,stroke-width:1px
    classDef external fill:#FFA500,stroke:#000,stroke-width:1px
    classDef test fill:#FFB6C1,stroke:#000,stroke-width:1px
```
