This repository contains codebase fot the airline ticket reservation system. The system is built using Python 3 and Flask framework, and the database is deployed using Docker image of MySQL server.
The system is designed to be used by three types of users: airline staff, booking agent, and customer.
The airline staff can add new flights, view the list of flights, and view the list of customers on a specific flight. Apart from that, airline staff who have the admin access can add / delete / modify the booking agents, view the top customers, and view the commission. Also, they could add new airports and view the list of airports.
The booking agent can book a flight for a customer, view the top customers, and view their own commission for the specified period of time.
The customer can search flights, book flights, and view their own flight history.
The system is designed and intended to be user-friendly and easy to deploy. The front-end design is based on Bootstrap library.
I am currently working on reorganizing the structure of the project, so if you want to help me with that – be my guest and submit a pull request. I would be very glad to review it!
For more information of how the database design is implemented please refer to sql_scripts/
folder, as it contains all the information about the database design and the mock data.
Before deploying the system, ensure that the following prerequisites are met:
.env.example
file for more information):make copy-env
Note: the database we refer to is stored in other/database_design/create_tables.sql file. The database is created using the SQL script, and the mock data is inserted using the insert_data.sql file in the same folder.
You could run those files manually to create the database and populate it with mock data.
To deploy the system, follow these steps:
Note: the following commands are for Mac OS. If you are using Windows, please refer to the official documentation of Python 3 and Docker.
Note2: Please ensure that you are in the main folder of the cloned repository prior to running any commands.
cd air-ticket-system
Now let’s create your own virtual environment:
python3 -m venv .venv
Now make sure that you are in the virtual environment by running the following command:
source venv/bin/activate
Once you are in the virtual environment, install the required packages:
pip install -r requirements.txt
Now, as all the prereqs are met, let’s deploy the system itself:
docker-compose up
docker-compose start
Create the database and run the create_tables.sql
file, then insert_data.sql
to populate the database with mock data. To do this simply go to your SQL GUI and run the files manually. I was in a rush, so I didn’t have time to automate this process. Sorry :)
In the flask_app.py
file, run the file manually to start the system. The system can be accessed at http://127.0.0.1:5000. If you encounter any errors, check if your port 5000 is available. Again, I was in a rush, so I didn’t have time to automate this process either.
If you have any suggestions or ideas on how to improve the project, please contact the project owner or submit an issue describing your suggestion or concern in detail. Contributions are welcome.
This project is licensed under the MIT license. See MIT Licence for more details.
docker run --name air-ticket-system -e MYSQL_ROOT_PASSWORD=123456 -p 3307:3306 -d mysql:latest