Skip to content

Latest commit

 

History

History
92 lines (51 loc) · 3.58 KB

README.md

File metadata and controls

92 lines (51 loc) · 3.58 KB

Weather App

A weather forecasting web application with user authentication and role management. Users can view, save, and manage weather data, while admins can manage users and perform restricted operations.


Features

  • Weather Data: API data is fetched using jQuery, and the rest of the information is displayed via Thymeleaf.

  • User Registration: Users can register with a profile photo saved to Firebase Storage. The photo URL and other details are stored in MySQL.

  • Weather Records: On the Weather Records page, users can view their saved weather entries. These records can be sorted by various criteria (e.g., weather date, country), and pagination is enabled to limit listings to 7 items per page.

  • Roles: The system includes four user roles with different permissions:

    • Guest: Users without an account can search and view up to 3-day weather forecasts.

    • User: Registered users can search, save weather information for the current day and delete these saved weather entry at any given moment.

    • Admin: Admins can manage users, ban/unban users, and delete user accounts.

    • Banned: Banned users cannot access the website or perform any operations.


Technologies Used

  • Java 17

  • MySQL

  • jQuery

  • Thymeleaf

  • Spring Boot 2

  • Firebase Storage


Configuration

MySQL

This project uses MySQL as its database. You will need to have MySQL installed on your machine.

  • Edit the application.properties file located at /src/main/resources/ to match your MySQL credentials.

  • Create the schema manually in MySQL Workbench (e.g., weatherapp).

  • The required tables will be created automatically by Hibernate/JPA.

  • On the first run, an admin account will be created automatically. The default credentials are:

These credentials can be changed in WeatherAppApplication.java.

Firebase Storage

WeatherApp uses Firebase for storing images like profile pictures & project photos.

To configure Firebase Storage:

  • Create a new project from Firebase Console.

  • Go to Project Settings -> Service Accounts -> Firebase Admin SDK -> Generate new private key.

  • Download the Firebase.js configuration file from the Firebase project.

  • Replace the existing Firebase.js file located in src/main/resources/static/js/LoginPage/Firebase.js with the downloaded configuration file.

Running the Project

  • Once you’ve set up the schema and completed Firebase configuration, run the project from your IDE.
  • Visit http://localhost:8080/ in your browser to access the application.

Screenshots

1 2 3 4 5 6 7 8