How zawlwintun816/library_system works
This is a single-user desktop application: a JavaFX GUI client that performs CRUD + search/sort against a MySQL database using JDBC. There is no web server/backend service layer in this repo—your “system” is primarily:
• A Java module/app (UI + data access logic)
• FXML-based views/resources
• A relational database schema initialized by an SQL script
Build / packaging
• pom.xml → Maven build, dependencies (likely JavaFX + MySQL JDBC driver).
Application code
• src/main/java/com/mylibrary/LibraryUI.java
• Likely the JavaFX Application entry point (launches UI, loads FXML).
• Also (per README) contains DB credentials and likely JDBC connection + queries (important: this implies UI and data access are coupled in this learning project).
• src/main/java/com/mylibrary/Book.java
• Domain model / DTO used by TableView and DB mapping.
UI resources
• src/main/resources/com/mylibrary/primary.fxml
• src/main/resources/com/mylibrary/secondary.fxml
Database artifacts
• src/main/resources/database/query_to_run.sql
README → runtime interactions to show (key flows)
• Books in a JavaFX TableView (Read)
• / Update / Delete book records (Write)
• Search by title/keyword (Parameterized query)
• Sort by fields (ORDER BY)
• Data integrity across related tables (constraints/foreign keys)
Also: “update username/password in LibraryUI” implies the app directly opens DB connections (no intermediary service).
Desktop App: Library Management System (Java Module)
• JavaFX UI
• Domain model (Book)
• JDBC data access (likely inside LibraryUI)
MySQL Database
• Schema created by query_to_run.sql
• Tables: Books (+ Borrowers, Loans as per README)
(Optional but accurate) Local Resources
• FXML files on classpath
• SQL script (used only during setup, not runtime)
• User → JavaFX UI: “clicks, forms, table interactions”
• JavaFX UI → JDBC/Data Access: “CRUD commands, search, sort”
• JDBC/Data Access → MySQL: “SQL queries via JDBC”
• MySQL → JDBC/Data Access: “ResultSets”
• App → FXML resources: “load primary.fxml/secondary.fxml at startup/navigation”
Decompose the app into concrete code/resources from the repo:
Inside: com.mylibrary module
• LibraryUI (Entry Point)
• Responsibilities: JavaFX lifecycle, scene navigation, DB connection config, query execution (per README)
• Book (Model)
• Fields correspond to table columns; used by TableView
• FXML Views
• primary.fxml
• secondary.fxml
• “JDBC / MySQL Connector”
• As an external library dependency brought by Maven (even if the exact artifact isn’t listed here, JDBC driver is implied)
• LibraryUI → primary.fxml / secondary.fxml: “FXMLLoader loads views”
• LibraryUI ↔ Book: “map ResultSet rows ↔ Book objects; bind to TableView”
• LibraryUI → JDBC Driver → MySQL: “connect, execute prepared statements”
• FXML Views → LibraryUI (or “Event Handlers in LibraryUI”): “button actions trigger CRUD/search/sort”
Because the README emphasizes integrity across books/borrowers/loans, add a mini ERD:
• Tables (from query_to_run.sql): at minimum Books; likely Borrowers and Loans
• Primary keys, foreign keys (Loans → Books, Loans → Borrowers)
• Cardinalities (Borrower 1..* Loans, Book 1..* Loans)
Even if the UI currently focuses on books, the schema’s relational integrity is part of the system’s “architecture”.
Relationships & interactions to be explicit about (avoid ambiguity)
• Protocol/tech: JDBC
• Data: SQL queries, ResultSet, Book objects
• Operations: Create/Read/Update/Delete, Search, Sort
configuration location:
• “DB credentials in LibraryUI” (a note or callout)
From the tree + README, the likely pattern is:
• 2-tier architecture (Desktop client + DB)
• Some MVC-ish separation (FXML views + model Book), but with probable UI/Data Access coupling (DB config in LibraryUI)
• UI layer (JavaFX/FXML)
• Model (Book)
• Data access (JDBC) — likely not isolated into DAO classes in this repo (since none appear)
ERD: Books / Borrowers / Loans + relationships
That set will be the “best and most accurate” representation of what exists in this repository without inventing non-existent services.