The Library Management System is a command-line interface (CLI) application built in Java that provides a way to manage books, magazines, users, transactions, and reviews. This system offers a simple but powerful way to handle library operations through text-based commands.
- User Management: Register, authenticate, and manage different user roles
- Product Catalog: Organize books and magazines with detailed information
- Author Database: Maintain author profiles and bibliographies
- Category Organization: Classify products by customizable categories
- Transaction Tracking: Record and monitor all purchase transactions
- Review System: Allow users to rate products and provide feedback
The system uses a MySQL database with the following structure:
Stores user account information and authentication details.
user_id
: Unique identifier for each userusername
: Unique login name for the userpassword
: Securely stored passwordemail
: User's email addressrole
: User role (e.g., admin, customer)
Contains information about authors of books and magazines.
author_id
: Unique identifier for each authorfirst_name
: Author's first namelast_name
: Author's last namebio
: Biographical information about the author
Defines product categories for organization.
category_id
: Unique identifier for each categoryname
: Category namedescription
: Detailed description of the category
Stores information about all available library items.
product_id
: Unique identifier for each producttype
: Product type (Book or Magazine)title
: Title of the productcategory_id
: Reference to the product's categoryauthor_id
: Reference to the product's authorprice
: Purchase priceavailable_copies
: Number of copies currently availableisbn
: ISBN number (for books only)
Records all purchase transactions in the system.
transaction_id
: Unique identifier for each transactionuser_id
: Reference to the user making the purchaseproduct_id
: Reference to the purchased productcost
: Total cost of the transactiondate
: Timestamp of when the transaction occurred (I know this one has a logical error in the program)
Stores user reviews and ratings for products.
review_id
: Unique identifier for each reviewuser_id
: Reference to the user who wrote the reviewproduct_id
: Reference to the product being reviewedrating
: Numerical rating (0-5 stars)
- Java 11 or higher
- MySQL 8.0 or higher
- JDBC Driver for MySQL
- Clone the repository:
git clone https://github.com/yourusername/library-management-system.git cd library-management-system
- Set up the database: Download MySQL Workbench and then run Database.sq
- Configure database connection:
That can be done through the DBconnector.java where it says:
// Edit the user=root and the password=root parts conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/library_system?user=root&password=root");
- Compile the Java files:
# Make Sure You Are in The Right Repo javac -d bin -cp "lib/" src/**/.java
- Run the application:
# Enjoy the app. # If this did not work for you, use Intellij to run the code. java -cp bin/* com.library.Main
- Language: Java
- Database: MySQL
- Database Connectivity: JDBC
- Interface: Command Line
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Project Link: https://github.com/ahm4dd/library-management-system