Skip to content

blu3-bird/flight-air

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flight Air Tracker

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).

Project Structure

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

Live Demo

The dashboard is deployed live on Streamlit Cloud and the database is hosted on Supabase (PostgreSQL).

Local Development

If you want to run or modify the project locally:

1. Install Dependencies

pip install -r requirements.txt

2. Configure Environment Variables

Create 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.

3. Collect Data

python -m src.pipeline.collect_data

This fetches flight data for 6 airports (EGLL, EGKK, CYVR, CYYZ, OMDB, YSSY) and stores it in PostgreSQL.

4. Launch the Dashboard Locally

streamlit run src/dashboard/app.py

Your 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.

Built With

  • Python — Data collection, processing, and analysis
  • PostgreSQL — Data storage (hosted on Supabase)
  • Streamlit — Dashboard UI (hosted on Streamlit Cloud)
  • AeroDataBox API — Flight data source

About

A professional-grade aviation analytics platform leveraging the AeroDataBox API to deliver deep insights into global flight patterns, airport operations, and operational efficiency through automated data pipelines and interactive visualizations.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages