# ryan-uga/javafx-weather-gui architecture

> Architecture diagram of the GitHub repository ryan-uga/javafx-weather-gui, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ryan-uga/javafx-weather-gui
- Repository: https://github.com/ryan-uga/javafx-weather-gui

## Overview

ApiApp is a JavaFX weather-forecast application. A user enters a city; the app geocodes it with OpenCage, uses the resulting coordinates to request NWS point metadata, follows the forecast link in that response, and displays forecast periods. ApiApp owns the HTTP workflow and dispatches UI updates to forecast components. The README documents repeated searches and error handling; the excerpts show the main orchestration and rendering, but not every request or error branch. OpenLibrarySearchApi is included as a substantial source module, though its role in the documented workflow is unclear.

Main entry points: [`src/main/java/cs1302/api/ApiApp.java`](https://github.com/ryan-uga/javafx-weather-gui/blob/main/src/main/java/cs1302/api/ApiApp.java) (Weather app), [`src/main/java/cs1302/api`](https://github.com/ryan-uga/javafx-weather-gui/tree/main/src/main/java/cs1302/api) (Forecast response models), [`src/main/java/cs1302/api/CustomComponent.java`](https://github.com/ryan-uga/javafx-weather-gui/blob/main/src/main/java/cs1302/api/CustomComponent.java) (Forecast row), [`src/main/java/cs1302/api/Periods.java`](https://github.com/ryan-uga/javafx-weather-gui/blob/main/src/main/java/cs1302/api/Periods.java) (Forecast periods)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_driver["JavaFX driver<br/>[ApiDriver.java]"]
end

subgraph group_workflow["Forecast workflow"]
  node_app["Weather app<br/>[ApiApp.java]"]
  node_library["OpenLibrary search API"]
end

subgraph group_models["Response models"]
  node_ocmodels["Geocode response models"]
  node_nwsmodels["Forecast response models"]
  node_period["Forecast periods<br/>[Periods.java]"]
end

subgraph group_presentation["Forecast display"]
  node_component["Forecast row"]
end

node_user(("City searcher"))
node_opencage{{"OpenCage API"}}
node_nws{{"NWS API"}}

node_user -->|"enters city"| node_app
node_driver -->|"launches"| node_app
node_app -->|"geocodes city"| node_opencage
node_app -->|"parses response"| node_ocmodels
node_app -->|"requests point data"| node_nws
node_app -->|"requests forecast"| node_nws
node_app -->|"parses response"| node_nwsmodels
node_nwsmodels -->|"contains periods"| node_period
node_app -->|"updates display"| node_component
node_component -->|"reads forecast"| node_period

click node_driver "https://github.com/ryan-uga/javafx-weather-gui/blob/main/src/main/java/cs1302/api/ApiDriver.java"
click node_app "https://github.com/ryan-uga/javafx-weather-gui/blob/main/src/main/java/cs1302/api/ApiApp.java"
click node_ocmodels "https://github.com/ryan-uga/javafx-weather-gui/tree/main/src/main/java/cs1302/api"
click node_nwsmodels "https://github.com/ryan-uga/javafx-weather-gui/tree/main/src/main/java/cs1302/api"
click node_period "https://github.com/ryan-uga/javafx-weather-gui/blob/main/src/main/java/cs1302/api/Periods.java"
click node_component "https://github.com/ryan-uga/javafx-weather-gui/blob/main/src/main/java/cs1302/api/CustomComponent.java"
click node_library "https://github.com/ryan-uga/javafx-weather-gui/blob/main/src/main/java/cs1302/api/OpenLibrarySearchApi.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_driver toneBlue
class node_app,node_library toneAmber
class node_ocmodels,node_nwsmodels,node_period,node_opencage,node_nws toneMint
class node_component toneRose
class node_user toneIndigo
```

## Components

### Application entry

- [JavaFX driver](https://github.com/ryan-uga/javafx-weather-gui/blob/main/src/main/java/cs1302/api/ApiDriver.java): `src/main/java/cs1302/api/ApiDriver.java`

### Forecast workflow

- [Weather app](https://github.com/ryan-uga/javafx-weather-gui/blob/main/src/main/java/cs1302/api/ApiApp.java): `src/main/java/cs1302/api/ApiApp.java`
- [OpenLibrary search API](https://github.com/ryan-uga/javafx-weather-gui/blob/main/src/main/java/cs1302/api/OpenLibrarySearchApi.java): `src/main/java/cs1302/api/OpenLibrarySearchApi.java`

### Response models

- [Geocode response models](https://github.com/ryan-uga/javafx-weather-gui/tree/main/src/main/java/cs1302/api): `src/main/java/cs1302/api`
- [Forecast response models](https://github.com/ryan-uga/javafx-weather-gui/tree/main/src/main/java/cs1302/api): `src/main/java/cs1302/api`
- [Forecast periods](https://github.com/ryan-uga/javafx-weather-gui/blob/main/src/main/java/cs1302/api/Periods.java): `src/main/java/cs1302/api/Periods.java`

### Forecast display

- [Forecast row](https://github.com/ryan-uga/javafx-weather-gui/blob/main/src/main/java/cs1302/api/CustomComponent.java): `src/main/java/cs1302/api/CustomComponent.java`

### Other components

- **City searcher**
- **OpenCage API**
- **NWS API**

## Connections

- City searcher → Weather app: enters city (evidence: `README.md`)
- JavaFX driver → Weather app: launches (evidence: `src/main/java/cs1302/api/ApiDriver.java`)
- Weather app → OpenCage API: geocodes city (evidence: `README.md`)
- Weather app → Geocode response models: parses response (evidence: `src/main/java/cs1302/api/ApiApp.java`)
- Weather app → NWS API: requests point data (evidence: `README.md`)
- Weather app → NWS API: requests forecast (evidence: `README.md`)
- Weather app → Forecast response models: parses response (evidence: `src/main/java/cs1302/api/ApiApp.java`)
- Forecast response models → Forecast periods: contains periods (evidence: `src/main/java/cs1302/api/Properties.java`)
- Weather app → Forecast row: updates display (evidence: `src/main/java/cs1302/api/ApiApp.java`)
- Forecast row → Forecast periods: reads forecast (evidence: `src/main/java/cs1302/api/CustomComponent.java`)
