Real-Time Weather Intelligence Platform
By Michael Semera
- Overview
- Features
- Screenshots
- Installation
- Configuration
- Usage
- Architecture
- API Integration
- Project Structure
- Technologies Used
- Building the Project
- Troubleshooting
- Future Enhancements
- Contributing
- License
- Contact
AtmosNow is a modern, feature-rich weather forecast application built with Java and JavaFX. It provides real-time weather data and comprehensive 5-day forecasts through an elegant, user-friendly interface with interactive data visualizations.
The application leverages the OpenWeatherMap API to deliver accurate weather information for any city worldwide, presenting data through beautiful charts and intuitive displays.
- Real-Time Data: Live weather updates from OpenWeatherMap
- Visual Analytics: Interactive JavaFX charts for temperature, precipitation, and humidity
- Modern UI: Sleek gradient design with smooth animations
- Comprehensive Metrics: Temperature, humidity, wind speed, pressure, sunrise/sunset
- 5-Day Forecast: Detailed predictions with 3-hour intervals
- Responsive Design: Clean layout that adapts to different window sizes
-
Current Weather Display
- Real-time temperature with "feels like" metric
- Weather condition description
- Humidity percentage
- Wind speed in m/s
- Atmospheric pressure in hPa
- Sunrise and sunset times
-
5-Day Weather Forecast
- 3-hour interval predictions
- Up to 40 forecast data points
- Temperature trends
- Precipitation probability
- Humidity variations
-
Interactive Charts
- Temperature Line Chart: Visualizes temperature trends over time
- Precipitation Bar Chart: Shows rain probability for each forecast period
- Humidity Area Chart: Displays humidity level variations
-
User Experience
- City search with auto-complete capability
- Refresh button for manual updates
- Loading indicator during API calls
- Error handling with user-friendly alerts
- Smooth transitions and animations
-
Visual Design
- Beautiful gradient background (blue tones)
- Glass-morphism effects on panels
- Responsive layout
- Professional typography
- Color-coded charts for easy interpretation
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AtmosNow β
β Real-Time Weather Intelligence β
β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β [London ] [Search] [π] β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β 18.5Β°C β β
β β Partly Cloudy β β
β β Feels: 17Β°C | Humidity: 65% | Wind: 3.5 m/s β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββ ββββββββββββββββββββ β
β β Temperature β β Precipitation β β
β β Forecast Chart β β Chart β β
β ββββββββββββββββββββ ββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Humidity Levels Area Chart β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β π
Sunrise: 06:24 | π Sunset: 20:15 | Updated: ... β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Before installing AtmosNow, ensure you have the following:
-
Java Development Kit (JDK) 17 or higher
-
JavaFX SDK 17 or higher
- Download from OpenJFX
- Or use Maven/Gradle dependencies
-
Maven or Gradle (optional, for dependency management)
-
OpenWeatherMap API Key
- Register for free at OpenWeatherMap
- Get your API key from the dashboard
git clone https://github.com/yourusername/atmosnow.git
cd atmosnowCreate a pom.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.michaelsemera</groupId>
<artifactId>atmosnow</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<name>AtmosNow</name>
<description>Weather Forecast Application</description>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<javafx.version>17.0.2</javafx.version>
</properties>
<dependencies>
<!-- JavaFX -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
<!-- JSON Processing -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20230227</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<configuration>
<mainClass>com.michaelsemera.atmosnow.AtmosNowApp</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>Then run:
mvn clean installCreate a build.gradle file:
plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.13'
}
group = 'com.michaelsemera'
version = '1.0.0'
sourceCompatibility = '17'
repositories {
mavenCentral()
}
javafx {
version = "17.0.2"
modules = ['javafx.controls', 'javafx.fxml']
}
dependencies {
implementation 'org.json:json:20230227'
}
application {
mainClass = 'com.michaelsemera.atmosnow.AtmosNowApp'
}Then run:
gradle build- Open
WeatherService.java - Locate the line:
private static final String API_KEY = "YOUR_API_KEY_HERE";
- Replace
YOUR_API_KEY_HEREwith your actual OpenWeatherMap API key:private static final String API_KEY = "abc123def456ghi789";
For better security, use environment variables:
-
Modify
WeatherService.java:private static final String API_KEY = System.getenv("OPENWEATHER_API_KEY");
-
Set the environment variable:
- Windows (CMD):
set OPENWEATHER_API_KEY=your_api_key_here
- Windows (PowerShell):
$env:OPENWEATHER_API_KEY="your_api_key_here"
- Linux/Mac:
export OPENWEATHER_API_KEY=your_api_key_here
- Windows (CMD):
The styles.css file should be placed in src/main/resources/ directory. Ensure the path in AtmosNowApp.java matches:
scene.getStylesheets().add(getClass().getResource("/styles.css").toExternalForm());mvn javafx:rungradle run- Open the project
- Locate
AtmosNowApp.java - Right-click β Run 'AtmosNowApp.main()'
java -jar atmosnow-1.0.0.jar-
Search for a City
- Type city name in the search field
- Press Enter or click "Search" button
- Wait for data to load (loading bar appears)
-
View Current Weather
- Main temperature display shows current conditions
- Check "Feels Like" for perceived temperature
- View humidity, wind speed, and pressure metrics
-
Analyze Forecast Charts
- Temperature Chart: Hover over points for exact values
- Precipitation Chart: View rain probability percentages
- Humidity Chart: Track humidity trends over 5 days
-
Refresh Data
- Click refresh button (π) to update weather
- Application automatically loads default city (London) on startup
-
Check Sunrise/Sunset
- View times at bottom of window
- Times are displayed in local system timezone
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AtmosNowApp β
β (View + Controller) β
β - User interface components β
β - Event handling β
β - Chart management β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β
β Uses
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β WeatherService β
β (Service Layer) β
β - API communication β
β - Data fetching β
β - JSON parsing β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β
β Creates
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β WeatherData / ForecastData / ForecastPoint β
β (Models) β
β - Data representation β
β - Encapsulation β
β - Immutable properties β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-
Responsibilities:
- UI construction and layout
- User event handling
- Chart creation and updates
- Thread management for async operations
-
Key Methods:
createTopSection(): Search bar and titlecreateCenterSection(): Weather display and chartscreateBottomSection(): Sunrise/sunset infoloadWeatherData(): Async data fetchingupdateCharts(): Chart data binding
-
Responsibilities:
- HTTP API communication
- JSON response parsing
- Error handling
- Data transformation
-
Key Methods:
getCurrentWeather(): Fetch current conditionsgetForecast(): Fetch 5-day forecastmakeApiCall(): HTTP request handlerparseCurrentWeather(): JSON to model conversion
- WeatherData: Current weather snapshot
- ForecastData: Collection of forecast points
- ForecastPoint: Single forecast timestamp
GET https://api.openweathermap.org/data/2.5/weather
Parameters:
- q: City name (e.g., "London")
- appid: Your API key
- units: metric (Celsius) or imperial (Fahrenheit)
Sample Response:
{
"name": "London",
"main": {
"temp": 18.5,
"feels_like": 17.2,
"humidity": 65,
"pressure": 1013
},
"weather": [
{
"main": "Clouds",
"description": "partly cloudy"
}
],
"wind": {
"speed": 3.5
},
"sys": {
"sunrise": 1635395040,
"sunset": 1635433200
}
}GET https://api.openweathermap.org/data/2.5/forecast
Parameters:
- q: City name
- appid: Your API key
- units: metric
Sample Response:
{
"list": [
{
"dt": 1635408000,
"main": {
"temp": 19.2,
"humidity": 62
},
"weather": [
{
"main": "Clear"
}
],
"pop": 0.15
}
// ... 39 more entries
]
}- Free Tier: 60 calls/minute, 1,000,000 calls/month
- Paid Tiers: Higher limits available
The application handles various API errors:
- Invalid API key (401)
- City not found (404)
- Rate limit exceeded (429)
- Network timeout
- Malformed JSON responses
atmosnow/
β
βββ src/
β βββ main/
β β βββ java/
β β β βββ com/
β β β βββ michaelsemera/
β β β βββ atmosnow/
β β β βββ AtmosNowApp.java
β β β βββ WeatherService.java
β β β βββ WeatherData.java
β β β βββ ForecastData.java
β β β βββ ForecastPoint.java
β β β
β β βββ resources/
β β βββ styles.css
β β βββ icons/
β β βββ app-icon.png
β β
β βββ test/
β βββ java/
β βββ com/
β βββ michaelsemera/
β βββ atmosnow/
β βββ WeatherServiceTest.java
β
βββ pom.xml (or build.gradle)
βββ README.md
βββ LICENSE
βββ .gitignore
| Technology | Version | Purpose |
|---|---|---|
| Java | 17+ | Core programming language |
| JavaFX | 17.0.2 | GUI framework |
| JSON-Java | 20230227 | JSON parsing |
| OpenWeatherMap API | 2.5 | Weather data source |
- Charts: LineChart, BarChart, AreaChart
- Controls: Button, TextField, Label, ProgressBar
- Layouts: BorderPane, VBox, HBox
- CSS: Custom styling
- Maven/Gradle: Dependency management
- IntelliJ IDEA: Recommended IDE
- Scene Builder: UI design (optional)
mvn clean packageOutput: target/atmosnow-1.0.0.jar
gradle buildOutput: build/libs/atmosnow-1.0.0.jar
jpackage --input target/ \
--name AtmosNow \
--main-jar atmosnow-1.0.0.jar \
--main-class com.michaelsemera.atmosnow.AtmosNowApp \
--type exe \
--icon src/main/resources/icons/app-icon.png \
--app-version 1.0.0This creates platform-specific installers:
- Windows:
.exeor.msi - macOS:
.dmgor.pkg - Linux:
.debor.rpm
Error: API returned error code: 401
Solution: Verify your API key is correct in WeatherService.java
Error: API returned error code: 404
Solution: Check city name spelling; try major cities first
Error: JavaFX runtime components are missing
Solution:
- Add JavaFX to module path
- Or use Maven/Gradle dependencies
- Verify JavaFX SDK installation
JSONException: JSONObject["key"] not found
Solution:
- Check API response structure
- Verify internet connection
- Update JSON parsing logic if API changed
SocketTimeoutException: Read timed out
Solution:
- Check internet connection
- Increase timeout values in
WeatherService.java - Try again later if OpenWeatherMap servers are down
Enable debug logging:
// Add to WeatherService.java
private static final boolean DEBUG = true;
if (DEBUG) {
System.out.println("API URL: " + urlString);
System.out.println("Response: " + jsonResponse);
}-
Weather Alerts
- Severe weather notifications
- Push notifications
- Custom alert thresholds
-
Multiple Locations
- Save favorite cities
- Quick-switch between locations
- Compare weather across cities
-
Advanced Visualizations
- Wind direction compass
- UV index gauge
- Air quality indicator
- Animated weather icons
-
Historical Data
- Past weather trends
- Temperature comparisons
- Climate statistics
-
Customization
- Theme selection (dark/light mode)
- Unit preferences (CΒ°/FΒ°, mph/km/h)
- Language localization
-
Extended Forecast
- 14-day outlook
- Hourly predictions
- Minute-by-minute precipitation
-
Widgets
- Desktop widget mode
- System tray integration
- Always-on-top option
-
Export Features
- Save forecast as PDF
- Export chart images
- Share weather on social media
Contributions are welcome! Here's how to contribute:
- Check if the issue already exists
- Create a new issue with:
- Clear description
- Steps to reproduce
- Expected vs actual behavior
- System information (OS, Java version)
- Screenshots if applicable
- Open an issue with
enhancementlabel - Describe the feature and use case
- Provide mockups or examples if possible
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes
- Follow Java coding conventions
- Add Javadoc comments
- Test thoroughly
- Commit with clear messages:
git commit -m "Add: New weather alert feature" - Push to your fork:
git push origin feature/amazing-feature
- Open a Pull Request
- Follow Java naming conventions
- Use meaningful variable names
- Add Javadoc for all public methods
- Keep methods focused and concise
- Maximum line length: 100 characters
- Use 4 spaces for indentation
This project is licensed under the MIT License:
MIT License
Copyright (c) 2024 Michael Semera
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Michael Semera
- πΌ LinkedIn: Michael Semera
- π GitHub: @MichaelKS123
- π§ Email: michaelsemera15@gmail.com
- OpenWeatherMap for providing the weather API
- JavaFX community for excellent documentation
- Oracle for Java development platform
- Open source contributors for libraries and tools
If you find AtmosNow helpful:
- Star the repository β
- Share with friends and colleagues
- Report issues or suggest features
- Contribute improvements
Last Updated: November 2024
Version: 1.0.0
Status: Active Development
Built with β and passion for clean code