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