This guide provides instructions on how to run the Flight Booking System, a Flask application for managing flight bookings.
Before running the application, ensure that you have the following installed:
- Python 3
- pip (Python package manager)
-
Clone the repository to your local machine:
git clone <repository_url>
-
Navigate to the project directory:
cd <project_directory>
-
Install the required Python packages using pip:
pip install -r requirements.txt
Before running the application, you may need to configure the database URI in the config.py
file. By default, the application uses SQLite.
To run the application, execute the following command:
python flight-booking.py
The Flask development server will start, and you should see output indicating that the server is running.
Once the application is running, you can access the API endpoints using an HTTP client such as Postman or cURL. Here are some example endpoints:
- User Signup:
POST http://localhost:5000/user/signup
- User Login:
POST http://localhost:5000/user/login
- Search Flights:
GET http://localhost:5000/flights/search
- Book Flight:
POST http://localhost:5000/flights/book
- User Bookings:
GET http://localhost:5000/user/bookings
- Admin Login:
POST http://localhost:5000/admin/login
- Add Flight:
POST http://localhost:5000/admin/flights/add
- Remove Flight:
POST http://localhost:5000/admin/flights/remove
- Admin Bookings:
GET http://localhost:5000/admin/bookings
Ensure you provide the necessary parameters and headers as required by each endpoint.
To stop the Flask development server, press Ctrl + C
in the terminal where the server is running.