# Repository Overview

Welcome to this repository. This appears to be a small Java desktop application for converting currencies, with a Swing-based user interface and a lightweight API client that talks to an external exchange-rate service. The codebase is compact, which makes it a good place to get oriented quickly: one package launches the app, one package renders the UI, and one package handles remote rate lookups. There do not appear to be any major frameworks here, so most of the behavior is built with standard Java, Swing, and a couple of common libraries.

## Overview

This repository appears to implement a simple currency converter. The application launches a desktop window where a user can enter an amount, choose source and target currencies, and request a conversion result. The UI layer handles the interaction flow, while a separate API layer fetches currency codes and conversion data from a remote service.

The code structure suggests a clear separation of concerns:
- `com.github.blaxk3.converter` starts the application
- `com.github.blaxk3.ui` owns the desktop interface and user interactions
- `com.github.blaxk3.api` encapsulates remote exchange-rate access

## Technology Stack

Based on the available source, this project appears to use:

- **Java** — the application language and runtime
- **Swing / AWT** — for the desktop UI
- **Gson** — for parsing JSON responses from the exchange-rate service
- **SLF4J** — for logging errors and failures
- **Standard Java networking APIs** — such as `HttpURLConnection`, `URL`, and `URI`

No well-known application framework is detected from import analysis, so the repository appears to be intentionally lightweight and direct.

## Architecture

At a high level, the application is organized into three layers: startup, presentation, and remote data access. The startup module creates the UI on Swing's Event Dispatch Thread. The UI module renders controls, validates input, and orchestrates user actions. The API module reaches out to the external exchange-rate service and returns the data the UI needs.

```mermaid
flowchart TD
ConverterModule["com.github.blaxk3.converter"] --> UIClass["com.github.blaxk3.ui.UI"]
UIClass --> APIClass["com.github.blaxk3.api.CurrencyRateAPI"]
UIClass --> NumericFilterClass["UI.NumericFilter"]
UIClass --> CurrencyCodeClass["UI.CurrencyCode"]
CurrencyCodeClass --> APIClass
APIClass --> ExchangeRateService["ExchangeRate API"]
APIClass --> ConfigFile["config.properties"]
```

In practice, the data flow appears to be:

1. The launcher starts the Swing UI.
2. The UI creates the window and loads available currency codes in the background.
3. The API client reads configuration, calls the exchange-rate service, and parses JSON responses.
4. The UI formats and displays the result to the user.

## Module Guide

### `com.github.blaxk3.converter`

This appears to be the application entry point. The package contains `CurrencyConverter`, which provides the `main` method and starts the UI using `SwingUtilities.invokeLater(...)`. Its role is deliberately small: it ensures the desktop interface is created on the correct Swing thread and then hands off control to the UI layer.

### `com.github.blaxk3.ui`

This appears to be the main presentation layer. The central class is `UI`, which builds the frame, amount field, currency combo boxes, result label, and action buttons. It also contains two inner helpers: `NumericFilter`, which limits the amount field to numeric input, and `CurrencyCode`, which loads currency codes asynchronously so the window can stay responsive.

### `com.github.blaxk3.api`

This appears to be the integration layer for the external exchange-rate service. The main class is `CurrencyRateAPI`, which reads an API key from `config.properties`, builds request URLs, fetches JSON payloads, and exposes higher-level helpers for currency code lookup and pair conversion. This package isolates all remote-service concerns away from the UI.

## Getting Started

If you are new to the codebase, a good reading order is:

1. **`src/main/java/com/github/blaxk3/converter/CurrencyConverter.java`** — start here to see how the application launches.
2. **`src/main/java/com/github/blaxk3/ui/UI.java`** — read next to understand the window layout, button behavior, and input handling.
3. **`src/main/java/com/github/blaxk3/api/CurrencyRateAPI.java`** — finish here to see how currency codes and conversion results are fetched.

A few useful orientation points:

- `CurrencyConverter.main(...)` is the executable entry point.
- `UI` is the best place to look for user interaction flow.
- `CurrencyRateAPI` is the best place to look for remote API behavior and configuration handling.
- `NumericFilter` explains how the amount field is constrained.
- `CurrencyCode` explains how the currency dropdowns are populated without blocking the UI.

If you want to understand the full user journey, follow the path from `main` to `UI` to `CurrencyRateAPI`, since that appears to be the main runtime pipeline in this repository.
