A simple console-based Library Management System written in Java.
This project allows users to manage a local file-based database of books using plain text files. It simulates real-world operations such as:
- β Adding new books
- π Finding a book by ISBN
- π Updating a bookβs quantity
- β Removing a book by ISBN
- π Viewing the entire book collection
Each book is stored in library.txt in the following format:
Id: 978-3-16-148410-0
Name: Clean Code
Author: Robert C. Martin
Genre: PROGRAMMING
Avaible: 5
---
Books are separated by "---" to mark the end of an entry.
- Java Core
- BufferedReader & BufferedWriter
- Enumerations (
enum) - Console-based user input with
Scanner - File I/O for persistence
-
Clone the repository or download the files:
git clone https://github.com/YOUR_USERNAME/LibraryManager.git
-
Make sure the project structure looks like this:
LibraryManager/ βββ librarymanager/ βββ BookType.java βββ LibraryEntrance.java βββ LibraryManager.java βββ Main.java βββ library.txt -
Compile the source code:
javac librarymanager/*.java -
Run the application:
java librarymanager.Main
===LIBRARY MANAGMENT
1. Add book.
2. Find book.
3. Update book's quantity.
4. Remove book.
5. Show storage.
6. Exit.
Choose: 1
Write id: 978-3-16-148410-0
Write the title: Clean Code
Write the author: Robert C. Martin
Write the genre: programming
Write the quantity: 10
The book has been saved successfully.
-
Genre is validated against the enum:
FANTACY, BIOGRAPHY, SCIENCE, PROGRAMMING, ALGORITHMS, SCRIPTING. If invalid, the genre will default toOTHER. -
The file
library.txtmust be located inside thelibrarymanager/directory.
You can improve this project by:
- Adding encryption for secure storage
- Creating a GUI with JavaFX
- Migrating to a database (like SQLite)
- Implementing search/filter by name or author
Made with π» and β by [Your Name Here].
Feel free to fork, star β, or improve it!