# Repository Overview

Welcome to this repository. This appears to be a small Java desktop application for converting currencies through an external exchange-rate service. The code is organized into a simple startup layer, a Swing-based user interface, and an API wrapper that talks to ExchangeRate API v6. It looks lightweight and focused, which should make it approachable for a new contributor.

## Overview

This repository appears to implement a currency converter application with a desktop UI. Users can choose source and target currencies, enter an amount, and request a conversion result from an external API. The codebase is split into a launcher, a UI package, and an API package, with most of the behavior concentrated in a few classes.

At a high level, the flow is:

1. The application starts in the converter module.
2. The Swing UI is created on the event dispatch thread.
3. The UI loads supported currency codes in the background.
4. Conversion requests are sent to the ExchangeRate service.
5. The response is displayed back in the UI.

## Technology Stack

This repository appears to use:

- **Java** as the primary language
- **Swing / AWT** for the desktop user interface
- **Gson** for JSON parsing
- **SLF4J** for logging
- **Java networking APIs** such as `HttpURLConnection` and `URL`
- **`BigDecimal`** for conversion amounts and numeric handling

No well-known web framework or application framework was detected from the imports. The application appears to be a straightforward Java desktop program with a small number of dependencies.

## Architecture

The architecture is intentionally simple: a launcher starts the UI, the UI handles user interaction, and the API wrapper handles remote exchange-rate requests. The UI depends on the API layer for currency data and conversion results, while the API layer depends on a local `config.properties` file for the API key.

```mermaid
flowchart TD
Overview["Repository Overview"] --> Converter["com.github.blaxk3.converter"]
Overview --> UI["com.github.blaxk3.ui"]
Overview --> API["com.github.blaxk3.api"]
Converter --> UI
UI --> API
API --> ExchangeRate["ExchangeRate API v6"]
API --> Config["config.properties"]
```

## Module Guide

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

This module appears to be the application entry point. It contains [`CurrencyConverter`](src/main/java/com/github/blaxk3/converter/CurrencyConverter.java:7), which starts the UI by calling `SwingUtilities.invokeLater(...)`. There is no business logic here; its main purpose is to launch the desktop application safely on the Swing event dispatch thread.

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

This module appears to contain the main desktop interface. [`UI`](src/main/java/com/github/blaxk3/ui/UI.java:30) builds the window, lays out the controls, handles button actions, and coordinates conversion behavior. It also includes [`NumericFilter`](src/main/java/com/github/blaxk3/ui/UI.java:167), which restricts the amount field to numeric input, and [`CurrencyCode`](src/main/java/com/github/blaxk3/ui/UI.java:214), which loads currency codes in the background and fills the combo boxes.

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

This module appears to wrap the external exchange-rate service. [`CurrencyRateAPI`](src/main/java/com/github/blaxk3/api/CurrencyRateAPI.java:19) loads the API key, builds request URLs, performs HTTP GET requests, parses JSON responses, and exposes helper methods for retrieving supported currency codes and conversion results. It is the main integration point with the remote service.

## Getting Started

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

1. [`CurrencyConverter`](src/main/java/com/github/blaxk3/converter/CurrencyConverter.java:7) — start here to see how the application launches.
2. [`UI`](src/main/java/com/github/blaxk3/ui/UI.java:30) — read next to understand the main window, user actions, and background loading.
3. [`NumericFilter`](src/main/java/com/github/blaxk3/ui/UI.java:167) — review this to understand how amount input is constrained.
4. [`CurrencyCode`](src/main/java/com/github/blaxk3/ui/UI.java:214) — this shows how currency lists are fetched and populated asynchronously.
5. [`CurrencyRateAPI`](src/main/java/com/github/blaxk3/api/CurrencyRateAPI.java:19) — finish here to see how the app talks to the exchange-rate service.

A practical first pass through the repository would be:

- identify the startup path in the converter module,
- inspect the UI constructor and button handlers,
- trace how currency codes are loaded,
- then follow the API wrapper methods that reach the external service.

### Entry points and main classes

- **Application entry point:** [`CurrencyConverter.main(String[] args)`](src/main/java/com/github/blaxk3/converter/CurrencyConverter.java:8)
- **Primary UI class:** [`UI`](src/main/java/com/github/blaxk3/ui/UI.java:30)
- **API wrapper:** [`CurrencyRateAPI`](src/main/java/com/github/blaxk3/api/CurrencyRateAPI.java:19)
- **Input validation helper:** [`NumericFilter`](src/main/java/com/github/blaxk3/ui/UI.java:167)
- **Background loader:** [`CurrencyCode`](src/main/java/com/github/blaxk3/ui/UI.java:214)

## Module Relationships

- The **converter** module depends on the **ui** module to show the application window.
- The **ui** module depends on the **api** module to fetch currency codes and conversion values.
- The **api** module depends on external ExchangeRate API responses and a local `config.properties` file for configuration.

## Notes for New Contributors

- The application appears to be small enough that most behavior can be understood by reading just three classes.
- The UI is created on the Swing event dispatch thread, so any future UI work should respect Swing threading rules.
- Currency data is loaded asynchronously, so the combo boxes may be empty briefly at startup.
- Configuration is externalized through `config.properties`, so make sure the API key is available in your local run or test environment.

Overall, this repository looks like a compact Java Swing application with a clear separation between startup, UI, and API integration.