Weather Service Application

by khalidmnor

187 downloads
Not rated
GitHub

About

Simple implementation of MCP Server for WeatherAPI.com using SpringBoot

Details

Author
khalidmnor
Downloads
187
Categories
Media

- Fetch current weather details by city name.
- Built with Java 21 and Kotlin.
- Uses Spring Boot 3.4.5 and reactive WebClient.
- Configurable API properties via application.yml.
- Logs weather information for debugging.
- Returns JSON responses for easy integration.
- Modular design with DTOs for clean data handling.

Install Java 21 and Maven 3.8+, then configure the API properties (base-url, endpoint, api-key) in application.yml. Start the application and invoke GET /weather?city={cityName} to retrieve weather data for the specified city.

Weather Service Application

This project is a Spring Boot application that provides weather information by city name using a REST API.

Features

- Fetch current weather details for a given city.
- Built with Java and Kotlin.
- Uses Spring Boot for application development.
- Reactive WebClient for API calls.
- Configurable API properties.
- Logs weather information for debugging purposes.
- Supports JSON responses for easy integration.
- Modular design with DTOs for clean data handling.

Technologies Used

- Java 21
- Kotlin
- Spring Boot 3.4.5
- Maven
- Lombok
- WebClient

Getting Started

Prerequisites

- Java 21 or higher
- Maven 3.8 or higher

Configuration

The application requires API properties to be configured in application.yml or application.properties. Below is an example configuration:
  weather-api:
  base-url: https://api.weatherapi.com/v1
  endpoint: /current.json
  api-key: YOUR_API_KEY
  
Replace YOUR_API_KEY with your actual API key.

API Endpoints

- GET /weather?city={cityName}: Fetches the current weather for the specified city.
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.