This repository contains the source code for the FlightSearch of FlyFast.
For the source code of the WebUI, head over to the WebUI. This will provide a WebUI to make calls to the FlightSearch.
To view the full source code and to run the whole application through Docker, head over to FlyFast.
- Git (Optional)
- a Docker host, for example Docker Desktop (Optional)
- Python 3.7 (Required)
- WebUI (Required Only For Having A UI)
- Clone/download this repository.
git clone https://github.com/Aternity/FlyFast-FlightSearch.git
- Using the terminal, change the directory to the folder of this project.
cd FlyFast-FlightSearch
- You can either start the application using Python or Docker.
- Install the dependencies required to run this application:
pip install -r requirements.txt
- Make sure to set the environment variables for the application.
-
COLLECTOR_URL
is the APM Collector URL, which should be on port55681
, if you are using the Aternity APM Collector.For example, with Bash:
export COLLECTOR_URL="http://localhost:55681/v1/traces"
or with Powershell:
$env:COLLECTOR_URL="http://localhost:55681/v1/traces"
-
- Start the application and open http://localhost:8080 to view it in your browser.
py src/main.py
- Build our docker:
docker build . -t flyfast-flightsearch
- Run our docker container, make sure to set the environment variables for the application:
COLLECTOR_URL
is the APM Collector URL, which should be on port55681
, if you are using the Aternity APM Collector.
docker run --rm -p 8080:8080 -e COLLECTOR_URL=http://localhost:55681/v1/traces flyfast-flightsearch
- Open http://localhost:8080 to view it in your browser.
Functionality | API Request | Fields |
---|---|---|
Airport Typeahead | /flightsearchapi/airportypeahead?searchtxt=${text}&limit=${limit} |
- text - text- limit - limit response |
Single Trip | /flightsearchapi/searchflight?from=${from}&to=${to}&departure=${departureDate}&seat=${seatType} |
- from - 3 Letter Airport- to - 3 Letter Airport- departureDate - MM-DD-YYYY- seatType - Economy, Premium Economy, Business, First |
Round Trip | /flightsearchapi/searchflight?from=${from}&to=${to}&departure=${departureDate}&return={returnDate}&seat=${seatType} |
- from - 3 Letter Airport- to - 3 Letter Airport- departureDate - MM-DD-YYYY- returnDate - MM-DD-YYYY- seatType - Economy, Premium Economy, Business, First |
[
{
"value": ${airport},
"name": ${airportName},
"city": ${city},
"country": ${country}
}
]
[
[
{
"from": ${from},
"to": ${to},
"flights": [
{
"id": ${id},
"flightNumber": ${flightNumber},
"airline": ${airline},
"from": ${from},
"to": ${to},
"departureTime": ${departureTime},
"arrivalTime": ${arrivalTime},
"seat": ${seat},
"fare": ${fare}
},
{
"id": ${id},
"flightNumber": ${flightNumber},
"airline": ${airline},
"from": ${from},
"to": ${to},
"departureTime": ${departureTime},
"arrivalTime": ${arrivalTime},
"seat": ${seat},
"fare": ${fare}
}
],
"departureTime": ${departureTime},
"arrivalTime": ${arrivalTime},
"fare": ${fare}
}
]
]
response[0][0] - Contains to flight details
response[0][1] - Contains return flight details
[
[
{
"from": ${from},
"to": ${to},
"flights": [
{
"id": ${id},
"flightNumber": ${flightNumber},
"airline": ${airline},
"from": ${from},
"to": ${to},
"departureTime": ${departureTime},
"arrivalTime": ${arrivalTime},
"seat": ${seat},
"fare": ${fare}
},
{
"id": ${id},
"flightNumber": ${flightNumber},
"airline": ${airline},
"from": ${from},
"to": ${to},
"departureTime": ${departureTime},
"arrivalTime": ${arrivalTime},
"seat": ${seat},
"fare": ${fare}
}
],
"departureTime": ${departureTime},
"arrivalTime": ${arrivalTime},
"fare": ${fare}
}
],
[
{
"from": ${from},
"to": ${to},
"flights": [
{
"id": ${id},
"flightNumber": ${flightNumber},
"airline": ${airline},
"from": ${from},
"to": ${to},
"departureTime": ${departureTime},
"arrivalTime": ${arrivalTime},
"seat": ${seat},
"fare": ${fare}
},
{
"id": ${id},
"flightNumber": ${flightNumber},
"airline": ${airline},
"from": ${from},
"to": ${to},
"departureTime": ${departureTime},
"arrivalTime": ${arrivalTime},
"seat": ${seat},
"fare": ${fare}
}
],
"departureTime": ${departureTime},
"arrivalTime": ${arrivalTime},
"fare": ${fare}
}
]
]
Copyright (c) 2022 Riverbed Technology, Inc.
The contents provided here are licensed under the terms and conditions of the MIT License accompanying the software ("License"). The scripts are distributed "AS IS" as set forth in the License. The script also include certain third party code. All such third party code is also distributed "AS IS" and is licensed by the respective copyright holders under the applicable terms and conditions (including, without limitation, warranty and liability disclaimers) identified in the license notices accompanying the software.