This project is a simple weather application built using Spring Boot for the backend and HTML, CSS, and JavaScript for the frontend.
The backend communicates with the OpenWeatherMap API to fetch real-time weather data based on the city name entered by the user.
The frontend sends a request to the Spring Boot API and displays the weather information on the webpage.
The purpose of this project is to understand how REST APIs work, how to integrate third-party APIs, and how the frontend and backend communicate with each other.
- Search weather by city name
- Fetch real-time weather data from OpenWeatherMap
- Backend developed in Spring Boot
- Frontend created using HTML, CSS, and JavaScript
- API call handled using JavaScript fetch
- Shows temperature, humidity, description, and wind
- Easy to extend and customize
- Java
- Spring Boot
- Spring Web
- RestTemplate
- Maven
- HTML
- CSS
- JavaScript
- OpenWeatherMap API
- The user enters a city name in the frontend.
- JavaScript sends a GET request to the Spring Boot API.
- The backend receives the request and calls the OpenWeatherMap API using RestTemplate.
- OpenWeather returns weather data in JSON format.
- The backend returns the same JSON to the frontend.
- JavaScript reads the JSON and displays weather information on the webpage.
Or download the ZIP and extract it.
- Open the backend project in IntelliJ IDEA, Eclipse, or Spring Tool Suite.
- Go to
src/main/resources/application.propertiesand add your OpenWeather API key: - Run the Spring Boot main class:
- The backend will start at:
- Open the
weather-frontendfolder. - Make sure the files are named: