Coder Social home page Coder Social logo

distributed-hotel-booking's Introduction

Description ๐Ÿ“

Bookaro is a distributed hotel booking system developed in Java, leveraging the MapReduce framework for efficient data processing. The system comprises a mobile frontend application for managing accommodations and a robust backend system for data analysis, processing, and storage. Bookaro supports functionalities for both managers and renters, providing a comprehensive solution for room rentals.

Features ๐Ÿ”

Manager Functionality

  • Add Accommodations: Managers can add new accommodations.
  • Set Available Dates: Define available rental dates for accommodations.
  • View Bookings: Display bookings for owned accommodations.
  • View Aggregated Bookings: Managers can view bookings filtered by area for a specified date range.
  • Console Application: Manage accommodations via a console interface.

Renter Functionality

  • Filter Accommodations: Search based on area, dates, number of persons, price, and rating.
  • Book Accommodations: Renters can book accommodations that meet their criteria.
  • View Bookings: Renters can view their bookings.
  • Rate Rooms: Provide star ratings (1-5) for rented rooms.
  • Android UI: All functionalities accessible through an Android application.

Compile and Run

Backend Setup
  1. Configuration:
    Update the hosts in the properties files located in the /data folder of each main component (Master, Worker, Reducer, Manager) directory. Ensure that the hostnames or IP addresses are correctly set for your network setup.

  2. Compile the Java files:

    javac .\backend\src\main\java\org\backend\master\Master.java
    javac .\backend\src\main\java\org\backend\worker\Worker.java
    javac .\backend\src\main\java\org\backend\mapreduce\Reducer.java
    javac .\backend\src\main\java\org\backend\manager\ManagerConsoleApp.java
  3. Run the Java files:
    Always in the correct workspace:

    Start the Master node:

    java Master

    Start the Worker nodes (in separate terminals), assigning each a unique ID (e.g., 1, 2, 3):

    java Worker 1
    java Worker 2
    java Worker 3

    Start the Reducer node:

    java Reducer

    Start the Manager node:

    java ManagerConsoleApp
  4. Using the Manager:
    Follow the menu options provided by the Manager to start adding accommodations, managing bookings, and performing other tasks.


Frontend Setup
  • Open the Android project in Android Studio.
  • Locate BackendConnector.java and update the host of the Master node.
  • Build and run the application on an Android device or emulator.

Implementation Details ๐Ÿ“˜

Room JSON Structure

This example JSON provides a basic representation of a hotel room object, outlining its attributes such as roomId, roomName, noOfPersons, area, stars, noOfReviews, price, roomImage, and availableDates.

{
    "roomId": "1",
    "roomName": "Deluxe Suite",
    "noOfPersons": 4,
    "area": "Athens",
    "stars": 5,
    "noOfReviews": 12,
    "price": "800",
    "roomImage": "src/main/java/org/backend/images/rooms/deluxe_suite.png",
    "availableDates": [
        {
            "startDate": "2024-05-28",
            "endDate": "2024-06-17"
        }
    ]
}

MapReduce Framework

  • Map Function: Processes input key/value pairs to produce intermediate key/value pairs.
  • Reduce Function: Merges intermediate values to produce final results.

Backend

  • Master Node: Functions as the central coordinator, handling job distribution, aggregation, and communication.
  • Worker Nodes: Execute mapping tasks in parallel, processing data according to job assignments.
  • Multithreading: Utilizes multithreading for efficient task execution and resource utilization on both Master and Worker nodes.
  • TCP Communication: Implements TCP sockets for reliable and efficient communication between Master and Workers.

Frontend

  • Android Application: Connects to the Master via TCP sockets for all operations.
  • Asynchronous Operations: Use of threads to keep the UI responsive during data processing.
  • Accommodation Search: Start by searching for available accommodations based on your preferences such as location, dates, number of persons, price range, and rating.
  • Booking and Review: Once you find a suitable room, proceed to book it. After booking, you'll have the opportunity to leave a review based on your experience.

Contributors


You can find a demo video here :

<iframe src="https://player.vimeo.com/video/971109087?title=0&byline=0&portrait=0&badge=0&autopause=0&player_id=0&app_id=58479" frameborder="0" allow="autoplay; fullscreen; picture-in-picture; clipboard-write" style="position:absolute;top:0;left:0;width:100%;height:100%;" title="distributed-hotel-booking-demo"></iframe>
<script src="https://player.vimeo.com/api/player.js"></script>

distributed-hotel-booking's People

Contributors

ippo03 avatar nikomahos avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

nikomahos

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.