# Repository Overview

Welcome to this repository. This appears to be a small desktop currency converter written in Java, with a Swing-based user interface and a lightweight API client for exchange-rate lookups. The code is organized into a simple flow: an executable entry point launches the UI, the UI handles user interaction, and the API layer fetches currency data from an external service. If you're new here, this page should help you understand where to start and how the pieces fit together.

## Overview

This repository appears to implement a currency conversion application for desktop use. The application lets a user choose a source currency, choose a target currency, enter an amount, and request a conversion result from an external exchange-rate service.

The codebase is intentionally small and focused. There is an application launcher, a Swing user interface, and an API wrapper that handles remote data access and JSON parsing. Most of the behavior is concentrated in the UI and API layers, with the launcher acting mainly as the startup bridge.

## Technology Stack

The detected stack is straightforward and mostly uses the Java standard library:

- **Java / JDK APIs** for Swing, networking, collections, math, formatting, and properties loading
- **Swing / AWT** for the desktop UI
- **Gson** for parsing JSON responses from the exchange-rate service
- **SLF4J** for logging failures and diagnostics
- **ExchangeRate-API** as the external data source for currency codes and conversion results

No major framework such as Spring, JavaFX, or a web stack was detected from the available files.

## Architecture

At a high level, the repository is split into three top-level modules that form a simple dependency chain:

- `converter` starts the application
- `ui` renders the desktop interface and reacts to user actions
- `api` talks to the remote exchange-rate service

```mermaid
flowchart TD
OverviewModule["Repository Overview"] --> ConverterModule["com.github.blaxk3.converter"]
OverviewModule --> UiModule["com.github.blaxk3.ui"]
OverviewModule --> ApiModule["com.github.blaxk3.api"]
ConverterModule --> UiModule
UiModule --> ApiModule
ApiModule --> ExchangeRateApi["ExchangeRate-API"]
```

The architecture appears to be intentionally direct: the UI calls the API layer without an intermediate service layer, and the launcher simply creates the UI on Swing's Event Dispatch Thread.

## Module Guide

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

This package appears to contain the application entry point. The main class is `CurrencyConverter`, which launches the Swing UI using `SwingUtilities.invokeLater(...)` so the interface is created on the Event Dispatch Thread. If you want to understand how the program starts, this is the first place to read.

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

This package appears to contain the full desktop interface. The main class is `UI`, which builds the window, input field, currency selectors, result label, and action buttons. It also defines two inner helper types: `NumericFilter`, which restricts the amount field to numeric input, and `CurrencyCode`, which loads currency codes in the background so the interface stays responsive.

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

This package appears to provide the application's exchange-rate integration. The main class is `CurrencyRateAPI`, which loads the API key from configuration, builds request URLs, fetches JSON responses, and exposes methods to list currency codes or convert an amount between two currencies. If you need to change how remote data is fetched or parsed, start here.

## Getting Started

If you are exploring the codebase for the first time, 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, event handlers, and input validation.
3. **`src/main/java/com/github/blaxk3/api/CurrencyRateAPI.java`** — then inspect the API client to see how currency data is fetched and converted.
4. **`config.properties` or equivalent runtime configuration** — check how the API key is supplied, since the API client depends on it.

A few practical entry points are worth keeping in mind:

- `CurrencyConverter.main(...)` starts the application
- `UI.UI()` builds and shows the window
- `CurrencyRateAPI.getCurrencyCode()` loads the list of supported currency codes
- `CurrencyRateAPI.convert(...)` performs the conversion request

For the quickest orientation, read the launcher first, then the UI, then the API client. That path mirrors the runtime flow of the application.

## Module Notes

- The code appears to assume the exchange-rate service is available at runtime, so network access is part of normal operation.
- The UI and API layers are closely coupled, which makes the system easy to follow but also means changes to the API response shape may affect the UI directly.
- Input validation is intentionally simple and limited to numeric text with a single decimal point.
- Because the project is small, there is no separate service, domain, or persistence layer to learn before you can start navigating the code.
