Punit Project
Punit Project
Submitted by
SCHOOL OF COMPUTING
COLLEGE OF ENGINEERING AND TECHNOLOGY
SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
(Under Section 3 of UGC Act, 1956)
S.R.M. NAGAR, KATTANKULATHUR – 603 203
CHENGALPATTU DISTRICT
November 2023
1|Page
COLLEGE OF ENGINEERING AND TECHNOLOGY
SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
(Under Section 3 of UGC Act, 1956)
S.R.M. NAGAR, KATTANKULATHUR – 603 203
BONAFIDE CERTIFICATE
Certified that Mini project report titled Bus Reservation Portal is the bonafide work of Reg.No
RA2311056010173 Punit Joshi who carried out the minor project under my supervision. Certified further,
that to the best of my knowledge, the work reported herein does not form any other project report or
dissertation on the basis of which a degree or award was conferred on an earlier occasion on this or any
other candidate.
SIGNATURE SIGNATURE
2|Page
COLLEGE OF ENGINEERING AND TECHNOLOGY
SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
(Under Section 3 of UGC Act, 1956)
S.R.M. NAGAR, KATTANKULATHUR – 603 203
BONAFIDE CERTIFICATE
Certified that Mini project report titled Bus Reservation Portal is the bonafide work of Reg.No
RA2311056010157 Saiswaroop Nayak who carried out the minor project under my supervision. Certified
further, that to the best of my knowledge, the work reported herein does not form any other project report
or dissertation on the basis of which a degree or award was conferred on an earlier occasion on this or any
other candidate.
SIGNATURE SIGNATURE
3|Page
TABLE OF CONTENTS
5-6
1 Problem Statement
7-8
2 Methodology / Procedure/ Algorithm
9
3 Flowchart
10-14
4 Coding (C/Python)
15
5 Front-end code (HTML, CSS, Javascript)
16
6 Modules of the proposed work
17-20
7 Results/Screenshots
21
8 Conclusion
22
9 References
4|Page
1. Problem Statement
Problem Statement for Bus Reservation System:
Problem Statement:
The existing bus reservation system faces a critical challenge in optimizing ticket bookings for passengers
seeking to secure seats at the minimum fare within a 24-hour timeframe. Current reservation platforms
lack a robust mechanism to dynamically analyze and adapt ticket prices based on real-time demand,
resulting in suboptimal fare structures for passengers. This problem significantly impacts user satisfaction,
as passengers often miss out on cost-effective ticket options due to the absence of a proactive fare
optimization system.
The objective of this project is to design and implement an advanced bus reservation system that employs
data-driven algorithms to continuously assess demand patterns and adjust ticket prices accordingly. The
system should allow users to input their travel details, and within 24 hours, receive a booking
recommendation that ensures the reservation of seats at the lowest possible fare. This solution should
prioritize user preferences, such as seat preferences and travel times, while dynamically optimizing fare
structures to strike a balance between affordability and profitability for the service provider.
Key Challenges:
1. Dynamic Fare Optimization: Develop algorithms capable of analyzing real-time demand data to
dynamically adjust ticket prices, ensuring passengers receive the best available fare within the 24-hour
booking window.
2. User Preferences Integration: Incorporate user-specific preferences, such as seat selection and
preferred travel times, into the fare optimization process to enhance the overall user experience.
3. Real-time Data Processing: Implement a robust system for collecting, processing, and analyzing real-
time data related to bus seat availability, historical booking patterns, and market demand.
4. Secure and Efficient Transaction Handling: Ensure that the system maintains the highest standards
of security for user data and transactions while providing a seamless and efficient booking experience.
5|Page
5. User Notification System: Develop a notification system to inform users of optimal booking
opportunities within the 24-hour window, considering their specified preferences and current market
conditions.
The successful implementation of this bus reservation system will not only enhance the user experience
by offering cost-effective ticket options but also contribute to the overall efficiency and competitiveness
of the bus service provider in the market.
6|Page
2. Methodology / Procedure/ Algorithm
Methodology:
1. User Registration:
- Users must register on the bus reservation system by providing essential details like name, contact
information, and payment details.
3. User Input:
- Users input their travel details, including the source, destination, preferred travel date, and time.
5. Fare Calculation:
- The system calculates the fare for each available option, considering factors like distance, time, and
any additional services.
7. User Confirmation:
- Present the user with the details of the selected option, including bus details, schedule, and total fare.
8. Reservation Confirmation:
- Upon user confirmation, reserve the selected bus seats and generate a unique booking ID.
9. Payment Processing:
7|Page
- Initiate payment processing using the stored payment details, ensuring a secure transaction.
11. Notification:
- Notify the user about the successful booking, along with the ticket details.
Procedure:
1. User Interaction:
- Users interact with the system through a user-friendly interface, providing necessary details.
2. System Processing:
- The system processes the user's input, searching for available options and calculating fares.
3. User Confirmation:
- The system presents the user with the best option, and upon confirmation, reserves seats and initiates
payment.
4. Payment Confirmation:
- Upon successful payment, the system generates an electronic ticket and notifies the user.
5. Booking Records:
- Maintain a record of bookings for reference and reporting purposes.
6.Timeout Handling:
- Implement a mechanism to handle cases where the user does not confirm within the specified time
frame (24 hours).
By following this methodology, procedure, and algorithm, the bus reservation system can efficiently book
tickets at the minimum fare within 24 hours of receiving user details.
8|Page
3. Flow chart
9|Page
4. Coding (Python)
app = Flask(__name__,template_folder='image')
app.config["SQLALCHEMY_DATABASE_URI"] = 'mysql://root:@localhost/bus reservation'
class Base(DeclarativeBase):
pass
db = SQLAlchemy(model_class=Base)
db.init_app(app)
class Contacts(db.Model):
sno: Mapped[int] = mapped_column(Integer, primary_key=True)
name: Mapped[str] = mapped_column(String, nullable=False)
email: Mapped[str] = mapped_column(String, nullable=False)
phone: Mapped[int] = mapped_column(Integer, nullable=False)
msg: Mapped[str] = mapped_column(String, nullable=False)
date: Mapped[str] = mapped_column(String, nullable=True)
class Tickets(db.Model):
sno: Mapped[int] = mapped_column(Integer, primary_key=True)
aadhaar: Mapped[str] = mapped_column(String, nullable=False)
Name: Mapped[str] = mapped_column(String, nullable=False)
Contact_no: Mapped[str] = mapped_column(String, nullable=False)
Board_place: Mapped[str] = mapped_column(String, nullable=False)
Destination: Mapped[str] = mapped_column(String, nullable=False)
Date: Mapped[str] = mapped_column(String, nullable=True)
class Payment(db.Model):
card_no: Mapped[int] = mapped_column(Integer, primary_key=True)
exp: Mapped[str] = mapped_column(String, nullable=False)
cvv: Mapped[str] = mapped_column(String, nullable=False)
name: Mapped[str] = mapped_column(String, nullable=False)
date: Mapped[str] = mapped_column(String, nullable=True)
10 | P a g e
@app.route("/")
def hello():
return render_template("15-10-2023.htm")
Dear {Name},
Thank you for choosing EFare Bus Booking for your upcoming journey from {board} to
{dest}. We are delighted to confirm your ticket reservation, and we appreciate the opportunity to
serve you.
Booking Details:
- Departure City: {board}
- Destination City: {dest}
- Bus Service: Multani Sona / TN 09 CVXY 1425
Passenger Details:
- Passenger Name: {Name}
- Email Address: {cont}
Payment Details:
We would like to inform you that the payment for your ticket has been successfully
processed. Below are the payment details:
11 | P a g e
Please keep this email for your records, as it serves as confirmation of your booking and payment. In
case you have any questions or concerns regarding your reservation, feel free to contact our customer
support team at [Customer Support Email/Phone Number].
We wish you a pleasant and comfortable journey with EFare Bus Booking. Thank you
for trusting us with your travel needs.
Safe travels!
Best regards,
server = smtplib.SMTP("smtp.gmail.com",587)
server.starttls()
server.login("[email protected]","rhyp gkgc azro ewlj")
server.sendmail("[email protected]", cont, message1)
return render_template("30-10-2023.htm")
return render_template("payment.htm")
@app.route("/payment_success")
def payment_success():
return render_template("payment_success.htm")
12 | P a g e
email=request.form.get('email')
phone=request.form.get('phone')
msg=request.form.get('msg')
entry = Contacts(name=name,email=email,phone=phone,msg=msg,date=datetime.now())
db.session.add(entry)
db.session.commit()
message=f"""
Subject: Your Recent Bus Booking Inquiry
Dear {name},
I hope this email finds you well. My name is Punit, and I am reaching out to you in
response to your recent inquiry on our bus booking website. We appreciate your interest in our
services and are delighted to assist you with your travel plans.
We understand that planning a journey can be a meticulous task, and we are here to make
the process as smooth as possible for you. To better assist you, could you please provide us with
some additional details regarding your travel requirements? This information will help us tailor our
services to meet your specific needs:
1. Travel Date and Time: When are you planning to embark on your journey, and at what
time?
2. Departure and Arrival Locations: Which cities or towns do you plan to travel from and
to?
3. Preferred Amenities: Are there any specific amenities or features you are looking for in
a bus service?
4. Budget Constraints: Do you have any budget constraints or preferences for the type of
bus service you are interested in?
Once we have these details, we can present you with the best available options that align
with your preferences. Our goal is to ensure that you have a comfortable and enjoyable travel
experience.
Feel free to reply to this email with the required information, or if you prefer, you can
contact our customer support team at 97564-55141 for immediate assistance. We are committed to
providing you with top-notch service and making your journey a memorable one.
Thank you for choosing EFare Bus Booking for your travel needs. We look forward to
serving you and making your upcoming journey a pleasant and stress-free experience.
Safe travels!
Best regards,
13 | P a g e
Punit
EFare Bus Booking
[email protected]
"""
server = smtplib.SMTP("smtp.gmail.com",587)
server.starttls()
server.login("[email protected]","rhyp gkgc azro ewlj")
server.sendmail("[email protected]",email,message)
return render_template("21-10-2023.htm")
@app.route("/about")
def about():
return render_template("29-10-2023.htm")
app.run(debug=True)
14 | P a g e
5. Front-end code (HTML, CSS, Javascript)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/png" href="{{ url_for ('static', filename= 'bus.png' ) }} "/>
<title>Bus Reservation Portal</title>
<link rel="stylesheet" href="{{ url_for ('static', filename= '15-10-2023.css' ) }} ">
<link rel="stylesheet" href="15-10-2023.css">
<script src="https://kit.fontawesome.com/a972b744c3.js" crossorigin="anonymous"></script>
</head>
<body>
<div class="navo">
<div class="ca open">
<i class="fa-solid fa-bus fa-beat fa-2xl"></i><a href="/">EFare</a>
</div>
<div class="da">
<div class="open">
<i class="fa-solid fa-house"></i><a href="/">Home</a>
</div>
<div class="open">
<i class="fa-solid fa-ticket"></i><a href="/tickets">Tickets</a>
</div>
<div class="open">
<i class="fa-solid fa-phone"></i><a href="/contact">Contact Us</a>
</div>
<div class="open">
<i class="fa-solid fa-address-card"></i><a href="/about">About Us</a>
</div>
</div>
</div>
<div class="abc">
<h1>India's No. 1 Online Bus Ticket Booking Site</h1>
<h1 style="color: darkred;">Bring's Everyone Closer....</h1>
<a href="/tickets">GET STARTED</a>
</div>
</body>
</html>
15 | P a g e
6. Modules of the proposed work
➢ Home Page
✓ Flask
➢ Ticket Booking
o Flask
o MySQL
o SMTP
o TIME
➢ Contact Us
o Flask
o MySQL
o SMTP
o TIME
➢ About Us
o Flask
16 | P a g e
7. Results/Screenshots
17 | P a g e
(iii) Payment Page
18 | P a g e
(iv) Payment Successful
(v) Contact Us
19 | P a g e
(vi) About Us
20 | P a g e
8. Conclusion
In conclusion, the implementation of a bus reservation portal presents a myriad of benefits for both
service providers and passengers alike. This technological solution streamlines the entire bus booking
process, offering convenience, efficiency, and improved customer satisfaction.
For passengers, the portal provides a user-friendly interface that allows for easy browsing, seat
selection, and secure online payments. This translates into a hassle-free experience, saving time and
effort compared to traditional booking methods. Additionally, real-time information on bus schedules,
seat availability, and route details enhances transparency and helps users make informed decisions.
From the perspective of bus service providers, the portal offers a centralized platform for managing
bookings, reducing administrative burdens, and minimizing the risk of errors. Automated ticketing,
passenger tracking, and reporting functionalities contribute to operational efficiency and enable better
decision-making. The integration of payment gateways ensures secure transactions, fostering trust
among users.
Furthermore, the bus reservation portal contributes to environmental sustainability by reducing the
need for physical tickets and paperwork, promoting a more eco-friendly approach to travel.
In summary, a well-designed bus reservation portal is a win-win solution that transforms the booking
process into a seamless and enjoyable experience for passengers while enhancing operational
efficiency and reducing environmental impact for service providers. As technology continues to
advance, the ongoing evolution of such portals promises even greater benefits for the future of bus
travel.
21 | P a g e
9. References
https://flask-sqlalchemy.palletsprojects.com/en/3.1.x/quickstart/
https://www.w3schools.com/html/html_intro.asp
https://www.google.com/
22 | P a g e