Skip to content

pavelerokhin/sync-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sync-API

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.

Quick Start

  1. Copy config/config.example.yaml to config/config.yaml
  2. Add your WeatherAPI key (optional - Open-Meteo works without API key)
  3. Run: make run
  4. API available at http://localhost:8080/weather?lat=40.7128&lon=-74.006&days=5

Some of the implemented features

  • 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%)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published