Skip to content

A desktop application built with JavaFX, FXML, MySQL, and Maven, designed for managing a collection of books.

Notifications You must be signed in to change notification settings

UmarlyPoeta/LibrarySystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š Library Management System

A desktop application built with JavaFX, FXML, MySQL, and Maven, designed for managing a collection of books.


🧾 Features

  • πŸ” Search books by title
  • βž• Insert new books into the database
  • ✏️ Update selected book details
  • ❌ Delete selected books
  • πŸ”„ Refresh the book list
  • πŸ…°οΈ Sort books alphabetically by title
  • πŸ“„ FXML-based UI switching (Primary ↔ Secondary views)

πŸ“ Project Structure

librarysystem/
β”œβ”€β”€ pom.xml
└── src/
    └── main/
        β”œβ”€β”€ java/
        β”‚   β”œβ”€β”€ module-info.java
        β”‚   └── com/
        β”‚       └── mylibrary/
        β”‚           β”œβ”€β”€ Book.java
        β”‚           └── LibraryUI.java
        └── resources/
            └── com/
                └── mylibrary/
                    β”œβ”€β”€ primary.fxml
                    └── secondary.fxml

🧰 Technologies Used

  • Java 22 (configured for Java 11 compatibility via pom.xml)
  • JavaFX 22.0.2 (Controls & FXML)
  • MySQL + JDBC
  • Maven
  • FXML for UI layout

πŸ—ƒοΈ Database Setup

Run the following SQL script in MySQL to set up the required table:

CREATE DATABASE IF NOT EXISTS LibraryDB;
USE LibraryDB;

CREATE TABLE IF NOT EXISTS Books (
    book_id INT AUTO_INCREMENT PRIMARY KEY,
    title VARCHAR(255) NOT NULL,
    author VARCHAR(255) NOT NULL,
    available BOOLEAN NOT NULL
);

βš™οΈ Configuration

Edit your database credentials in LibraryUI.java:

private Connection connect() throws SQLException {
    String url = "jdbc:mysql://localhost:3306/LibraryDB";
    String user = "root";         // ← change if needed
    String password = "password"; // ← change if needed
    return DriverManager.getConnection(url, user, password);
}

πŸš€ How to Run

  1. Install Java 11+ and MySQL.

  2. Set up the database (see above).

  3. Clone this repository:

    git clone https://github.com/UmarlyPoeta/LibrarySystem.git
    cd LibrarySystem
  4. Run the application with Maven:

    mvn clean javafx:run

πŸ’‘ Ensure your IDE supports JavaFX and FXML (like IntelliJ IDEA with JavaFX plugin).


πŸ”§ Maven Configuration Highlights

The pom.xml includes:

  • JavaFX dependencies (javafx-controls, javafx-fxml)
  • MySQL Connector/J
  • JavaFX Maven Plugin for simplified running

πŸ“Œ FXML Views

  • primary.fxml and secondary.fxml exist for future expansion using FXML-based scene switching.
  • Controllers (PrimaryController, SecondaryController) are referenced but not implemented yet in the provided code.

πŸ§ͺ To Do

  • βœ… Hook up FXML views to actual logic
  • πŸ” Add user authentication
  • πŸ“¦ Export book data (CSV/JSON)
  • πŸ” Add filter by availability
  • πŸ§ͺ Add JUnit tests

πŸ“œ License

This project is open source and available for educational use and contributions.


About

A desktop application built with JavaFX, FXML, MySQL, and Maven, designed for managing a collection of books.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages