SkyWings is a comprehensive flight booking system that allows users to search, book, and manage flights with ease. The system features a user-friendly interface, AI-powered chatbot assistance, secure payment processing, weather monitoring, and robust administrative controls.
- User Authentication: Secure login, registration, and profile management
- Flight Search & Booking: Intuitive flight search with dynamic pricing
- AI Chatbot: Intelligent flight search and booking assistance
- Seat Selection: Interactive seat map selection
- Payment Processing: Secure Stripe integration with discounts
- Booking Management: View, modify, and cancel bookings
- Weather Monitoring: Real-time weather tracking and flight status updates
- Flight Status Updates: Automatic status management for completed flights
- Admin Dashboard: Comprehensive management tools for flights, users, and bookings
- Email Notifications: Automated notifications for bookings, weather alerts, and flight updates
- Reporting: Detailed analytics and reporting
- Frequent Flyer Program: Earn and redeem miles, automatic status updates, and admin/manual correction tools
- Bulk Data Injection: Scripts for large-scale test data and frequent flyer status correction
- Backend: Python with Flask framework
- Database: SQLAlchemy with PostgreSQL/SQLite
- Frontend: HTML, CSS, JavaScript with Bootstrap
- AI Integration: OpenRouter API with DeepSeek model
- Payment Processing: Stripe API with secure checkout
- Weather Integration: OpenWeather API for real-time weather data
- Background Processing: Thread-based task processing for status updates
- Email: Flask-Mail with SMTP for automated notifications
- PDF Generation: pdfkit and xhtml2pdf for document generation
skywings/
├── app.py # Main application configuration and entry point
├── routes.py # Application routes and logic (user, admin, booking, payment, etc.)
├── models.py # Database models
├── chatbot.py # AI chatbot implementation and logic
├── chatbot_routes.py # Chatbot Flask blueprint
├── extensions.py # Flask extensions (db, mail, etc.)
├── utils.py # Utility functions (pricing, seat map, etc.)
├── requirements.txt # Python dependencies
├── large_injection.py # Script for large-scale data injection
├── fix_frequent_flyer_status.py # Script to fix frequent flyer status for all users
├── static/ # Static files (CSS, JS, images)
│ ├── css/
│ ├── js/
│ └── images/
├── templates/ # HTML templates
│ ├── base.html
│ ├── index.html
│ ├── confirmation.html
│ ├── manage_bookings.html
│ ├── admin/
│ │ ├── users.html
│ │ ├── user_bookings.html
│ │ ├── bookings.html
│ │ ├── flights.html
│ │ ├── airports.html
│ │ ├── aircraft.html
│ │ └── ... (other admin templates)
│ └── ... (other templates)
├── README.md # This file
└── ... (other scripts and files)
- Refer the skywings_whitesheet for detailed analyse and work flow
- Python 3.8+
- PostgreSQL (or SQLite for development)
- Node.js (for pdfkit)
- wkhtmltopdf (for PDF generation)
-
Clone the repository:
git clone https://github.com/yourusername/skywings.git cd skywings -
Create and activate a virtual environment:
python -m venv venv # On Windows: venv\Scripts\activate # On macOS/Linux: source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables: Create a
.envfile in the root directory with the following variables:DATABASE_URL=sqlite:///flight_booking.db SESSION_SECRET=your-secret-key-here MAIL_USERNAME=your-email@gmail.com MAIL_PASSWORD=your-email-password STRIPE_SECRET_KEY=your-stripe-secret-key STRIPE_PUBLISHABLE_KEY=your-stripe-publishable-key OPENROUTER_API_KEY=your-openrouter-api-key OPENWEATHER_API_KEY=your-openweather-api-key UNSPLASH_ACCESS_KEY=your-unsplash-access-key -
Initialize the database:
flask shell >>> from app import db >>> db.create_all() >>> exit()
-
Run the application:
python app.py
Access the application at http://localhost:5500
To populate the database with sample data, visit:
http://localhost:5500/init-db
Or run:
python large_injection.pyTo fix frequent flyer status for all users:
python fix_frequent_flyer_status.pyGET /search- Flight search interfaceGET /api/airports- Airport autocomplete APIGET /api/flight/<flight_id>/available-seats/<travel_class>- Available seats API
POST /store-selected-seats/<flight_id>- Store selected seatsGET /passenger-details- Passenger information formPOST /process-passengers- Process passenger detailsPOST /process-payment- Process payment via Stripe
POST /login- User loginPOST /register- User registrationPOST /change_password- Password changePOST /save_preferences- Save user preferences
GET /admin- Admin dashboardGET /admin/users- Manage users (search, filter, sort, edit, delete, update frequent flyer status)GET /admin/flights- Manage flightsGET /admin/bookings- Manage bookingsGET /admin/airports- Manage airportsGET /admin/aircraft- Manage aircraftGET /admin/reports- System reports and analytics
POST /chatbot- Process chatbot messagesPOST /clear_chat- Clear chat historyGET /get_chat_history- Retrieve chat history
- Automatic Status Update: User status (Standard, Silver, Gold, Platinum) is updated automatically based on miles after each booking.
- Admin Correction: Admins can manually update user status and miles from the admin panel.
- Batch Fix: Use
fix_frequent_flyer_status.pyto correct all user statuses in bulk.
Key configuration options in app.py:
# Database configuration
app.config["SQLALCHEMY_DATABASE_URI"] = os.getenv("DATABASE_URL", "sqlite:///flight_booking.db")
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
# Session configuration
app.config['SESSION_TYPE'] = 'filesystem'
app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(days=7)
# Email configuration
app.config.update(
MAIL_SERVER="smtp.gmail.com",
MAIL_PORT=587,
MAIL_USE_TLS=True,
MAIL_USERNAME=os.getenv("MAIL_USERNAME"),
MAIL_PASSWORD=os.getenv("MAIL_PASSWORD"),
)
# Payment configuration
app.config['STRIPE_SECRET_KEY'] = os.getenv('STRIPE_SECRET_KEY')
app.config['STRIPE_PUBLISHABLE_KEY'] = os.getenv('STRIPE_PUBLISHABLE_KEY')
# Weather monitoring configuration
app.config['OPENWEATHER_API_KEY'] = os.getenv('OPENWEATHER_API_KEY')
app.config['WEATHER_CHECK_INTERVAL'] = 300 # 5 minutes- Real-time weather tracking for all flight routes
- Automatic alerts for severe weather conditions
- Integration with OpenWeather API
- Proactive flight status updates based on weather
- Automatic status updates for completed flights
- Background thread processing
- Database consistency maintenance
- Logging and error handling
- Natural language processing for flight searches
- Context-aware conversations
- Database integration for real-time flight information
- Booking confirmation handling
- Chatbot logic in
chatbot.pyandchatbot_routes.py
- Stripe for secure payment processing
- Credit card payments through Stripe Checkout
- Frequent flyer discounts
- Payment verification and error handling
- Automatic receipt generation
- Booking confirmations and e-tickets
- Weather alerts and flight status updates
- Login/logout security notifications
- System alerts and reports
- Booking trends and analytics
- Revenue reports and forecasts
- Weather impact analysis
- Flight status statistics
- Flight utilization
- User growth metrics
- Use feature branches for new features or bug fixes.
- Run
python large_injection.pyfor large-scale test data. - Use
python fix_frequent_flyer_status.pyto batch-correct frequent flyer statuses. - Use
git statusandgit addto stage only the files you want to commit.
For production deployment:
- Set up a PostgreSQL database
- Configure a production-ready WSGI server (Gunicorn, uWSGI)
- Set up a reverse proxy (Nginx, Apache)
- Configure production email settings
- Set
DEBUG=Falsein production
For any questions or support, please contact the development team at skywings102914@gmail.com