This is a weather forecast aggregation API built with Go that fetches weather data from multiple external providers (Open-Meteo and WeatherAPI) and returns consolidated forecasts for any given location. The API accepts latitude/longitude coordinates and forecast window parameters, makes parallel requests to configured weather services, and returns a unified JSON response containing forecasts from all available providers. The project follows DDD principles with a clean architecture that separates concerns into controllers, services, and repositories, making it easy to add new weather data providers by implementing the Repository interface.
- Copy
config/config.example.yamltoconfig/config.yaml - Add your WeatherAPI key (optional - Open-Meteo works without API key)
- Run:
make run - API available at
http://localhost:8080/weather?lat=40.7128&lon=-74.006&days=5
- Multi-provider weather aggregation (Open-Meteo, WeatherAPI)
- Concurrent data fetching with goroutines
- Health & readiness probes (/health, /ready on port 8081)
- Swagger documentation (/swagger/)
- Input validation (coordinates, forecast window)
- Retry logic with exponential backoff
- Structured logging with Zap
- Graceful shutdown
- Docker support
- Clean DDD architecture
- High test coverage (>90%)