How kgund1751/weather-lab works
Weather Lab is a small Spring Boot service that accepts a weather request, limits requests by client IP, retrieves current conditions from Open-Meteo, and returns a response. The README documents the per-instance fixed-window limit and HTTP 429 behavior. Source excerpts were not provided, so the limiter’s exact wiring and the controller-to-client call structure cannot be confirmed; the graph shows only the documented workflow and avoids asserting those internal links.
Main entry points: WeatherController.java Weather endpoint · InMemoryRateLimiter.java IP rate limiter · OpenMeteoClient.java Open-Meteo client · application.properties Rate-limit settings
Components 11
Request handling
- Weather endpoint
src/main/java/com/example/weatherlab/weather/WeatherController.java - IP rate limiter
src/main/java/com/example/weatherlab/weather/InMemoryRateLimiter.java - Error mapping
src/main/java/com/example/weatherlab/weather/WeatherExceptionHandler.java - Weather response
src/main/java/com/example/weatherlab/weather/WeatherResponse.java - Rate-limit exception
src/main/java/com/example/weatherlab/weather/RateLimitExceededException.java
Weather lookup
- Open-Meteo client
src/main/java/com/example/weatherlab/weather/OpenMeteoClient.java - Open-Meteo
Application runtime
- Spring application
src/main/java/com/example/weatherlab/WeatherLabApplication.java - Web configuration
src/main/java/com/example/weatherlab/weather/WebConfig.java - Rate-limit settings
src/main/resources/application.properties
Other components
- API caller
Connections 5
- API caller → Weather endpoint: requests weather
- Weather endpoint → Weather response: returns response
- Open-Meteo client → Open-Meteo: requests weather
- IP rate limiter → Rate-limit exception: rejects excess
- Rate-limit settings → IP rate limiter: configures limit