A full-stack Weather Search Application built using Java Spring Boot that allows users to search for current
weather information by city name.
The application integrates with the OpenWeatherMap API, implements caching for performance, and provides a
simple web-based UI to display weather details.
- Search current weather by city name
- REST ful backend API built with Spring Boot
- Integration with OpenWeatherMap external API for realtime weather update
- In-memory caching for faster repeated requests Using HashMap
- Proper handling of error scenarios (invalid city, API failure, etc.)
- Simple and clean UI using HTML, CSS, and JavaScript
- Display of detailed weather attributes
- Option to view raw API response get from OpenWeatherMap
- Java 17+
- Spring Boot
- Spring Web (REST APIs)
- RestTemplate
- Jackson (
JsonNode) - Lombok
- Maven
- HTML
- CSS
- JavaScript (Fetch API)
Make sure the following are installed on your system:
- Java 17 or higher
- Maven
- Internet connection (to access OpenWeather API)
You can verify installation using:
java -version
mvn -versiongit clone https://github.com/Shevadesuyash/weather-search-app-Fin-Factor.git
cd weather-search-appOpen the file:
src/main/resources/application.yaml
Update the API key value:
weather:
api:
base-url: http://api.openweathermap.org/data/2.5/weather
key: YOUR_OPENWEATHER_API_KEY
units: metric🔑 You can generate a free API key from: https://openweathermap.org/
Run the following command from the project root directory:
mvn spring-boot:runSpring Boot will start the application on port 8080.
-
Web UI Open a browser and go to:
http://localhost:8080 -
Backend API (Direct Test)
http://localhost:8080/api/weather?city=Pune
Response:
- Returns current weather details for the given city
- Includes temperature, humidity, wind speed, cloudiness, visibility, and raw API response
The application is available as a Docker image on Docker Hub.
suyash30/weather-search-app:0.1
- Docker installed on your system
- Internet connection (to access OpenWeather API)
Verify Docker installation:
docker --versiondocker pull suyash30/weather-search-app:0.1Replace
YOUR_OPENWEATHER_API_KEYwith your actual API key.
docker run -p 8080:8080 -e WEATHER_API_KEY=YOUR_OPENWEATHER_API_KEY suyash30/weather-search-app:0.1-
Web UI
http://localhost:8080 -
Backend API
http://localhost:8080/api/weather?city=Pune
Press:
Ctrl + C
or run:
docker ps
docker stop <container_id>- No local Java or Maven setup is required when using Docker
- The application runs entirely inside the container