A flight analytics system that fetches real-time flight data from the AeroDataBox API, stores it in PostgreSQL (hosted on Supabase), and visualizes insights through a Streamlit dashboard (hosted on Streamlit Cloud).
flight-air/
├── src/
│ ├── api/
│ │ ├── client.py # Fetches flight data from AeroDataBox API
│ │ └── models.py # Pydantic models for API response data
│ ├── database/
│ │ ├── db_manager.py # PostgreSQL connection, table setup, insert/fetch helpers
│ │ └── queries.py # Pre-written analytical SQL queries
│ ├── pipeline/
│ │ └── collect_data.py # data collection pipeline
│ ├── services/
│ │ └── analytics_service.py # query methods for the dashboard
│ ├── dashboard/
│ │ └── app.py # Streamlit dashboard (3 tabs: Overview, Flights, Airports)
│ └── config.py # Airport codes, API sleep time, lookback days
├── sql/
│ └── sql_queries.sql # All analytical SQL queries in one file
├── requirements.txt # Python dependencies
└── README.md # This file
The dashboard is deployed live on Streamlit Cloud and the database is hosted on Supabase (PostgreSQL).
If you want to run or modify the project locally:
pip install -r requirements.txtCreate a .env file in the project root with your Supabase or local PostgreSQL credentials:
DB_HOST=your_supabase_host
DB_PORT=5432
DB_NAME=postgres
DB_USER=postgres.your_project_ref
DB_PASSWORD=your_password
AERODATABOX_API_KEY=your_api_key_here
Get an API key: Sign up at AeroDataBox and get a free API key.
python -m src.pipeline.collect_dataThis fetches flight data for 6 airports (EGLL, EGKK, CYVR, CYYZ, OMDB, YSSY) and stores it in PostgreSQL.
streamlit run src/dashboard/app.pyYour browser will open with 3 tabs:
- Overview — flight status breakdown, route type distribution
- Flight Analysis — Top 10 airlines, Top 10 busiest routes
- Airports — Delay index comparison by airport
All SQL queries are in sql/sql_queries.sql and src/database/queries.py.
- Python — Data collection, processing, and analysis
- PostgreSQL — Data storage (hosted on Supabase)
- Streamlit — Dashboard UI (hosted on Streamlit Cloud)
- AeroDataBox API — Flight data source