This projects creates an application which helps the user to
book a ticket for the journey.The main part of the project is to
maintain concurrency when multiple users request for booking the
same seat.
You need to have a git environment in your local machine.
Enter these commands
sudo apt install git
You need to have QT work frame to run the project.Download it
from this link:
After install run these commands:
sudo apt-get install libqt4-dev
Make sure you have proper version of it
A quick introduction of the minimal setup you need to get a
copy of the project and running.Run the
Run BookMyJourney.pro using qt.
Go to the directory where the project is extreacter and run this
command to build the project.
qmake -project && qmake && make
We can run it in qt also after opening the BookMyJourney.pro
A run buttun is present in the left bottom of the window or else
CTRL+R will also run the project
To run the project we should first establish a connection to server,for that make sure that the server is running.To run the server in your machine run server.cpp Run these commands :
g++ server.cpp -pthread -o output
./output
This application is a sample of ticket booking system with core
concept of concurrency when multiple users try to book same ticket
at the same time.When we run the project first dialog requires us toi
enter the account details to Log into the app.If the user doesn’t
have an account he can create it also.
After log in ,user needs to select the origin and destination of
his/her journey and the date of the journey.Booking is allowed only
upto same date of next month.
After that he/she needs to select the seats he/she like.A disabled
seats means that it already booked and seats selected will be
displayed in red color.
After that user needs to confirm the terms and conditions and make
payment.A timer will be started and he/she should should make
payment before the timer ends or else the tickets will be lost.After
selecting the confirm booking that seats will be locked and before
the timer ends these seats cannot be booked by anyone.
When the server goes off accidentally the data is in the server backed up to into two files
named 1.details.txt -> which stores the details of user and his journey
2.seats.txt -> which stores the seatmatrices.
File test.cpp runs the test and makes sure that concurrency in the server is working fine.
It creates multiple users who try to book same ticket and ensures that only one user books it.
g++ test.cpp -pthread -o output
./output
These tests test where there are mistakes in
coding style in our project.Coding style used in this project is Google coding style.
To run the following test run this command
python cpplint.py <c++filename>