Finding the cheapest flight is difficult as it requires searching multiple sites which each providing insufficient search parameters for those with travel flexibility. hard if you're not someone who is searching multiple blog sites and travel websites constantly. We have all been professionals, where we had more money than we had time. But now it's the opposite. We want to find the cheapest flight for ourselves without the spending countless hours surfing through the web.
What it does
Users can define (# Travelers, Origin, Destination, Start Date, End Date, Min Trip Duration, Max Trip Duration) to find the cheapest flight. The app will scrape web data and present the cheapest flight under the user's criteria. There's currently no best way to find the cheapest flight with parameters this broad. For example, this app will allow users to discover that perhaps a 7 day trip from ORD to DEN is the cheaper than 6 day trip. This is Google flights and Hopper upgraded!
How I built it
Frontend: The frontend was built in React/JS relying on prebuilt components, most notably React components for Google Maps and calendaring. We scraped airline data and their positions to render them interactively on the screen.
Backend: The backend was built in Python/Flask. The majority of the work involved web scraping Kayak to get the cheapest flights for a given window, and then computing historical price averages to get a sense of whether a flight would be a good deal.
Integration: The React frontend integrates with the backend via a RESTful API that calls out to a Flask server that contains a mass of scraped data w/ historical price averages for nearly all given routes.
Challenges I ran into
Front End - Getting the frontend divs right required lots of CSS tweaking, despite using some prebuilt React components (calendar, mapping window). Generating an interactive map with the ability to control the start/end destinations on-the-fly posed a challenge as well, and figuring out how to draw geodesics between airport locations was a huge PITA.
Back End - reCaptchas bot checks made the scraping tough. We had to slow down our scrape attempts and implement wait conditions in order to not trip these checks. Web scrapping a non-standard HTML site like Kayak posed challenges as well as it required us to scrape by emulating a person clicking through a browser (Python's Selenium Module).
Accomplishments that I'm proud of
The frontend is strong considering it was built from scratch by a newbie to React. The backend is robust with strong exception error handling. Overall this resulted in an app that we are proud of!
What I learned
This was a new experience for all of us as some members did not have experience web scrapping while others were new to front end development. We all got more familiar with callbacks and reading different languages which we previously were not familiar with.
What's next for FlexFlights
We will use it for ourselves to make it more user friendly. There are many more features we could add if we had more than a weekend. Plans to have the app notify users when flights are cheapest or when the cheaper flight is found. Also plans to suggest related flights to users. Perhaps a user who wants to visit Panama would be open to visiting the Bahamas as well.
Personally, this is something we built because we saw a huge need. We would love to spend more time fleshing it out and building its capabilities so other people can use it to search for flights.