A professional, real-world weather forecasting application with interactive 3D globe UI built using Java Spring Boot backend and modern frontend technologies.
- Real-time weather data for any city
- 3-day weather forecast
- Detailed weather information (temperature, humidity, wind, pressure, etc.)
- Weather condition icons
- Rotating 3D Earth visualization using Three.js and Globe.gl
- Click anywhere on the globe to get weather for that location
- Smooth animations and dark space theme
- Responsive design for mobile and desktop
- City search with real-time validation
- Loading animations during data fetch
- Error handling for invalid cities/API failures
- Temperature unit toggle (Celsius β Fahrenheit)
- Clean dashboard cards for weather display
- Java 17+
- Spring Boot 3.x
- Maven
- REST APIs
- OpenWeatherMap API
- HTML5
- CSS3 (Flexbox & Grid)
- JavaScript ES6+
- Three.js for 3D graphics
- Globe.gl for globe visualization
Weather/
βββ src/
β βββ main/
β β βββ java/com/weatherapp/
β β β βββ WeatherApplication.java
β β β βββ controller/
β β β β βββ WeatherController.java
β β β βββ service/
β β β β βββ WeatherService.java
β β β βββ client/
β β β β βββ WeatherClient.java
β β β βββ dto/
β β β β βββ WeatherResponseDTO.java
β β β β βββ ForecastResponseDTO.java
β β β βββ config/
β β β β βββ WeatherApiConfig.java
β β β β βββ RestTemplateConfig.java
β β β β βββ CacheConfig.java
β β β βββ exception/
β β β β βββ WeatherApiException.java
β β β β βββ CityNotFoundException.java
β β β βββ util/
β β β βββ TemperatureConverter.java
β β βββ resources/
β β βββ application.properties
β β βββ static/
β β βββ index.html
β β βββ styles.css
β β βββ script.js
βββ pom.xml
βββ README.md
- Controller Layer: Handles HTTP requests and responses (
WeatherController) - Service Layer: Contains business logic (
WeatherService) - Client Layer: Communicates with external APIs (
WeatherClient) - DTO Layer: Data transfer objects for API responses
- Configuration: Application and API configurations
- Encapsulation: Private fields with public getters/setters
- Abstraction: Interfaces and abstract classes for extensibility
- Inheritance: Extension of base classes
- Polymorphism: Method overriding in exception handling
| Endpoint | Method | Description |
|---|---|---|
/api/weather/today?city={city} |
GET | Get current weather for a city |
/api/weather/forecast?city={city} |
GET | Get 3-day forecast for a city |
/api/weather/by-coordinates?lat={lat}&lon={lon} |
GET | Get current weather by coordinates |
- Java 17 or higher
- Maven 3.6+
- OpenWeatherMap API Key
-
Clone the repository
git clone <repository-url> cd Weather
-
Configure API Key
- Sign up at OpenWeatherMap to get a free API key
- Update
src/main/resources/application.properties:weather.api.key=YOUR_API_KEY_HERE
-
Build the project
mvn clean install
-
Run the application
mvn spring-boot:run
-
Access the application Open your browser and navigate to
http://localhost:8080
- Interactive 3D globe visualization
- City search bar
- Weather information panels
- Current weather conditions
- Temperature with unit toggle
- Weather icons
- Detailed metrics (humidity, wind, pressure)
- 3-day forecast cards
- Implements in-memory caching for weather data
- Reduces API calls and improves response times
- Configurable cache expiration
- Comprehensive exception handling
- User-friendly error messages
- Graceful degradation for API failures
- CORS enabled for frontend access
- Secure API key management
- Detailed application logging
- Request/response tracking
- Error diagnostics
The application is fully responsive and works on:
- Desktop browsers
- Tablet devices
- Mobile phones
-
Advanced Features
- Historical weather data
- Weather alerts and notifications
- Multiple location tracking
- Weather maps and radar
-
UI Improvements
- Animated weather effects
- Dark/light theme toggle
- Location autocomplete
-
Technical Enhancements
- Database integration for user preferences
- WebSocket for real-time updates
- Microservices architecture
- Docker containerization
Interactive 3D globe with dark space theme
Detailed weather information with temperature toggle
Responsive design for mobile devices
This project is licensed under the MIT License - see the LICENSE file for details.
- Created as a educational project demonstrating full-stack development with Spring Boot and modern frontend technologies
- Weather data provided by OpenWeatherMap
- 3D globe visualization powered by Three.js and Globe.gl