Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: MIT

🌦 Weather App – Java Backend Learning Project

This project is built as part of my Java Backend Development learning journey.

It is a Spring Boot based REST API application that integrates with an external Weather API to fetch:

  • 🌤 Current Weather Data
  • 📅 Multi-Day Forecast Data

The main focus of this project is:

  • Backend architecture
  • REST API development
  • DTO mapping
  • External API integration
  • Proper HTTP status handling

🎯 Learning Objectives

This project helped me understand:

  • Spring Boot fundamentals
  • REST Controller development
  • Service layer architecture
  • DTO abstraction and mapping
  • Consuming external APIs using RestTemplate
  • Exception handling using ResponseEntity

🛠 Tech Stack

Backend

  • Java 17+
  • Spring Boot
  • Maven
  • RestTemplate
  • WeatherAPI (External API Provider)

Frontend

  • JavaScript
  • React (Vite + React)
  • Fetch API

⚠ Note: The frontend interface (React + Vite) was generated using AI for testing and interaction purposes.
The main learning and implementation effort is fully on the backend.


🌍 REST API Endpoints

1️⃣ Get Current Weather

GET /weather/{city}

GET http://localhost:8080/weather/Pune

2️⃣ Get Forecast

GET /weather/forecast?city={city}&days={days}

GET http://localhost:8080/weather/forecast?city=Phaltan&days=3

⚙ Configuration

weather.api.key=YOUR_API_KEY
weather.api.url=https://api.weatherapi.com/v1/current.json?
weather.api.forecast.url=https://api.weatherapi.com/v1/forecast.json?

▶ How to Run the Project

Clone the Repository

git clone https://github.com/pranavnikam-15/weather-app.git
cd Weather-App

🚀 Run Backend (Spring Boot)

  1. Navigate to backend folder:
cd backend
  1. Add your API key in application.properties

  2. Run the application:

mvn spring-boot:run

Backend will start at:

http://localhost:8080

🌐 Run Frontend (Vite)

  1. Open a new terminal

  2. Navigate to frontend folder:

cd frontend
  1. Install dependencies:
npm install
  1. Start development server:
npm run dev

Frontend will run at:

http://localhost:5173

📸 Application Screenshots

🔹 Current Weather (Without Forecast)

Current Weather


🔹 Weather Forecast (With Forecast Enabled)

Weather Forecast


👨‍💻 Author

Pranav Nikam

🌐 Live Demo

Check out the live application here :

🌦 Weather App Live

About

A Spring Boot backend project that fetches and displays real-time weather information using external APIs. Built for learning and practicing Spring Boot concepts, REST APIs, and Java backend development.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages