Demo @ https://travel-advisory.herokuapp.com/
- 1. About The Project
- 2. Objectives
- 3. Getting Started
- 4. Schema
- 5. User Flow
- 6. Data
- 7. Additional Resources
- 8. Future Considerations
Global travel is not without perils. This project aggregates data from a variety of APIs to construct a cohesive site presenting useful travel information (with up to date advisories and COVID trends) to help a visitor determine if a destination is safe.
- Allows a visitor to view country advisories for travel planning
- Allows an authenticated visitor to bookmark countries
-
- Postgresql installation
- Python 3.8.5
- Create an account with Tugo to register for a free API Key
-
- Clone the repository
- Create empty database 'travel' and run seed.py
- Set up venv and install dependencies from requirements.txt
-
- The APIs used may occasionally go down or have such slow response triggering a timeout
- The APIs used may not have data for all countries
- Table for users containing username, password, and email
- Tables for countries, languages, and currencies
- Country + language mapping table (when a country has more than one widely used language)
- Country + currency mapping table (when a country has more than one widely used currency)
- On the entry homepage, the user is presented with a list of countries.
- The user may also search for a country from the navbar search box by typing in a country code or country name.
- A valid country entry will direct the user to a page with travel advisories and COVID statistics.
- Additional country information such as languages and currencies will also be presented.
- A user may create an account or login with an existing account.
- A valid account will present options to bookmark countries and show those countries on the entry homepage.
- Tugo - Travel Safe API
- Travel-Advisory.info - Advisory levels API
- disease.sh - COVID data and historical counts
- restcountries.eu - Global country list and basic data
- Chart.js - Generate graphs from data
- Boostrap 5.0 - Layout and design
- Font Awesome - Icons
Chart.js is useful and powerful however my implementation is kludging Javascript into HTML with Jinja variables. To separate responsibilities, the script can be offloaded as a function in a JS file and the canvas can call the function on load, passing in the data as variables. Done!
Finally, since this project relies on so many external APIs with limited or inconsistent behavior, it may be worthwhile exercise to develop a scraper and gather the data directly from government sites (US state department, CIA world factbook, etc) to generate one's own set of data.