FlyFair is a modern flight price tracking application that helps users find the best flight deals and get notified when prices drop below their target. Built with Flask (Python) backend and a beautiful responsive frontend, it integrates with the Amadeus API for real-time flight data.
- Search Flights: Search for flights by origin, destination, and date
- Price Tracking: Set target prices and get notified when flights drop
- Email Alerts: Receive email notifications when prices meet your target
- Modern UI: Beautiful, responsive design that works on all devices
- Real-time Data: Live flight information from Amadeus API
- Input Validation: Comprehensive form validation and error handling
- Mobile Friendly: Fully responsive design for mobile and desktop
FlyFair/
├── backend/ # Python Flask backend
│ └── app.py # Main Flask application
├── frontend/ # Frontend interface
│ └── index.html # Single-page application
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
└── README.md # Project documentation
- Backend: Python, Flask, Flask-CORS
- Frontend: HTML5, CSS3, JavaScript (Vanilla)
- API: Amadeus Flight Offers API
- Email: SMTP (Gmail)
- Environment: python-dotenv
- Python 3.7 or higher
- Amadeus API credentials (free account available at Amadeus for Developers)
- Gmail account (optional, for email alerts)
- Clone the Repository
git clone https://github.com/maansi33/FlyFair.git
cd FlyFair- Create Virtual Environment (Recommended)
python -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate- Install Dependencies
pip install -r requirements.txt-
Configure Environment Variables
- Copy
.env.exampleto.env:
cp .env.example .env
- Edit
.envand add your credentials:
AMADEUS_API_KEY=your_key_here AMADEUS_API_SECRET=your_secret_here GMAIL_EMAIL=your_email@gmail.com GMAIL_APP_PASSWORD=your_app_passwordGetting Amadeus API Credentials:
- Visit Amadeus for Developers
- Sign up for a free account
- Create a new app in the developer dashboard
- Copy your API Key and API Secret
Setting up Gmail App Password (for email alerts):
- Enable 2-Step Verification on your Google Account
- Go to App Passwords
- Generate a new app password for "Mail"
- Use this password in
.envfile
- Copy
-
Run the Application
# From the project root directory
python backend/app.py
# Or from the backend directory
cd backend
python app.pyThe application will start on http://localhost:5000 by default.
- Access the Application
- Open your browser and navigate to:
http://localhost:5000 - The frontend will be automatically served by Flask
- The app can be run from any directory - paths are configured automatically
- Open your browser and navigate to:
-
Search for Flights:
- Enter origin airport code (3-letter IATA code, e.g., DEL, JFK)
- Enter destination airport code (e.g., KTM, LAX)
- Select departure date
- Click "Search Flights"
-
Set Price Alerts (Optional):
- Enter your target price in USD
- Provide your email address
- If any flight matches or falls below your target price, you'll receive an email notification
-
View Results:
- Results are sorted by price (lowest first)
- Each result shows airline, flight number, departure/arrival times, duration, stops, and price
- Flights that meet your target price are highlighted
- Serves the main frontend interface
-
Searches for flight offers
-
Query Parameters:
origin(required): 3-letter IATA airport codedestination(required): 3-letter IATA airport codedate(required): Departure date (YYYY-MM-DD)targetPrice(optional): Target price in USDemail(optional): Email address for alerts
-
Response:
{ "flights": [...], "count": 10, "emails_sent": 2 }
The application includes comprehensive error handling:
- Input validation for all form fields
- API error handling with user-friendly messages
- Email delivery status logging
- Graceful fallbacks for missing optional features
Backend Enhancements:
- Added comprehensive error handling and validation
- Implemented token caching for Amadeus API (reduces API calls)
- Fixed template path issue (uses static file serving)
- Improved email sending logic (prevents duplicate emails)
- Added proper logging
- Better input validation and sanitization
Frontend Enhancements:
- Modern, responsive UI with gradient design
- Loading states and spinners
- Real-time form validation
- Better error messages and user feedback
- Mobile-friendly responsive layout
- Auto-uppercase for airport codes
- Price alerts highlighted in results
- Improved accessibility
Code Quality:
- Updated requirements.txt with version pins
- Added .env.example for easy setup
- Comprehensive README documentation
- Better code organization and structure
- Fixed path handling - app can be run from any directory
- Cross-platform compatibility improvements
"Failed to authenticate with Amadeus API"
- Check that your
AMADEUS_API_KEYandAMADEUS_API_SECRETare correct in.env - Ensure you're using test API credentials (production requires additional setup)
"Unable to connect to server"
- Make sure the Flask backend is running
- Check that port 5000 is not in use by another application
Email alerts not working
- Verify Gmail credentials in
.env - Ensure 2-Step Verification is enabled and you're using an App Password
- Check server logs for email delivery errors
- User authentication and profiles
- Save favorite flight searches
- Price history tracking
- Multiple date range searches
- Integration with booking platforms
- Push notifications (browser/phone)
- Advanced filtering (airlines, stops, times)
- Price prediction using historical data
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
Maansi Sharma
GitHub: maansi33
- Amadeus for Developers for the flight data API
- Flask community for excellent documentation
Note: This application uses the Amadeus Test API. For production use, additional API configuration and authentication may be required.