The Flight Booking System is a web-based application designed to manage flight reservations. It allows users to search for flights, book tickets, and manage their bookings. Additionally, there is an admin interface to manage flights, view bookings, and perform administrative tasks.
- Sign Up / Log In: Users can create an account and log in to access the system.
- Search Flights: Users can search for flights based on date and time.
- Book Tickets: Users can book tickets for flights with available seats.
- My Bookings: Users can view a list of all their bookings.
- Log Out: Users can securely log out of the system.
- Admin Log In: Admins have a separate login to access administrative functions.
- Add Flights: Admins can add new flights to the system.
- Remove Flights: Admins can remove existing flights from the system.
- View All Bookings: Admins can view bookings based on flight number and time.
- Backend Framework: Flask
- Database: MySQL
- Frontend: HTML, CSS
- ORM: SQLAlchemy (Flask-SQLAlchemy)
- Python Version: 3.8+
- Python 3.8+
- MySQL Server
- Virtual Environment (recommended)
-
Clone the Repository
git clone https://github.com/TheVinaySagar/flight-booking-system.git cd flight-booking-system
-
Set Up a Virtual Environment
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Dependencies
pip install -r requirements.txt
-
Configure MySQL Database
- Create a MySQL database.
- Update the
Config
class inconfig.py
with your database credentials.
-
Run Migrations
flask db init flask db migrate flask db upgrade
-
Start the Application
python run.py
-
Access the Application
- Open your web browser and go to
http://127.0.0.1:5000/
.
- Open your web browser and go to
- The admin interface can be accessed by logging in with an admin account.
- The system is pre-populated with sample flight data for testing purposes. Use the Admin interface to manage these entries.
- The system handles duplicate entries, and provides meaningful error messages for user input validation.
.
├── app/
│ ├── __init__.py
│ ├── routes.py
│ ├── models.py
│ ├── templates/
│ │ ├── index.html
│ │ ├── signup.html
│ │ ├── login.html
│ │ ├── search_flights.html
│ │ ├── my_bookings.html
│ │ ├── admin_login.html
│ │ ├── add_flight.html
│ │ ├── remove_flight.html
│ │ ├── view_bookings.html
│ ├── static/
│ ├── styles/
│ ├── index.css
│ ├── signup.css
│ ├── login.css
│ ├── search_flights.css
│ ├── my_bookings.css
│ ├── admin_login.css
│ ├── add_flight.css
│ ├── remove_flight.css
│ ├── view_bookings.css
├── config.py
├── run.py
├── README.md
├── requirements.txt