A comprehensive flight tracking system for Zagreb Airport arrivals that monitors flight status updates every 5 minutes and sends email notifications in Croatian. The system allows users to track up to 20 flights, manage email recipients, and receive notifications about status changes, delays, gate changes, and arrivals.
Sveobuhvatni sustav za praćenje dolaznih letova Zračne luke Zagreb koji provjerava ažuriranja statusa letova svakih 5 minuta i šalje e-mail obavijesti na hrvatskom jeziku. Sustav omogućuje korisnicima praćenje do 20 letova, upravljanje primateljima e-pošte i primanje obavijesti o promjenama statusa, kašnjenjima, promjenama izlaza i dolascima.
- Real-time monitoring of Zagreb Airport arrivals
- Track up to 20 flight numbers simultaneously
- Email notifications for flight status changes, delays, gate changes, and arrivals
- User-friendly web interface in Croatian language
- Responsive design for desktop and mobile devices
- Configurable notification settings
- Automatic data refresh every 5 minutes
- Praćenje dolazaka na Zračnu luku Zagreb u stvarnom vremenu
- Istovremeno praćenje do 20 brojeva letova
- E-mail obavijesti o promjenama statusa leta, kašnjenjima, promjenama izlaza i dolascima
- Korisničko sučelje na hrvatskom jeziku
- Responzivni dizajn za desktop i mobilne uređaje
- Prilagodljive postavke obavijesti
- Automatsko osvježavanje podataka svakih 5 minuta
The system consists of the following components:
- Frontend: HTML, CSS, and JavaScript web interface that allows users to interact with the system
- Backend API: Flask-based REST API that handles requests from the frontend
- Scraper: Python module that fetches flight data from the Zagreb Airport website
- Scheduler: Background service that periodically checks for flight updates
- Email Service: Module that sends email notifications when flight status changes are detected
- Configuration: JSON-based configuration system for storing user preferences
Sustav se sastoji od sljedećih komponenti:
- Frontend: HTML, CSS i JavaScript web sučelje koje omogućuje korisnicima interakciju sa sustavom
- Backend API: REST API baziran na Flask-u koji obrađuje zahtjeve s frontenda
- Scraper: Python modul koji dohvaća podatke o letovima s web stranice Zračne luke Zagreb
- Scheduler: Pozadinski servis koji periodički provjerava ažuriranja letova
- Email Service: Modul koji šalje e-mail obavijesti kada se otkriju promjene statusa leta
- Konfiguracija: Sustav konfiguracije baziran na JSON-u za pohranu korisničkih postavki
- Python 3.8 or higher
- pip (Python package manager)
- Internet connection to access Zagreb Airport website
- Resend.com account for email notifications
-
Clone the repository:
git clone https://github.com/lemonmedia/zagreb-airport-flight-tracker.git cd zagreb-airport-flight-tracker -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate -
Install dependencies:
pip install -r requirements.txt -
Configure email settings:
- Open
config.json - Update the
email_settingssection with your email service details
- Open
-
Start the application:
cd app python app.py -
Access the web interface:
- Open your browser and navigate to
http://localhost:5000
- Open your browser and navigate to
This application is containerized and can be deployed using Docker.
-
Prerequisites
- Docker and Docker Compose installed
-
Local Docker Deployment
# Clone the repository git clone https://github.com/dafidkaa/flight-tracker.git cd flight-tracker # Create .env file cp .env.example .env # Edit .env file with your settings # Build and run with Docker Compose docker-compose up -d
-
Environment Variables Set the following environment variables in your
.envfile:PORT: Port to run the application on (default: 8080)ENVIRONMENT: Environment (development, production)LOG_TO_FILE: Whether to log to files (true, false)RESEND_API_KEY: Your Resend API key for sending emails
This application can be deployed to Digital Ocean using either App Platform or a Droplet.
-
Prerequisites
- A Digital Ocean account
- Git repository with your code
-
Deployment Options
-
Option 1: Digital Ocean App Platform (Recommended)
- Log in to your Digital Ocean dashboard
- Go to App Platform and create a new app
- Connect your Git repository
- Select Dockerfile as the deployment method
- Configure environment variables
- Deploy the application
-
Option 2: Digital Ocean Droplet
- Create a new Droplet
- SSH into your Droplet
- Install Docker and Docker Compose
- Clone your repository
- Configure environment variables
- Build and run with Docker Compose
-
-
Detailed Instructions For detailed deployment instructions, see the Digital Ocean Deployment Guide.
- Python 3.8 ili noviji
- pip (Python upravitelj paketa)
- Internet veza za pristup web stranici Zračne luke Zagreb
- Resend.com račun za e-mail obavijesti
-
Klonirajte repozitorij:
git clone https://github.com/lemonmedia/zagreb-airport-flight-tracker.git cd zagreb-airport-flight-tracker -
Stvorite virtualno okruženje:
python -m venv venv source venv/bin/activate # Na Windowsu: venv\Scripts\activate -
Instalirajte ovisnosti:
pip install -r requirements.txt -
Konfigurirajte postavke e-pošte:
- Otvorite
config.json - Ažurirajte odjeljak
email_settingss podacima vašeg servisa za e-poštu
- Otvorite
-
Pokrenite aplikaciju:
cd app python app.py -
Pristupite web sučelju:
- Otvorite preglednik i navigirajte do
http://localhost:5000
- Otvorite preglednik i navigirajte do
Ova aplikacija je kontejnerizirana i može se implementirati pomoću Dockera.
-
Preduvjeti
- Docker i Docker Compose instalirani
-
Lokalna Docker implementacija
# Klonirajte repozitorij git clone https://github.com/dafidkaa/flight-tracker.git cd flight-tracker # Stvorite .env datoteku cp .env.example .env # Uredite .env datoteku s vašim postavkama # Izgradite i pokrenite s Docker Compose docker-compose up -d
-
Varijable okruženja Postavite sljedeće varijable okruženja u vašoj
.envdatoteci:PORT: Port na kojem će aplikacija raditi (zadano: 8080)ENVIRONMENT: Okruženje (development, production)LOG_TO_FILE: Hoće li se zapisivati u datoteke (true, false)RESEND_API_KEY: Vaš Resend API ključ za slanje e-pošte
Ova aplikacija može se implementirati na Digital Ocean koristeći App Platform ili Droplet.
-
Preduvjeti
- Digital Ocean račun
- Git repozitorij s vašim kodom
-
Opcije implementacije
-
Opcija 1: Digital Ocean App Platform (Preporučeno)
- Prijavite se na Digital Ocean nadzornu ploču
- Idite na App Platform i stvorite novu aplikaciju
- Povežite svoj Git repozitorij
- Odaberite Dockerfile kao metodu implementacije
- Konfigurirajte varijable okruženja
- Implementirajte aplikaciju
-
Opcija 2: Digital Ocean Droplet
- Stvorite novi Droplet
- SSH-ajte se u svoj Droplet
- Instalirajte Docker i Docker Compose
- Klonirajte svoj repozitorij
- Konfigurirajte varijable okruženja
- Izgradite i pokrenite s Docker Compose
-
-
Detaljne upute Za detaljne upute za implementaciju, pogledajte Vodič za implementaciju na Digital Ocean.
- Navigate to the main page
- View current arrivals in the "Current Flights" table
- Click "Track" button next to a flight you want to monitor
- Alternatively, enter a flight number manually in the "Add new flight to track" form
- Go to the "Email Notifications" section
- View current recipients in the list
- Add new recipients using the form
- Remove recipients by clicking the "Remove" button next to their email
- Go to the "Notification Settings" section
- Check/uncheck the types of notifications you want to receive
- Click "Save Settings" to apply changes
- Navigirajte do glavne stranice
- Pregledajte trenutne dolaske u tablici "Trenutni letovi"
- Kliknite gumb "Prati" pored leta koji želite pratiti
- Alternativno, unesite broj leta ručno u obrazac "Dodaj novi let za praćenje"
- Idite na odjeljak "E-mail obavijesti"
- Pregledajte trenutne primatelje na popisu
- Dodajte nove primatelje pomoću obrasca
- Uklonite primatelje klikom na gumb "Ukloni" pored njihove e-mail adrese
- Idite na odjeljak "Postavke obavijesti"
- Označite/odznačite vrste obavijesti koje želite primati
- Kliknite "Spremi postavke" za primjenu promjena
The system provides the following API endpoints:
GET /api/flights- Get all flight dataGET /api/flights/tracked- Get data for tracked flights only
POST /api/flights/track- Track a new flight- Body:
{ "flight_number": "XX 123" }
- Body:
POST /api/flights/untrack- Stop tracking a flight- Body:
{ "flight_number": "XX 123" }
- Body:
POST /api/email/add- Add a new email recipient- Body:
{ "email": "example@example.com" }
- Body:
POST /api/email/remove- Remove an email recipient- Body:
{ "email": "example@example.com" }
- Body:
GET /api/config- Get current configurationPOST /api/settings/notifications- Update notification settings- Body:
{ "notification_events": { "status_change": true, "delay": true, "gate_change": true, "arrival": true } }
- Body:
POST /api/settings/email- Update email settingsPOST /api/settings/app- Update application settings
POST /api/refresh- Manually refresh flight data
Sustav pruža sljedeće API krajnje točke:
GET /api/flights- Dohvati sve podatke o letovimaGET /api/flights/tracked- Dohvati podatke samo za praćene letove
POST /api/flights/track- Prati novi let- Tijelo:
{ "flight_number": "XX 123" }
- Tijelo:
POST /api/flights/untrack- Prestani pratiti let- Tijelo:
{ "flight_number": "XX 123" }
- Tijelo:
POST /api/email/add- Dodaj novog primatelja e-pošte- Tijelo:
{ "email": "primjer@primjer.com" }
- Tijelo:
POST /api/email/remove- Ukloni primatelja e-pošte- Tijelo:
{ "email": "primjer@primjer.com" }
- Tijelo:
GET /api/config- Dohvati trenutnu konfiguracijuPOST /api/settings/notifications- Ažuriraj postavke obavijesti- Tijelo:
{ "notification_events": { "status_change": true, "delay": true, "gate_change": true, "arrival": true } }
- Tijelo:
POST /api/settings/email- Ažuriraj postavke e-poštePOST /api/settings/app- Ažuriraj postavke aplikacije
POST /api/refresh- Ručno osvježi podatke o letovima
flight_tracker/
├── app/ # Main application code
│ ├── static/ # Frontend assets
│ │ ├── css/ # CSS stylesheets
│ │ │ └── style.css # Main stylesheet
│ │ ├── js/ # JavaScript files
│ │ │ └── app.js # Main frontend logic
│ │ └── images/ # Image assets
│ ├── templates/ # HTML templates
│ │ ├── index.html # Main page template
│ │ └── email_notification.html # Email template
│ ├── data/ # Data storage
│ │ ├── current_data.json # Current flight data
│ │ └── previous_data.json # Previous flight data
│ ├── app.py # Flask application and API endpoints
│ ├── scraper.py # Zagreb Airport web scraper
│ ├── email_service.py # Email notification service
│ ├── scheduler.py # Background task scheduler
│ ├── main.py # Main entry point
│ └── logging_config.py # Logging configuration
├── config.json # Application configuration
└── logs/ # Application logs
├── main.log # Main application log
├── scraper.log # Scraper log
├── scheduler.log # Scheduler log
└── email.log # Email service log
-
No flight data appears
- Check your internet connection
- Verify that the Zagreb Airport website is accessible
- Check the scraper logs for errors
-
Email notifications not being sent
- Verify your SMTP server settings in
config.json - Check if your email provider allows sending through SMTP
- Review the email service logs for errors
- Verify your SMTP server settings in
-
Application crashes on startup
- Ensure all dependencies are installed
- Check if the required ports are available
- Review the main application log for errors
Log files are stored in the logs/ directory and can be used to diagnose issues:
main.log- General application logsscraper.log- Web scraping related logsscheduler.log- Scheduler related logsemail.log- Email service related logs
-
Ne pojavljuju se podaci o letovima
- Provjerite vašu internet vezu
- Provjerite je li web stranica Zračne luke Zagreb dostupna
- Provjerite log datoteke scraper-a za greške
-
E-mail obavijesti se ne šalju
- Provjerite postavke SMTP poslužitelja u
config.json - Provjerite dopušta li vaš pružatelj e-pošte slanje putem SMTP-a
- Pregledajte log datoteke email servisa za greške
- Provjerite postavke SMTP poslužitelja u
-
Aplikacija se ruši pri pokretanju
- Provjerite jesu li sve ovisnosti instalirane
- Provjerite jesu li potrebni portovi dostupni
- Pregledajte glavnu log datoteku aplikacije za greške
Log datoteke pohranjene su u direktoriju logs/ i mogu se koristiti za dijagnosticiranje problema:
main.log- Opći logovi aplikacijescraper.log- Logovi vezani uz web scrapingscheduler.log- Logovi vezani uz scheduleremail.log- Logovi vezani uz email servis
- Maximum of 20 tracked flights
- Only supports Zagreb Airport arrivals (not departures)
- Relies on the structure of the Zagreb Airport website (may break if they change their layout)
- Email is the only notification method
- Add support for departure flights
- Implement SMS notifications
- Create a mobile application
- Add multi-language support
- Implement user accounts for personalized tracking
- Add historical flight data analysis
- Maksimalno 20 praćenih letova
- Podržava samo dolaske na Zračnu luku Zagreb (ne odlaske)
- Oslanja se na strukturu web stranice Zračne luke Zagreb (može prestati raditi ako promijene izgled)
- E-mail je jedina metoda obavještavanja
- Dodavanje podrške za odlazne letove
- Implementacija SMS obavijesti
- Izrada mobilne aplikacije
- Dodavanje podrške za više jezika
- Implementacija korisničkih računa za personalizirano praćenje
- Dodavanje analize povijesnih podataka o letovima
This project is licensed under the MIT License - see the LICENSE file for details.
Ovaj projekt je licenciran pod MIT licencom - pogledajte datoteku LICENSE za detalje.