Skip to content

Build System Upgrade with Persistent Leaderboard Support

Choose a tag to compare

@Goldspear21 Goldspear21 released this 24 May 16:43
· 13 commits to main since this release

๐Ÿ› ๏ธ Release: Maven Build, Batch Scripts & Improved Leaderboard Storage

This release introduces full Maven support, Windows batch files for easier launching, and a redesigned leaderboard storage system that now saves to a user directory on the host machine, improving persistence and portability.


โœจ What's New

๐Ÿงฉ General

  • โœ… Maven-based build system (pom.xml included)
  • ๐Ÿ“ฆ Clean build artifacts inside target/ folder
  • ๐Ÿ’ป Batch files (run_app.bat, run_server.bat) for quick execution with proper JavaFX paths
  • ๐Ÿ“ Leaderboard file (leaderboard.txt) now saved under user-specific directory, e.g.:
    • C:\Users\<username>\QuizAppData\leaderboard.txt on Windows

๐ŸŽฎ Quiz App Features

  • ๐Ÿง  10-question quiz with randomized selection
  • โฑ๏ธ Countdown timer with animated progress bar and color transitions (green โ†’ orange โ†’ red)
  • ๐ŸŽถ Background music that loops during the quiz
  • โธ๏ธ Pause menu (press ESC or pause button)
  • ๐ŸŽž๏ธ GIF background (pause.gif)
  • ๐ŸŽจ Themed buttons: Resume, Restart, Quit
  • โœ… Answer feedback with correct/incorrect highlighting
  • ๐Ÿ“œ Responsive layout for different screen sizes
  • ๐ŸŽญ Custom fonts and JavaFX styling for immersive UI

๐Ÿ–ฅ๏ธ Server Features

  • ๐Ÿ”Œ Leaderboard server that listens for client connections on port 12345
  • ๐Ÿ“ฅ Accepts and processes score submissions from quiz clients
  • ๐Ÿ“Š Sends top 3 leaderboard entries back to clients
  • ๐Ÿ‘ฅ Displays connected clients in real-time
  • ๐Ÿงต Handles multiple clients concurrently using threads
  • ๐Ÿ’พ Saves leaderboard to user-specific directory for persistence
  • ๐ŸชŸ JavaFX GUI to start/stop the server, view logs, and track activity

๐Ÿ“ Project Structures

๐Ÿ“‚ quiz_app/ Project Structure

quiz_app/
โ”œโ”€โ”€ .vscode/                         # VSCode config files
โ”œโ”€โ”€ lib/                             # JavaFX JAR libraries
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main/
โ”‚   โ”‚   โ”œโ”€โ”€ java/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ bhargav/
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ App.java         # Entry point
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ client/          # Client networking code
โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ quiz/            # Quiz logic and GUI
โ”‚   โ”‚   โ””โ”€โ”€ resources/
โ”‚   โ”‚       โ”œโ”€โ”€ audio/               # Background music
โ”‚   โ”‚       โ”œโ”€โ”€ gifs/                # GIF backgrounds
โ”‚   โ”‚       โ”œโ”€โ”€ images/              # UI images
โ”‚   โ”‚       โ”œโ”€โ”€ txt/                 # Question banks and fallback leaderboard
โ”‚   โ”‚       โ””โ”€โ”€ videos/              # Optional media
โ”‚   โ””โ”€โ”€ test/
โ”‚       โ””โ”€โ”€ java/
โ”‚           โ””โ”€โ”€ bhargav/
โ”‚               โ””โ”€โ”€ TestQuiz.java    # JUnit tests
โ”œโ”€โ”€ target/                          # Compiled output (via Maven)
โ”‚   โ””โ”€โ”€ quiz_app-1.0-SNAPSHOT.jar
โ”œโ”€โ”€ run_app.bat                      # Batch script to run the quiz app
โ”œโ”€โ”€ pom.xml                          # Maven build file
โ”œโ”€โ”€ UML.png                          # UML class diagram
โ””โ”€โ”€ README.txt                       # Project documentation

๐Ÿ“‚ server_app/ Project Structure

server_app/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ main/
โ”‚       โ”œโ”€โ”€ java/
โ”‚       โ”‚   โ””โ”€โ”€ bhargav/
โ”‚       โ”‚       โ”œโ”€โ”€ Server.java                  # Entry point to launch server GUI
โ”‚       โ”‚       โ””โ”€โ”€ server/
โ”‚       โ”‚           โ”œโ”€โ”€ LeaderboardServer.java   # Handles server logic, client threads
โ”‚       โ”‚           โ””โ”€โ”€ LeaderboardServerGUI.java# GUI for controlling server
โ”‚       โ””โ”€โ”€ resources/                           # (Optional) Resource folder if needed
โ”œโ”€โ”€ target/
โ”‚   โ””โ”€โ”€ server_app-1.0-SNAPSHOT.jar              # Compiled server JAR
โ”œโ”€โ”€ run_server.bat                               # Batch script to launch server with JavaFX
โ”œโ”€โ”€ javafx-sdk-23.0.2/                            # JavaFX SDK required for runtime
โ””โ”€โ”€ README.txt                                   # Project documentation

๐Ÿ“ฆ How to Build

You can build both projects using Maven:

mvn clean package

The compiled .jar files will appear in the target/ directory of each project.


๐Ÿš€ How to Run

๐Ÿ”น Run Quiz App

run_app.bat

๐Ÿ”น Run Leaderboard Server

run_server.bat

Ensure your environment has the JavaFX SDK properly set up, or the batch files include the correct module paths.


๐Ÿ“‚ Leaderboard Data Storage

Leaderboard files are now stored in a directory like:

Windows: C:\Users\<username>\QuizAppData\leaderboard.txt
macOS/Linux: /home/<user>/QuizAppData/leaderboard.txt

This avoids overwriting files in resources/ and ensures persistence.


๐Ÿ“œ License

This project uses JavaFX and other dependencies under their respective licenses. See the javafx-sdk-23.0.2/legal/ folder for details.


๐Ÿ™‹ Support

Open an issue on this repository for bugs, suggestions, or questions.