Skip to content

Azizullah0/LibraryManagment

Repository files navigation

How to Start the Application

This section provides all the necessary information to get the Digital Library application up and running on your local machine using Docker.

Prerequisites

Before you begin, ensure you have the following installed on your system:

Step-by-Step Instructions

  1. Clone the Repository: If you haven't already, clone the project repository to your local machine.

  2. Navigate to the Project Directory: Open a terminal or command prompt and change your directory to the root of the project folder where the docker-compose.yml file is located.

    cd path/to/IMSE/Group38_Project_M2
  3. Build and Run the Application: Execute the following command to build the Docker images and start all the services (the web application, MariaDB, MongoDB, Adminer, and Mongo Express).

    docker-compose up --build
    • The --build flag ensures that the Docker images are rebuilt if there are any changes to the Dockerfile or the application code.
    • This command will display logs from all running services in your terminal. Wait for the services to initialize. You will see output indicating that the databases are ready and the Flask server has started.
  4. Access the Application: Once the containers are running, you can access the different parts of the application via your web browser:

    • Main Web Application: http://localhost:5001

      • From the main page, you can initialize the relational database, populate it with data, and then migrate that data to the NoSQL database.
    • Adminer (for MariaDB): http://localhost:8080

      • System: MariaDB
      • Server: mariadb_db
      • Username: user
      • Password: 123
      • Database: DigitalLibrary
    • Mongo Express (for MongoDB): http://localhost:8081

      • You can directly access the interface to view and manage the users, documents, reviews, and borrowing_records collections in the NoSQL database.

Application Workflow

  1. Initialize the Database: On the main application page (http://localhost:5001), click the "Initialize and Populate SQL Database" button. This will create the schema in MariaDB and fill it with sample data.
  2. Migrate to NoSQL: After initialization, click the "Migrate Data & Switch to NoSQL Mode" button. This transfers the data from MariaDB to MongoDB according to the defined NoSQL schema.
  3. Use the Application: You can now use the features for both "Student 1" (Reader use cases) and "Student 2" (Employee use cases), which will be operating on the MongoDB database.

Stopping the Application

To stop all the running services, press Ctrl + C in the terminal where docker-compose is running. To remove the containers, you can run:

docker-compose down

If you also want to delete the persistent data volumes (which will delete your databases), use:

docker-compose down -v

About

Library Management System Backend-based system with database integration for managing books and users.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors