How sivakumar-swaminathan/auweather works
Purpose and Runtime
This is a standalone Java 11+/Spring Boot 2.7 weather application serving a lightweight single-page UI and backend API from one Gradle-built JAR. It provides multi-city Australian weather forecasts, sourced from OpenWeather, with documented Auth0 authentication, temperature alerts, and fault-tolerance goals. Main entry point: src/main/java/org/wealther/demo/WeatherMapApplication.java.
Application Bootstrap and Web Delivery
Spring Boot initializes the application context and HTTP server from WeatherMapApplication.java. Static SPA assets are packaged under src/main/resources/static/, including the landing page (index.html), Australian weather view (auweather.html), and browser logic (js/auweather.js). src/main/java/org/wealther/demo/service/WebConfig.java is the central web configuration boundary, likely governing routing/static-resource or MVC behavior.
HTTP/API Boundary
src/main/java/org/wealther/demo/controller/WeatherMapController.java is the server-side request boundary. It accepts weather lookup requests from the SPA and delegates business/data retrieval rather than exposing provider-specific behavior directly to browser code. The UI sends user city input through src/main/resources/static/js/auweather.js; results are rendered in the static pages.
Weather Retrieval Service
src/main/java/org/wealther/demo/service/WeatherMapService.java is the core orchestration layer for forecast retrieval. It forms the boundary to the external OpenWeather API, converts provider responses into application models, and is the expected location for resilience and alert-related policy. src/main/resources/application.yaml holds runtime configuration, including likely API/provider settings and application behavior.
Domain and Transformation Model
Weather data is represented by src/main/java/org/wealther/demo/model/WeatherBase.java and src/main/java/org/wealther/demo/model/WeatherMap.java. These models isolate controller/UI consumers from raw OpenWeather payloads. src/main/java/org/wealther/demo/utility/WeatherMapHelper.java performs supporting transformation, parsing, or weather-summary logic between external response data and domain output.
Errors and Fault Boundaries
Provider, validation, and application failures are represented through src/main/java/org/wealther/demo/utility/WeatherMapBaseError.java and src/main/java/org/wealther/demo/utility/WeatherMapError.java. src/main/java/org/wealther/demo/utility/WeatherMapExceptionHandler.java centralizes exception-to-HTTP error mapping, preserving a consistent API error boundary for the SPA. A static fallback page exists at src/main/resources/static/error/404.html.
External Dependencies and Delivery
The material external service is OpenWeather (openweathermap.org) for four-day forecast data; Auth0 is documented as the authentication provider, though its implementation is not visible in this tree. Gradle is the build and dependency boundary (build.gradle, settings.gradle), with wrapper-based builds. The application is designed for combined frontend/backend deployment as a standalone JAR and, per README, can be packaged into a Docker container.
Main entry points: WeatherMapService.java WeatherMapService · WeatherMapController.java WeatherMapController · WeatherMapApplication.java WeatherMapApplication · WebConfig.java WebConfig
Components 18
Web delivery
- Static SPA pages · Landing and Australian weather pages.
- auweather.js · Sends city lookups and renders forecast results.
src/main/resources/static/js/auweather.js - 404 fallback
src/main/resources/static/error/404.html
Spring backend
- WeatherMapApplication · Starts the application context and HTTP server.
src/main/java/org/wealther/demo/WeatherMapApplication.java - WebConfig · Central web routing and static-resource boundary.
src/main/java/org/wealther/demo/service/WebConfig.java - WeatherMapController · API boundary between the SPA and weather retrieval.
src/main/java/org/wealther/demo/controller/WeatherMapController.java - WeatherMapService · Retrieves forecasts and applies resilience and alert policy.
src/main/java/org/wealther/demo/service/WeatherMapService.java - WeatherMapExceptionHandler · Maps application failures to consistent HTTP errors.
src/main/java/org/wealther/demo/utility/WeatherMapExceptionHandler.java - application.yaml · Provides provider and application settings.
src/main/resources/application.yaml
Weather domain
- WeatherMapHelper · Parses and summarizes provider weather data.
src/main/java/org/wealther/demo/utility/WeatherMapHelper.java - WeatherBase
src/main/java/org/wealther/demo/model/WeatherBase.java - WeatherMap · Application-facing forecast output.
src/main/java/org/wealther/demo/model/WeatherMap.java - WeatherMapBaseError
src/main/java/org/wealther/demo/utility/WeatherMapBaseError.java - WeatherMapError · Represents provider, validation, and application failures.
src/main/java/org/wealther/demo/utility/WeatherMapError.java
External services
- OpenWeather · External four-day forecast API.
- Auth0 · Documented provider; implementation is not visible.
Other components
- Gradle build · Builds the standalone executable JAR.
build.gradle - Standalone JAR · Packages frontend and backend for deployment.
Connections 20
- Gradle build → Standalone JAR: packages
- Standalone JAR → WeatherMapApplication: runs
- WeatherMapApplication → WebConfig: initializes
- WeatherMapApplication → WeatherMapController: serves
- WebConfig → Static SPA pages: delivers
- WebConfig → 404 fallback: serves on 404
- Static SPA pages → auweather.js: loads
- auweather.js → WeatherMapController: weather lookup
- WeatherMapController → WeatherMapService: delegates
- WeatherMapService → OpenWeather: fetches forecasts
- WeatherMapService → WeatherMapHelper: transforms with
- WeatherMapHelper → WeatherBase: parses
- WeatherMapHelper → WeatherMap: produces
- WeatherMapController → WeatherMap: returns
- application.yaml → WeatherMapService: configures
- WeatherMapService → WeatherMapError: raises
- WeatherMapError → WeatherMapBaseError: extends
- WeatherMapExceptionHandler → WeatherMapError: maps
- WeatherMapExceptionHandler → WeatherMapController: HTTP errors
- Auth0 → WeatherMapApplication: documented integration