Git Product home page Git Product logo

accommodation-management-system's Introduction

About

This is a project about managing an Accommodation System, like Booking.com . It comprises of backend and frontend components.

Backend

The backend component are the servers handling the requests for the accomodations, including booking, reviewing and filtering rooms. It follows the Map Reduce framework where there's a Master node receiving the requests from the user and the manager, and delegates the requests to the Worker nodes, each of which saves a number of rooms. There's also a Reducer Node that is used to aggregate the results from the Worker nodes when filtering rooms, and send it back to the Master node.

All the servers are multithreaded to handle multiple requests at the same time, and also handle synchronization issues when accessing shared resources.

The backend system also uses active replication. This means that all the Worker nodes also save the rooms of all the other Worker nodes in a HashMap containing all the replica rooms for every other Worker node. This way when a Worker Node is down, the requests are rerouted to a Worker node that is up and running, and thus using the the replica rooms. Also for every request received by the Master node, the replica rooms are also updated.

Below is a graphical representation of how filtering works using the Map Reduce framework

image

Frontend

As for the frontend component there's 2 cli apps and one android app.

The first cli app is the one for the Manager, who is responsible for adding the rooms to the backend system. This cli app can also show the rooms that were added by the manager and the bookings for his rooms.

The second cli app is the one for the User, who can book, review and search rooms added in the backend system.

The android app has the same functionality as the user cli app.

How to use

Setting up Backend system

First, you have to set up the backend component. You have to run the Master, Worker and Reducer classes. Before that you have to edit the config.properties file with the correct values for the local ip and port of the Master, Reducer and Workers.

This project is configured to be run on the same network. To acquire the local ip of your machine you can use the following command in the command prompt:

ipconfig

The Master and Reducer nodes can be run on the same or different machines.

There's multiple ways to run the Worker nodes. One way it to run multiple Worker nodes on the same machine. To do that make sure that all Worker ports are different. Then to run each Worker node, insert a parameter to declare which Worker node to run. For example to run Worker node 2 insert 2 as the parameter.

To run the Worker nodes at different machines you dont have to insert any parameter.

In all cases make sure to update the config file in all machines running a server of the backend component.

Using Frontend component

First you have to build the project to download the org.json dependency from the maven file.

Then you have to run the Manager class to add some rooms in the backend system. There's already some rooms in the rooms directory. You can add your own custom rooms by saving a json file in the rooms directory in the following form:

{
	"roomName": "Olive Retreat",
	"noOfPersons":"4",
	"area": "Athens",
	"stars": "4.1",
	"noOfReviews": "2472",
	"price": 80,
	"roomImage": "images/olive_retreat.jpg"
}

When you add a room you are asked to select an image from the images directory. You can add your own images by saving an image in the images directory.

After that you can either use the User cli app or the android app to search, book and review a room.

Make sure to edit the config file on the machines that you use the Manager and User cli apps. In the Android app you can edit it when first opening the app.

Screenshots

Manager console app Worker console
Search room filters Room description

accommodation-management-system's People

Contributors

abki12c avatar

Watchers

 avatar

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.