# hajju0617/vworld-weather-api architecture

> Architecture diagram of the GitHub repository hajju0617/vworld-weather-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hajju0617/vworld-weather-api
- Repository: https://github.com/hajju0617/vworld-weather-api

## Overview

This Spring MVC weather service accepts a location, resolves it to coordinates with V-World, fetches current conditions and a five-day/three-hour forecast from OpenWeatherMap, and returns a normalized JSON response. The root route serves a Thymeleaf weather page; README says the page displays backend JSON. The service and DTO logic are excerpted, while the template’s request behavior is not shown, so that link is documented rather than source-verified.

Main entry points: [`src/main/java/com/project/weatherservice/service/WeatherService.java`](https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/service/WeatherService.java) (Weather service), [`src/main/java/com/project/weatherservice/controller/WeatherController.java`](https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/controller/WeatherController.java) (Weather endpoint), [`src/main/java/com/project/weatherservice/controller/ViewController.java`](https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/controller/ViewController.java) (Page route), [`src/main/resources/templates/weather.html`](https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/resources/templates/weather.html) (Weather page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_view["Page route"]
  node_page["Weather page<br/>[weather.html]"]
  node_weather_api["Weather endpoint"]
end

subgraph group_weather["Weather workflow"]
  node_geocode["Geocode service<br/>[VWorldService.java]"]
  node_weather_service["Weather service"]
  node_rest_config["REST client setup"]
end

subgraph group_integration["External APIs"]
  node_vworld{{"V-WORLD geocoder"}}
  node_openweather{{"OpenWeatherMap"}}
end

subgraph group_response["Response model"]
  node_current["Current conditions<br/>[CurrentDto.java]"]
  node_forecast["Daily forecast<br/>[ForecastDto.java]"]
  node_response_dto["Weather response"]
end

node_user(("User"))

node_user -->|"opens page"| node_view
node_view -->|"renders"| node_page
node_user -.->|"submits location"| node_weather_api
node_weather_api -->|"resolves location"| node_geocode
node_geocode -->|"requests coordinates"| node_vworld
node_weather_api -->|"gets weather"| node_weather_service
node_weather_service -->|"fetches conditions and forecast"| node_openweather
node_weather_service -->|"builds"| node_current
node_weather_service -->|"builds"| node_forecast
node_weather_service -->|"assembles"| node_response_dto
node_weather_api -->|"returns JSON"| node_response_dto
node_page -.->|"requests and displays"| node_weather_api

click node_view "https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/controller/ViewController.java"
click node_page "https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/resources/templates/weather.html"
click node_weather_api "https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/controller/WeatherController.java"
click node_geocode "https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/service/VWorldService.java"
click node_weather_service "https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/service/WeatherService.java"
click node_current "https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/dto/CurrentDto.java"
click node_forecast "https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/dto/ForecastDto.java"
click node_response_dto "https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/dto/WeatherResponseDto.java"
click node_rest_config "https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/config/RestClientConfig.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_view,node_page,node_weather_api,node_user toneBlue
class node_geocode,node_weather_service,node_rest_config toneAmber
class node_vworld,node_openweather toneMint
class node_current,node_forecast,node_response_dto toneRose
```

## Components

### Web interface

- [Page route](https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/controller/ViewController.java): `src/main/java/com/project/weatherservice/controller/ViewController.java`
- [Weather page](https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/resources/templates/weather.html): `src/main/resources/templates/weather.html`
- [Weather endpoint](https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/controller/WeatherController.java): `src/main/java/com/project/weatherservice/controller/WeatherController.java`

### Weather workflow

- [Geocode service](https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/service/VWorldService.java): `src/main/java/com/project/weatherservice/service/VWorldService.java`
- [Weather service](https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/service/WeatherService.java): `src/main/java/com/project/weatherservice/service/WeatherService.java`
- [REST client setup](https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/config/RestClientConfig.java): `src/main/java/com/project/weatherservice/config/RestClientConfig.java`

### External APIs

- **V-WORLD geocoder**
- **OpenWeatherMap**

### Response model

- [Current conditions](https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/dto/CurrentDto.java): `src/main/java/com/project/weatherservice/dto/CurrentDto.java`
- [Daily forecast](https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/dto/ForecastDto.java): `src/main/java/com/project/weatherservice/dto/ForecastDto.java`
- [Weather response](https://github.com/hajju0617/vworld-weather-api/blob/main/src/main/java/com/project/weatherservice/dto/WeatherResponseDto.java): `src/main/java/com/project/weatherservice/dto/WeatherResponseDto.java`

### Other components

- **User**

## Connections

- User → Page route: opens page (evidence: `src/main/java/com/project/weatherservice/controller/ViewController.java`)
- Page route → Weather page: renders (evidence: `src/main/java/com/project/weatherservice/controller/ViewController.java`)
- User → Weather endpoint: submits location (evidence: `README.md`)
- Weather endpoint → Geocode service: resolves location (evidence: `src/main/java/com/project/weatherservice/controller/WeatherController.java`)
- Geocode service → V-WORLD geocoder: requests coordinates (evidence: `src/main/java/com/project/weatherservice/service/VWorldService.java`)
- Weather endpoint → Weather service: gets weather (evidence: `src/main/java/com/project/weatherservice/controller/WeatherController.java`)
- Weather service → OpenWeatherMap: fetches conditions and forecast (evidence: `src/main/java/com/project/weatherservice/service/WeatherService.java`)
- Weather service → Current conditions: builds (evidence: `src/main/java/com/project/weatherservice/service/WeatherService.java`)
- Weather service → Daily forecast: builds (evidence: `src/main/java/com/project/weatherservice/service/WeatherService.java`)
- Weather service → Weather response: assembles (evidence: `src/main/java/com/project/weatherservice/service/WeatherService.java`)
- Weather endpoint → Weather response: returns JSON (evidence: `src/main/java/com/project/weatherservice/controller/WeatherController.java`)
- Weather page → Weather endpoint: requests and displays (evidence: `README.md`)
