Integrate OpenFlights API for free, no-auth flight data generation

- Added openFlightsService.js to fetch and cache OpenFlights airport/airline/routes data
- Validates airport codes exist in OpenFlights database (6072+ airports)
- Generates realistic flights using major international airlines
- Creates varied routing options: direct, 1-stop, 2-stop flights
- Updated flightService.js to use OpenFlights as primary source before Amadeus
- OpenFlights as fallback if Amadeus unavailable or returns no results
- No API keys or authentication required
- Cached locally to avoid repeated network requests
- Realistic pricing, times, and stop locations

Docker container rebuilt with OpenFlights integration.
This commit is contained in:
2026-01-13 10:32:05 -05:00
parent 969ba062f7
commit 66b72d5f74
15 changed files with 82237 additions and 40 deletions

18
scripts/db_summary.py Normal file
View File

@@ -0,0 +1,18 @@
import sqlite3
conn = sqlite3.connect('data/travel_rates_scraped.sqlite3')
cur = conn.cursor()
cur.execute('SELECT COUNT(*) FROM rate_entries')
print('Per-diem entries:', cur.fetchone()[0])
cur.execute('SELECT COUNT(*) FROM accommodations')
print('Accommodation entries:', cur.fetchone()[0])
cur.execute('SELECT COUNT(DISTINCT country) FROM rate_entries WHERE source="international"')
print('Countries with per-diem:', cur.fetchone()[0])
cur.execute('SELECT COUNT(DISTINCT city) FROM accommodations')
print('Canadian cities with accommodation listings:', cur.fetchone()[0])
conn.close()