This is a console application that simulates a library manager. There are two types of users: Admins who have the privilege to add, edit, and delete books in the library, and also they are the only way more users can be added and registered to the system. Regular Users who can view the book catalog, and borrow and return books.
The app's source code is very modular, and anticipates any needs for further extension. Moreover it allows basic authentication through the login dialogue, and deploys smart logic for handling user's input errors.
The app is developed in Java verision 22, and connects to a MySQL database. Adminer is used as a light-weight database manager. The app was containerized and made ready for deployment through Docker.
-
You need to have Docker installed on you machine. You can download it from the "Download Docker Desktop" button found at the top of the official page
-
(Optional) You can install git on you machine too. It will be a valuable tool for cloning from online repos generally, but you can also not download it and everything will be setup perfectly.
After downloading and installing docker, do the following:
If you have git, open any terminal and navigate to the directory on your machine where you want the app to be stored. Then execute:
git clone https://github.com/Ahmed-Aquarius/Library-Manager-App.git
If you chose not to download git, then:
- click on code button
- click on download ZIP
- after download finishes, move the zip file to any directory you want
- extract the zip file in that directory
- enter into the Library-Manager-App directory
- create a new file and name it ".env"
- copy all the code from the ".env.example" file into the ".env" you created.
- your .env file should now look like this:
DB_HOST=mysql-db DB_PORT=3306 DB_NAME=library_manager DB_USER=user DB_PASSWORD=pass
- replace "user" with your database username, and "pass" with your database password
- open any terminal, and navigate to the Library-Manager-App directory
- run:
docker-compose up -d mysql-db adminer
- After the processing happens and the terminal return to accepting prompts again, run:
docker-compose run --build --rm app
Note: The app may take a few seconds to run after executing the above command
There are two points of access for this app, both of which can be accessed only after the full and successful setting up:
-
the terminal on which the app is run: that's the main method of accessing. You can view the menu and interact and use the features of the app from there
-
Adminer: This is a web database management tool that allows you to view the real-time contents of the database and directly manipulte it if you want. You an access it by going to http://localhost:8080/
You will be presented with a login-like form. Enter the values below:
System: MySQL/MariaDB Server: mysql-db Username: your_username Password: your_password Database: library_manager
replacing the values of your_username and your_password with the values you entered for the same fields in the .env file.