A robust Java-based, offline-first library management CLI that enforces data integrity, borrow/return rules, and user roles without a database. Implements core data structures (dynamic arrays, hash maps, priority queues) and algorithms (binary search, merge sort) for efficient operations. Features an interactive menu-driven console UI with ANSI theming, spinners, and pagination. Packaged as a native Windows binary using GraalVM for fast startup.
- JavaΒ 17+Β (or your GraalVM distribution set asΒ
JAVA_HOME) - GradleΒ 8+
For dev, use the utility psh script to run
./run.ps1 --interactive
# For help.
.\run.ps1 --help
-
Install GraalVM 21 CE and set
JAVA_HOMEβ$env:JAVA_HOME = 'C:\graalvm\jdk-21.0.2' $env:Path = "$env:JAVA_HOME\bin;$env:Path"
-
Ensure you have Visual Studio Build Tools (for
cl.exe). -
Build the βfat-jarβ + native image:
./gradlew clean nativeImage
-
Youβll end up with
ebenlib.exe. To test:.\ebenlib.exe --interactive
Optional icon injection uses Resource Hacker if installed under
C:\Program Files (x86)\Resource Hacker\ResourceHacker.exe.
If you prefer a single JAR (no native-image):
./gradlew clean jar
java -jar app/build/libs/app.jar --interactiveebenlib <category> <command>
| Command | Description |
|---|---|
--interactive |
Launch the interactive, menuβdriven UI |
auth signin |
Sign in to your account |
auth signup |
Register a new Reader or Librarian |
auth signout |
Sign out of the current session |
user list |
List all users (Librarian only) |
user delete |
Delete a user account |
user promote |
Promote a user to Librarian |
user demote |
Demote a Librarian to Reader |
user deactivate |
Suspend a userβs account |
user activate |
Reactivate a suspended user |
book add |
Add a book to inventory (Librarian only) |
book update |
Update book details |
book delete |
Remove a book from inventory |
book list |
List all books |
book search |
Search books by title/author/ISBN |
book stats |
Show stats for a given book (times borrowed, overdue count, etc.) |
borrow request |
Request to borrow a book |
borrow approve |
Approve a borrow request (Librarian only) |
borrow reject |
Reject a borrow request (Librarian only) |
borrow return |
Return a borrowed book |
borrow list |
List all pending borrow requests |
borrow history |
Show your personal borrowing history |
profile view |
View your user profile |
profile update |
Update your username |
profile password |
Change your password |
system seed |
Initialize or reset system data (Librarian only) |
system import |
allows to get in data from external sources |
system export |
allows for backing up data |
system config |
allows for configuring some system functions |
report views |
Report: summary stats |
report books |
Report: book report stats |
report borrows |
Report: borrow stats |
report users |
Report: user stats |
test |
Run the builtβin console UI tests |
--help, -h |
Show this help message |
Use ebenlib <category> <command> --help for detailed usage.
# Sign up new Librarian
ebenlib auth signup
# Sign in
ebenlib auth signin
# Add a new book
ebenlib book add --title="1984" --author="Orwell" --copies=5
# Search books
ebenlib book search --title="Potter"
# Borrow a book
ebenlib borrow request --book-id=42
# Run the interactive menu
ebenlib --interactive./Library-Management-System/*
ββ app/*
| ββ src/*
| | ββ main/*
| | | ββ java/*
| | | | ββ org/*
| | | | | ββ ebenlib/*
| | | | | ββ book/*
| | | | | | ββ Book.java
| | | | | | ββ BookHandler.java
| | | | | | ββ BookService.java
| | | | | | ββ BookStats.java
| | | | | ββ borrow/*
| | | | | | ββ BorrowHandler.java
| | | | | | ββ BorrowRecord.java
| | | | | | ββ BorrowSettings.java
| | | | | | ββ BorrowStore.java
| | | | | | ββ Status.java
| | | | | ββ cli/*
| | | | | | ββ AuthHandler.java
| | | | | | ββ CommandRouter.java
| | | | | | ββ ConsoleThemeTest.java
| | | | | | ββ ConsoleUI.java
| | | | | | ββ InteractiveMenus.java
| | | | | | ββ InteractiveShell.java
| | | | | | ββ TablePrinter.java
| | | | | ββ ds/*
| | | | | | ββ EbenLibComparator.java
| | | | | | ββ EbenLibFunction.java
| | | | | | ββ EbenLibHashSet.java
| | | | | | ββ EbenLibList.java
| | | | | | ββ EbenLibMap.java
| | | | | | ββ EbenLibMapEntry.java
| | | | | | ββ EbenLibPriorityQueue.java
| | | | | | ββ EbenLibSet.java
| | | | | | ββ EbenLibStack.java
| | | | | ββ profile/*
| | | | | | ββ ProfileHandler.java
| | | | | ββ report/*
| | | | | | ββ ReportHandler.java
| | | | | ββ searchsort/*
| | | | | | ββ Searcher.java
| | | | | | ββ Sorter.java
| | | | | ββ system/*
| | | | | | ββ SystemHandler.java
| | | | | ββ user/*
| | | | | | ββ Role.java
| | | | | | ββ User.java
| | | | | | ββ UserHandler.java
| | | | | | ββ UserStore.java
| | | | | ββ utils/*
| | | | | | ββ FileUtil.java
| | | | | ββ App.java
| | | | ββ module-info.java
| | | ββ resources/*
| | | ββ books.csv
| | | ββ borrows.csv
| | | ββ session.csv
| | | ββ settings.txt
| | | ββ users.csv
| | ββ test/*
| | ββ java/*
| | | ββ org/*
| | | ββ ebenlib/*
| | | ββ AppTest.java
| | ββ resources/*
| ββ build.gradle
| ββ ebenlib.exe
| ββ ebenlib.ico
ββ src/*
| ββ main/*
| ββ resources/*
| ββ books.csv
| ββ borrows.csv
ββ .fttignore
ββ .gitattributes
ββ .gitignore
ββ demo.png
ββ gradle.properties
ββ gradlew
ββ gradlew.bat
ββ README.md
ββ run.ps1
ββ settings.gradle- EbenLibList Dynamic array with O(1) random access, amortized O(1) append, O(n) remove.
- EbenLibStack
LIFO built on
EbenLibList:push,pop,peekall O(1). - EbenLibMap<K,V>
Chained-hash table: average O(1)
get/put/remove; rehash at load > 0.75. - EbenLibPriorityQueue Binary-heap: O(log n) insert & remove-max/min.
- EbenLibHashSet
Wrapper over
EbenLibMap<T,Boolean>, O(1) contains/add/remove. - Binary Search
O(log n) on pre-sorted
EbenLibListviaSearcher.binarySearch. - Merge Sort
O(n log n) stable sort implemented in
Sorter.mergeSort.
-
Adding new commands:
- Extend
CommandRouter.route(...). - Implement a new handler class (e.g.
BookHandler). - Wire it in
CommandRouterand add stubs inInteractiveMenus.
- Extend
-
Interactive UI: Uses ANSI colors, pagination, spinnersβfully themable via
ConsoleTheme. -
Native packaging: For lightningβfast startup, use GraalVMβs
native-imageto compile into a standaloneebenlibbinary. See GraalVM docs.
- Fork this repo
- Create your feature branch (
git checkout -b feature/xyz) - Commit your changes (
git commit -m "feat: add XYZ") - Push to your branch (
git push origin feature/xyz) - Open a Pull Request
