A console-based Library Management System built in Java. This project demonstrates a clean 3-layer architecture (Model-DAO-Service) suitable for learning and interviews.
- Authentication: Admin and Student login/registration.
- Admin: Add books to the library.
- Student: Issue and Return books.
- Persistence: Uses SQLite (or MySQL) to store data.
src/model: Data Carriers. Plain Java objects (POJOs) representing DB tables (User, Book).src/dao: Data Access. Direct database operations (SELECT, INSERT).src/service: Business Logic. Decisions and rules (e.g., "Can this user borrow this book?").src/util: Helpers. Database connection and Password hashing.src/main: Entry Point. The starting point of the app.
-
Database: The application is configured to use SQLite in
library.dbby default. No external server setup is needed for the demo. -
Compile:
javac -d bin -sourcepath src src/Main.java
(Note: You need the SQLite JDBC driver jar in your classpath)
-
Run:
java -cp "bin;sqlite-jdbc-3.42.0.0.jar" Main
Check docs/CodeWalkthrough.md for a detailed, beginner-friendly explanation of the code flow!