Skip to content

eunicePops/weatherapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WeatherApp 🌤️

CI

A REST API built with Spring Boot that returns real-time weather data for any city using the OpenWeatherMap API.

Tech Stack

  • Java 21
  • Spring Boot 3.5.1
  • Maven
  • OpenWeatherMap API
  • SpringDoc OpenAPI (Swagger UI)

Features

  • Get current weather by city name
  • Input validation with meaningful error messages
  • Global exception handling
  • Auto-generated API documentation via Swagger UI
  • CI pipeline with GitHub Actions

Getting Started

Prerequisites

  • Java 21
  • Maven

Run Locally

  1. Clone the repo
   git clone https://github.com/eunicepops/weatherapp.git
   cd weatherapp
  1. Set your API key
   export WEATHER_API_KEY=your_openweathermap_api_key
  1. Start the app
   mvn spring-boot:run
  1. Open Swagger UI

http://localhost:8080/swagger-ui.html

API Endpoints

Method Endpoint Description
POST /api/weather Get weather by city name

Example Request

{
  "city": "Toronto"
}

Example Response

{
  "city": "Toronto",
  "country": "CA",
  "temperature": 15.0,
  "description": "clear sky",
  "humidity": 80.0,
  "windSpeed": 3.5
}

Running Tests

mvn test

Live Demo

API is live on Render:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors