LibraryApp is a console-based CRUD application for managing books in a library.
It follows the MVC (Model–View–Controller) architecture and connects to a MySQL database using JDBC.
This project is part of our learning journey in Java programming, software architecture, and database integration.
Library.png Library-Flow-Chart-1.png
This project was created with the purpose of practicing and strengthening the following skills:
- Java fundamentals
- Object-Oriented Programming (OOP)
- MVC architecture
- JDBC and MySQL integration
- Test-driven development using JUnit and Mockito
- Clean code organization in multi-package projects
📦library-app
┣ 📂config
┃ ┗ 📜DBManager.java
┣ 📂controller
┃ ┗ 📜BookController.java
┣ 📂model
┃ ┗ 📜Book.java
┣ 📂repository
┃ ┗ 📜BookRepository.java
┣ 📂view
┃ ┗ 📜BookView.java
┣ 📂main
┃ ┗ 📜Main.java
┗ 📂test
┗ 📂controller
┗ 📜BookControllerTest.java
- Java 21
- MySQL
- JDBC
- Maven
- JUnit 5
- Mockito
- Git/GitHub
- IntelliJ IDEA
- Clone the repository git clone https://github.com/FemCodersLibrary/library.git
- Set up the MySQL database
- Create a database named library
- Create the books table (you can request a SQL script if needed)
- Update DB credentials
- Go to config/DBManager.java and make sure the user, password, and database name match your setup
- Compile and run
- mvn clean compile
mvn test The controller is tested using Mockito, which allows us to verify the interaction with the repository without connecting to a real database. This ensures fast and isolated unit tests focused on the controller logic.
