Skip to content

SteveTM-git/ecoflight-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

✈️ EcoFlight AI - Carbon-Aware Flight Optimization System

EcoFlight AI React FastAPI Python

An intelligent flight route optimization system that uses AI algorithms to minimize carbon emissions and fuel consumption while maintaining efficient flight times.


πŸ“Έ Screenshots

image image image image

🌟 Features

  • πŸ€– AI-Powered Optimization - A* pathfinding algorithm for optimal routes
  • 🌍 Real-World Data - 7,000+ airports and 60,000+ flight routes
  • πŸ“Š Emission Tracking - Real-time COβ‚‚ and fuel consumption calculations
  • 🎯 Multi-Objective - Balance between eco-friendliness, time, and efficiency
  • πŸ“ˆ Visual Analytics - Interactive charts and route visualizations
  • ⚑ Fast API - RESTful backend with comprehensive documentation

πŸ—οΈ Architecture

ecoflight-ai/
β”œβ”€β”€ backend/                 # FastAPI Backend
β”‚   β”œβ”€β”€ api/                # API endpoints
β”‚   β”‚   β”œβ”€β”€ routes/         # Route handlers
β”‚   β”‚   └── services/       # Business logic
β”‚   β”œβ”€β”€ models/             # Database models
β”‚   β”‚   β”œβ”€β”€ database/       # SQLAlchemy schemas
β”‚   β”‚   └── ml/             # ML models
β”‚   └── utils/              # Utilities
β”‚
└── frontend/               # React Frontend
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ components/     # React components
    β”‚   β”œβ”€β”€ services/       # API integration
    β”‚   └── App.jsx         # Main application
    └── public/

πŸš€ Tech Stack

Backend

  • FastAPI - Modern Python web framework
  • SQLAlchemy - Database ORM
  • SQLite - Embedded database
  • NetworkX - Graph algorithms for route optimization
  • Scikit-learn - Machine learning utilities
  • Geopy - Geographic calculations

Frontend

  • React 18 - UI framework
  • Vite - Build tool
  • Tailwind CSS - Styling
  • Recharts - Data visualization
  • Lucide React - Icons
  • Axios - HTTP client

πŸ“¦ Installation

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • npm or yarn

Backend Setup

# Clone the repository
git clone <your-repo-url>
cd ecoflight-ai

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
cd backend
pip install -r requirements.txt

# Initialize database
python init_database.py

# Load airport and route data
python load_data.py

# Start the API server
uvicorn main:app --reload

The API will be available at http://localhost:8000

Frontend Setup

# Navigate to frontend
cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

The frontend will be available at http://localhost:5173


🎯 Usage

1. Select Airports

  • Enter departure and arrival airports
  • Autocomplete suggestions appear as you type

2. Choose Aircraft

  • Select from 4 real aircraft models
  • Each with different fuel efficiency ratings

3. Set Optimization Mode

  • ECO: Minimize COβ‚‚ emissions (70% weight on fuel)
  • BALANCED: Balance time and emissions (50/50)
  • FAST: Prioritize speed (70% weight on time)

4. View Results

  • Total distance and flight time
  • Fuel consumption and COβ‚‚ emissions
  • COβ‚‚ savings vs. direct route
  • Optimized waypoint path
  • Visual route map and comparison charts

🧠 AI Optimization Algorithm

The system uses A pathfinding* with custom heuristics:

# Cost function
cost = w_fuel Γ— fuel_consumption + w_time Γ— flight_time

# Heuristic (great circle distance)
h(n) = geodesic_distance(current_node, goal_node)

# Total score
f(n) = g(n) + h(n)

Optimization Modes

Mode Fuel Weight Time Weight
ECO 0.7 0.3
BALANCED 0.5 0.5
FAST 0.3 0.7

πŸ“‘ API Endpoints

Airports

  • GET /api/v1/airports - List airports
  • GET /api/v1/airports/{iata} - Get specific airport
  • GET /api/v1/airports/search/autocomplete - Search airports

Flights

  • POST /api/v1/flights/calculate-emissions - Calculate COβ‚‚
  • GET /api/v1/flights/aircraft - List aircraft

Optimization

  • POST /api/v1/optimize/route - Optimize single route
  • POST /api/v1/optimize/alternatives - Find alternatives
  • GET /api/v1/optimize/history - View history

Interactive Documentation

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

πŸ“Š Database Schema

  • airports - 7,000+ airports worldwide
  • flight_routes - 60,000+ real routes
  • aircraft - Aircraft specifications
  • emission_data - Calculated emissions
  • optimized_paths - AI-optimized routes

🌱 Environmental Impact

COβ‚‚ Emission Factors

  • Jet fuel: 3.16 kg COβ‚‚ per kg fuel (ICAO standard)
  • Based on real aircraft fuel efficiency data
  • Considers takeoff/landing overhead (15%)

Sample Savings

  • JFK β†’ LAX (Eco Mode): ~8-12% COβ‚‚ reduction
  • Longer Routes: Up to 15-20% savings possible

🎨 UI Features

  • Modern gradient design
  • Smooth animations
  • Responsive layout
  • Real-time search
  • Interactive visualizations
  • Professional data presentation

πŸ”œ Future Enhancements

  • 3D Globe visualization with leaflet
  • Weather data integration
  • Historical flight data analysis
  • User accounts and saved routes
  • Carbon offset calculator
  • Mobile app
  • Real-time flight tracking
  • Multi-leg journey optimization

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


πŸ‘¨β€πŸ’» Author

Steve Thomas Mulamoottil

Built with ❀️ for a sustainable future in aviation


πŸ™ Acknowledgments

  • OpenFlights.org for airport and route data
  • ICAO for COβ‚‚ emission standards
  • Aircraft manufacturers for fuel efficiency data
  • Open-Meteo for weather API
  • Esri for satellite imagery

πŸ“ž Support

For issues or questions, please open an issue on GitHub.

Let's make aviation more sustainable, one optimized route at a time! 🌍✈️