By: Omar Aboseada
A JavaFX desktop application for tracking the books you've read: add, edit, delete, rate (1-5 stars), search, and sort your personal library, all backed by a local SQLite database.
- Create - Add a book with title, author, genre, star rating, date finished, and optional notes, through an animated modal form.
- Read - Browse your whole library in a sortable table. Live search filters by title, author, or genre as you type.
- Update - Double-click a row (or select it and click Edit) to open the same form pre-filled for editing.
- Delete - Select a row and click Delete, with a confirmation dialog to prevent accidental removal.
- Sort - Use the "Sort by" dropdowns (Title / Author / Genre / Rating / Date Finished, Ascending / Descending), or just click any column header.
- Validation - Required fields, a 1-5 rating range, and a "no future dates" check are all enforced, with inline error messages and a shake animation instead of a wall of alert boxes.
- Smooth UX - Fade-in on launch, pop-in/pop-out modal dialogs, animated star ratings, hover-grow buttons, and sliding toast notifications for success/error feedback (instead of interrupting "OK" popups for every action).
| Layer | Choice |
|---|---|
| UI | JavaFX 21 (FXML + CSS) |
| Database | SQLite via the sqlite-jdbc driver |
| Build tool | Maven |
| Language | Java 17+ |
PersonalLibraryManager/
├── pom.xml
├── README.md
├── .gitignore
└── src/main/
├── java/com/plm/
│ ├── Main.java # Application entry point
│ ├── model/Book.java # Plain data object
│ ├── exception/ # Custom checked exceptions
│ │ ├── DatabaseException.java
│ │ ├── InvalidBookDataException.java
│ │ └── BookNotFoundException.java
│ ├── dao/ # All SQL lives here
│ │ ├── DatabaseManager.java # Connection + schema setup
│ │ └── BookDAO.java # CRUD + search/sort queries
│ ├── util/
│ │ ├── ValidationUtil.java # Input validation rules
│ │ ├── AnimationUtil.java # Reusable JavaFX animations
│ │ └── NotificationUtil.java # Animated toast messages
│ ├── component/
│ │ └── StarRatingControl.java # Custom 1-5 star widget
│ └── controller/
│ ├── MainController.java # Main window logic
│ └── BookDialogController.java # Add/Edit form logic
└── resources/com/plm/
├── fxml/main.fxml
├── fxml/book_dialog.fxml
└── css/styles.css
This follows a classic layered architecture: model (data) → dao (persistence/SQL) → controller (UI logic) → view (FXML/CSS) → with util/exception/component as supporting layers. No layer skips over another (e.g. controllers never write SQL directly), which keeps each class focused on one job.
- Java Development Kit (JDK) 17 or newer.
Check with:
java -versionIf you need one, get it from Adoptium (Windows installer). - Apache Maven.
Check with:
mvn -versionIf you need it, get it from maven.apache.org, or install it more easily via an IDE (see below).
You do not need to separately install SQLite or JavaFX - Maven downloads both automatically as dependencies the first time you build.
-
Extract the provided zip to the desired directory:
EXAMPLE DIRECTORY THAT WILL BE USED:
C:\Users\omara\Documents\javaprogrammingfinalprojectomaraboseada\PersonalLibraryManager
Open a terminal/PowerShell in the project folder directory (has to be the one with the pom.xml file in it):
'cd C:\Users\omara\Documents\javaprogrammingfinalprojectomaraboseada\PersonalLibraryManager'
Run:
'mvn clean javafx:run'
The first run will take a little longer as Maven downloads JavaFX and the SQLite driver. Subsequent runs are fast.
The first time you run the app, it creates library.db (a SQLite
database file) in the project's working directory. All your books live
in that one file - back it up if you want to keep your reading history
safe, or delete it to start fresh with an empty library.