LeBook is a lightweight command-line application for managing your personal book collection. Keep track of books you own, borrow, and lend out with simple text commands.
- Book Management: Add and delete books from your collection
- Status Tracking: Mark books as borrowed or returned
- Book Listing: View all books in your library with status indicators
- Persistence: Your library is automatically saved between sessions
- Simple Interface: Easy-to-remember commands with clear feedback
- Java Development Kit (JDK) 17 or higher
- Gradle 7.0+ (for building from source)
- Download the latest
LeBook.jarfrom the releases page - Place the JAR file in your preferred directory
- Clone the repository
git clone https://github.com/yourusername/lebook.git
- Navigate to the project directory
cd tp
java -jar LeBook.jarOn first run, LeBook will create a data directory for storing your book collection.
LeBook supports the following commands:
| Command | Format | Description |
|---|---|---|
| Add Book | add TITLE / AUTHOR |
Adds a new book to your library |
| Delete Book | delete BOOK_NUMBER |
Removes a book from your library |
| List Books | list |
Displays all books in your library |
| Borrow Book | borrow BOOK_NUMBER |
Marks a book as borrowed |
| Return Book | return BOOK_NUMBER |
Marks a book as returned |
| Exit | exit |
Exits the application |
For a more detailed guide, please refer to the User Guide.
seedu/duke/
βββ LeBook.java # Main application class
βββ book/ # Book-related classes
β βββ Book.java # Book entity
β βββ BookManager.java # Book collection management
βββ commands/ # Command classes
β βββ AddCommand.java
β βββ Command.java # Base command interface
β βββ Commands.java # Command types enum
β βββ DeleteCommand.java
β βββ ExitCommand.java
β βββ ListCommand.java
β βββ UpdateStatusCommand.java
βββ exception/
β βββ LeBookException.java # Custom exceptions
βββ parser/
β βββ Parser.java # Command parser
βββ storage/
β βββ Storage.java # File operations
βββ ui/
βββ Ui.java # User interface
The storage file (data/LeBook_data.txt) uses a pipe-separated format:
Title | Author | BorrowedStatus | ReturnDueDate(optional)
Example:
The Great Gatsby | F. Scott Fitzgerald | 0
1984 | George Orwell | 1 | 2025-04-15
LeBook uses JUnit 5 for testing. To run the tests:
./gradlew testThe test suite includes unit tests for:
BookManageroperations- Command execution
- File parsing and storage