Skip to content

mlei06/Bet308

Repository files navigation

Oogasalad

Bet308

Brian Chen, Michael Setji, Ashley Ruan, Andrew Li, Michael Lei, Lydia Jung, Allen Yao, Carrie Hang

Bet308 is a JavaFX card-game sandbox. You can play built-in games, open an authoring environment to make your own JSON game definitions, and optionally connect to a server for accounts, cloud storage of chip balances, and multiplayer rooms.

The codebase is split into three main pieces: game-core for shared logic, game-client for the desktop app, and game-server for the HTTP/WebSocket backend.

Timeline

  • Start Date: 3/19/26
  • Finish Date: 5/1/26
  • Hours Spent: about 500 total team-hours

Highlights

  • Local play for Blackjack, Poker, and UNO from data-driven JSON definitions
  • An authoring environment with templates, validation, live editing, and a save/play loop
  • Optional AI opponents, AI-assisted game generation, and in-game move advice when API_KEY is set
  • Account, profile, avatar, language, and chip-balance support through the server
  • Multiplayer room creation and joining for supported network games
  • Extra demo and experimental variants under game-client/data/games/

Project Structure

  • game-core: shared model, interpreter/rules logic, validation, macros, and env/resource helpers
  • game-client: JavaFX UI, authoring tools, local gameplay, network client, assets, and themes
  • game-server: Javalin server for auth, profile updates, cloud-stored game JSON, rooms, and WebSockets

Running the Program

Prerequisites

  • Java 25
  • Maven
  • PostgreSQL, only if you want server-backed features

Client only

If you just want to try the app, this is the easiest path:

mvn -pl game-client -am javafx:run

If JavaFX complains about stale compiled classes, use:

mvn -Pfresh -pl game-client -am javafx:run

Client main class: oogasalad.Main

Once the app opens, you can choose Play as guest and still use local play and authoring without any server setup.

Optional server

The server defaults to:

  • PORT=7070
  • DB_URL=jdbc:postgresql://localhost:5432/oogasalad
  • DB_USER=oogasalad
  • DB_PASSWORD=oogasalad
  • DB_DRIVER=org.postgresql.Driver

So the simplest setup is a local PostgreSQL database named oogasalad with username/password oogasalad. You can also override those values in a repo-root .env file or regular environment variables.

From the repo root:

mvn -pl game-server -am package -DskipTests
mvn -pl game-server exec:java

Server main class: oogasalad.server.GameServerMain

With the server running, the client can use:

  • OOGASALAD_SERVER_URL for auth, profile, and cloud JSON storage
  • OOGASALAD_MULTIPLAYER_URL for multiplayer if you want it to point somewhere else

Optional AI features

To use AI-generated authoring or in-game AI advice, add this to .env:

API_KEY=your_duke_ai_api_key

Useful Data Files

  • Built-in splash games:
    • game-client/data/games/default/blackjack.json
    • game-client/data/games/default/poker_real_ai_4_handed.json
    • game-client/data/games/default/uno.json
  • More examples and variants: game-client/data/games/
  • Network-oriented definitions: game-client/data/games/network/
  • Deck definitions: game-client/data/cards/

Gameplay Cheat Keys (Local Only)

These only work in local sessions. They do nothing in networked multiplayer.

Keys Effect
Shift+C Add 500 chips
Shift+X Remove 500 chips, but not below 0
Shift+R Set balance to 10,000
Shift+D Double current balance
Shift+B Set balance to 0

Implementation: game-client/src/main/java/oogasalad/view/play/CheatKeyHandler.java

Notes and Assumptions

  • Guest mode is enough for local play, testing, and authoring.
  • Multiplayer, cloud storage, and account sync need the server and database running.
  • The main polished paths are Blackjack, Poker, and UNO, but the repo also includes demo and experimental game JSON files.
  • The UI currently supports English and Spanish, plus multiple themes.

Attributions

  • Built with JavaFX, Maven, Javalin, Gson, Log4j, HikariCP, PostgreSQL, JUnit, and TestFX.
  • We leaned on official docs for JavaFX, Maven, Javalin, PostgreSQL, and the OpenAI API, and we also used AI tools for brainstorming, debugging, and polishing copy.

Assignment Impressions

This project ended up feeling a lot more like a systems project than a single game. The most satisfying part was getting authored JSON to flow all the way from editor to playable table, and the hardest part was keeping UI, engine, and server work moving together without breaking each other.

About

No description, website, or topics provided.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors