Skip to content

dileepanipun/WeththerSystem

Repository files navigation

WeatherSystem

A comprehensive weather reporting and analysis system built with Java 9, JavaFX, and SQL.

Description

WeatherSystem is a robust desktop application that provides real-time weather monitoring, analysis, and reporting capabilities using Java 9, JavaFX for the user interface, and SQL for data management.

Prerequisites

  • Java Development Kit (JDK) 9.0.0
  • JavaFX SDK
  • SQL Database (MySQL/PostgreSQL recommended)

Features

  • Real-time Weather Data Collection

    • Temperature and humidity monitoring
    • Wind speed and direction tracking
    • Atmospheric pressure measurements
    • UV index tracking
  • Advanced Report Generation

    • Customizable report templates
    • Multiple export formats (PDF, CSV)
    • Historical data analysis
    • Trend visualization
  • Weather Forecasting

    • 7-day weather predictions
    • Severe weather alerts
    • Seasonal trend analysis
    • Custom location tracking

Project Structure

WeatherSystem/
│
├── src/
│   ├── main/
│   │   ├── java/
│   │   │   └── com/weathersystem/
│   │   │       ├── controllers/
│   │   │       ├── models/
│   │   │       ├── services/
│   │   │       └── utils/
│   │   │
│   │   └── resources/
│   │       ├── fxml/
│   │       ├── css/
│   │       └── database/
│   │
│   └── test/
│       └── java/
│           └── com/weathersystem/
│
├── lib/
│   ├── javafx-sdk/
│   └── jdbc-driver/
│
├── database/
│   └── schema.sql
│
└── pom.xml (or build.gradle)

Setup and Installation

1. Java and JavaFX Setup

  • Ensure Java 9.0.0 is installed
  • Download JavaFX SDK compatible with Java 9
  • Set up environment variables for Java and JavaFX

2. Database Configuration

  1. Install MySQL/PostgreSQL
  2. Create database:
    CREATE DATABASE weathersystem;
    CREATE USER 'weatherapp'@'localhost' IDENTIFIED BY 'your_password';
    GRANT ALL PRIVILEGES ON weathersystem.* TO 'weatherapp'@'localhost';

3. Project Dependencies

  • JavaFX SDK
  • JDBC Driver
  • Apache POI (for PDF/Excel exports)
  • Logging framework

4. Build and Run

Using Maven

# Clean the project
mvn clean

# Compile the project
mvn compile

# Run the application
mvn javafx:run

Using Gradle

# Clean the project
gradle clean

# Compile the project
gradle build

# Run the application
gradle run

Configuration

Create a database.properties file:

db.url=jdbc:mysql://localhost:3306/weathersystem
db.user=weatherapp
db.password=your_password

Database Schema

CREATE TABLE weather_data (
    id SERIAL PRIMARY KEY,
    location VARCHAR(100),
    temperature DECIMAL(5,2),
    humidity INTEGER,
    wind_speed DECIMAL(5,2),
    wind_direction VARCHAR(20),
    recorded_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

API and Service Layers

Data Services

  • WeatherDataService: Fetch and store weather data
  • ReportGenerationService: Create reports
  • ForecastService: Retrieve weather predictions

Controller Responsibilities

  • MainViewController: Primary application interface
  • ReportController: Handle report generation
  • DatabaseController: Manage database connections

Testing

Unit Testing

# Run unit tests
mvn test
# or
gradle test

Test Coverage

  • JUnit 5
  • Mockito for mocking
  • Test database setup and teardown

Logging

Utilize Java's built-in logging or SLF4J for comprehensive application logging.

Security Considerations

  • Secure database connections
  • Implement connection pooling
  • Use prepared statements to prevent SQL injection

Deployment

Packaging

# Create executable JAR
mvn package

# Generate native executable
jlink --module-path /path/to/javafx-sdk/lib --add-modules javafx.controls,javafx.fxml --output dist

Contributing

  1. Fork the project
  2. Create a feature branch
  3. Commit changes
  4. Push to the branch
  5. Open a Pull Request

Troubleshooting

  • Ensure JavaFX SDK is correctly linked
  • Check database connection parameters
  • Verify Java 9 module path configuration

License

Distributed under the MIT License.

Contact

Your Name Project Link: [Your Project Repository URL]


The updated README addresses several key aspects for a Java 9 JavaFX SQL project:

1. Updated project description and technology stack
2. Comprehensive setup instructions
3. Detailed project structure
4. Database configuration guidelines
5. Build and run instructions for Maven/Gradle
6. Database schema example
7. Service and controller layer overview
8. Testing and logging considerations
9. Deployment instructions
10. Troubleshooting section

Would you like me to elaborate on any specific section or make any further modifications?

About

This system create for create weather report.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published