Luku is a Library Management System developed for students and teachers, offering intuitive features to browse, search, and reserve books. Users can search by category, author, or title, and manage their reservations with ease.
The project is implemented in Java using Maven and supports localization in English, Russian, and Urdu.
Luku was developed as part of a second-year Software Engineering course at Metropolia University of Applied Sciences.
- Manage reservations (create, update)
- Manage users (register, update)
- Extend due dates for reservations
- Search for books, authors, and users
- View reservations for a specific user
- Notify users about due dates
- User can reserve limited books based on their role.
- User can extend the due date of the book.
- User can view the list of books they have reserved.
- User can view the list of books they have borrowed.
- Notification is sent to the user when the due date is near.
- User can choose from three user interface languages: English, Russian, and Urdu.
- Java
- Maven
- MariaDB
- JUnit 5
- Mockito
- Testcontainers
- Docker
- Jenkins
- Java 11 or higher
- Maven 3.6 or higher
- MariaDB
- Docker
- XQuartz (for macOS)
The project uses the Maven Shade Plugin to create an executable JAR file with all dependencies included.
The plugin is configured in the pom.xml file to run JavaFX applications.
java -jar target/LukuLibrary.jar-
Clone the repository:
git clone https://github.com/MahnoorFatima02/library-management-system.git
-
Configure the database:
- Ensure MariaDB is installed and running.
- Create a database named
library_db.
Or you can use the docker-compose file to run the MariaDB container. Make sure to be in the docker folder of the project.
cd docker docker-compose -f docker-compose-db.yml up -
Set the environment variables:
- Create a
.envfile in the root directory of the project.
public static final String DB_URL = "jdbc:mariadb://localhost:3306/library_db"; public static final String USER = "library_user"; public static final String PASSWORD = "library_password";
- Create a
-
Install sample data:
- Run the
SampleDataInserterfile to insert sample data into the database.
- Run the
-
Build the project:
mvn clean install
-
Run the application:
mvn exec:java
or
Start the ** Main class** in the view package.
The project includes unit tests for the service and controller layers. To run the tests, use the following command:
mvn test- src/main/java: Contains the main application code.
- src/test/java: Contains the test code.
- src/main/resources: Contains configuration files.
- docker/docker-compose.yml: Contains the Docker Compose configuration (mariadb and luku).
- JenkinsFile: Contains the Jenkins pipeline configuration.
- SampleDataInserter.java: Inserts sample data into the database.
- pom.xml: Contains the Maven project configuration.
- Dockerfile: Contains the Docker image configuration.
Install Jenkins: Download and install Jenkins from the official website.
Configure Jenkins:
- Install necessary plugins (e.g., Docker, Maven).
- Set up credentials for Docker Hub.
- Create Jenkins Pipeline:
- Use the provided Jenkinsfile to create a pipeline job in Jenkins.
Push to Docker Hub
Push to docker hub through Jenkins pipeline. Docker Hub Repository: Docker Hub
Docker Play with Jenkins
Pull Docker Image:
docker pull mahnoor95/luku:v1Set the environment variables:
- Create a .env.docker file in the root directory of the project.
Add the following code to the .env.docker file:
public static final String DB_URL = "jdbc:mariadb://mariadb:3306/library_db";
public static final String USER = "library_user";
public static final String PASSWORD = "library_password";The environment automatically sets the database URL to the mariadb container.
If you are running the application locally, the application automatically loads the default .env file and connects to the localhost.
Build Docker Image:
docker build -t mahnoor95/luku:v1 .check docker image:
docker imagesPush the Docker image to Docker Hub:
If you want to push your image to docker hub locally, you can use the following command:
docker push mahnoor95/luku:v1Pull the Docker image from Docker Hub:
docker pull mahnoor95/luku:v1Set up XQuartz:
brew install --cask xquartz open -a XQuartzIt will open X11. Go to the Security tab and check "Allow connections from network clients".
Set the DISPLAY environment variable:
export DISPLAY=:0Allow connections to the X server:
xhost +localhostRun Docker Compose:
Make sure you are in docker folder of the project. To run the Docker multiple container, use the following command:
docker-compose upInstall Chocolatey:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) choco install xmingX Server Setup
After installing Xming, you need to configure XLaunch to run the X server. Start by searching for XLaunch in the Windows search bar and running it. Alternatively, you can navigate to the following path: C:\Program Files (x86)\Xming and run the XLaunch executable.
If you cannot find the XLaunch executable, make sure that you have installed Xming correctly.
Set the DISPLAY environment variable:
set DISPLAY=localhost:0.0Allow connections to the X server:
xhost +localhostRun Docker Compose:
Make sure you are in docker folder of the project. To run the Docker multiple container, use the following command:
sh docker-compose up
The project uses MariaDB to store data. The changes made while running docker or locally will be persisted in the database. It is because the database is mounted to the host machine.

