PRO150OSHA

Memory Game

JavaFX desktop memory game with login, leaderboard, and a local Spring Boot API.
Match cards, save scores, and view the leaderboard (both in-app and in the browser).

Features

Quick Start

1. Requirements

2. Start the API (Spring Boot)

From the api folder:

cd api
mvn spring-boot:run

If you don’t have Maven globally, you can:

The API will run on http://localhost:8080 and use api/memory_game.db.

3. Run the Desktop Game

Option A – Windows batch file

run-game.bat

Option B – From IDE (VS Code / IntelliJ / VS 2022)

  1. Open the project root in your IDE.
  2. Make sure JavaFX SDK path is set correctly (or use Maven JavaFX plugin).
  3. Run Main.java (or use the provided VS Code launch config).

How to Play

  1. Start the API (api folder) and then start the desktop app.
  2. On the main menu:
    • Login/register (top-right) if you want scores saved.
    • Note: if you don’t log in, scores won’t be saved.
  3. Click “Start Game” and choose a difficulty.
  4. Match all pairs to win.
  5. When you win:
    • If logged in: you’re asked if you want to submit your score to the leaderboard.
    • If not logged in: you’re reminded that logging in lets you save scores.
  6. View the leaderboard:
    • In-app (Leaderboard button).
    • Or click the hyperlink to open the web/API view in your browser.

Project Structure

PRO150OSHA/
├── api/                     # Spring Boot REST API (auth, leaderboard, deck)
│   ├── pom.xml
│   └── src/main/java/com/memorygame/api/...
├── src/main/java/           # JavaFX desktop app
│   ├── Main.java
│   ├── GameController.java
│   ├── LoginController.java
│   ├── LeaderboardController.java
│   ├── GameBoard.java
│   └── ApiClientService.java
├── src/main/resources/      # FXML views & CSS
│   └── views/*.fxml
├── images/                  # Local card images (Mario / Sonic / Pokemon)
├── lib/sqlite-jdbc.jar      # SQLite driver for desktop app
├── run-game.bat             # Helper script to compile & run game (Windows)
└── api/memory_game.db       # SQLite database used by the API (auto-created)

Tech Stack

For deeper setup details and API description, see API_SETUP.md in the repo.