A Java-based application for managing personal game collections with both CLI and GUI interfaces.
- Overview
- Features
- Prerequisites
- Installation
- Configuration
- Usage
- Testing
- Project Structure
- Dependencies
The Game Library Management System is a Java application that enables users to:
- Organize game collections
- Track purchases
- Browse games by genre
- Manage accounts
Built with Java 21, Maven, and SQLite, it offers:
- Modular architecture (MVC pattern)
- Dual interface (CLI & Swing GUI)
- Persistent storage via SQLite database
✔ User authentication (login/signup)
✔ CRUD operations for game management
✔ Purchase history tracking
✔ Multi-interface support (GUI/CLI)
✔ Genre-based game categorization
✔ Unit testing with JUnit
| Requirement | Installation Guide |
|---|---|
| Java JDK 21+ | Oracle JDK or brew install openjdk@21 |
| Apache Maven 3.9+ | Maven Guide or brew install maven |
| SQLite 3.43+ | Included via Maven dependency |
Verification:
java -version && mvn -v- Clone the repository
git clone https://github.com/SamiNaim/GameLibrary.git
- Build with Maven
mvn clean install
- Run the application
The system uses two SQLite databases:
| Database | Path | Purpose |
|---|---|---|
| Production DB | src/main/resources/gameLibrary.db |
Main application |
| Test DB | src/test/java/gameLibrary.db |
Unit tests |
Configure in core/Config.java:
// For production:
public static final String DB_URL = "jdbc:sqlite:src/main/resources/gameLibrary.db";
// For testing (JUnit):
// public static final String DB_URL = "jdbc:sqlite:src/test/java/gameLibrary.db";Edit frontend/Main.java to select interface:
// For GUI (default):
// new GUIStates().initialize();
// For CLI:
// TextUIContext textUI = new TextUIContext();
// while (!textUI.isTerminated()) {
// textUI.handle();
// }- Register or log in
- Browse/Add games
- Make purchases
- View library
Run JUnit tests with:
mvn testTest Cases Include:
- User authentication
- Game CRUD operations
- Purchase validation
src/
├── main/
│ ├── java/
│ │ ├── core/ # Domain models (Game, Genre, etc.)
│ │ ├── database/ # Data persistence layer
│ │ └── frontend/ # UI components (CLI & GUI)
│ └── resources/ # Production database
│
└── test/
└── java/ # JUnit tests + test database
core/: Contains all domain models and business logicdatabase/: Handles all database operations and persistencefrontend/: User interface implementations (both CLI and GUI)test/: Contains all unit tests with a dedicated test database
| Dependency | Version | Purpose |
|---|---|---|
org.xerial:sqlite-jdbc |
3.48.0.0 | SQLite database connectivity |
org.junit.jupiter |
5.12.0-M1 | Unit testing framework |
org.openjfx:javafx |
21 | GUI components (for JavaFX) |
| Tool | Version | Usage |
|---|---|---|
| Maven | ≥3.9.6 | Build automation & dependency mgmt |
| Java SDK | ≥21 | Runtime environment |
View complete dependencies in pom.xml: