Inspiration
Aviation accounts for roughly 2–3 % of global CO₂ emissions, yet pilots and dispatchers rarely see fuel-burn or emissions data side-by-side when choosing between candidate routes. We asked: what if a single search could surface the greenest path between two airports — backed by real aviation data and explained in plain language by AI?
What it does
Enter an origin, destination, and aircraft type (with optional engine model). GreenFlight pulls live data from four aviation APIs — Aviationstack (route schedules), OpenSky Network (aircraft positions), Aviation Weather Center (METARs/TAFs), and Overpass/OpenStreetMap (aerodrome context) — enriches it with seeded airport reference data, then sends a compact facts bundle to Google Gemini. The result is a set of candidate routes ranked by estimated fuel burn and CO₂, a recommended route highlighted on an interactive map, and a natural-language explanation of why that route wins. An optional ElevenLabs voice copilot can read the briefing aloud.
How we built it
- Frontend: Next.js 16 (App Router) + React 19 + Tailwind CSS 4 + Leaflet for the interactive map, deployed on Vercel.
- Data layer: Supabase (Postgres) for reference catalogs (airports, aircraft, engines), Row-Level Security, and a server-side
api_cachetable with per-provider TTLs that keeps us within free-tier rate limits. - AI narrative: Google Gemini API generates fuel/economy explanations grounded in the structured facts returned by the four upstream providers.
- Voice: ElevenLabs conversational AI agent with client tools — users can speak a trip request and hear the optimization result read back.
- Caching & orchestration: A single
POST /api/flight-optimizeRoute Handler fetches all four providers in parallel, checks Supabase cache first, and falls back gracefully when a provider is unavailable. An optional Aviationstack drip scheduler pre-warms cache within the tiny free quota. - MongoDB Atlas: Stores optimization run history and lays the groundwork for vector-search RAG over aviation context documents.
- Infrastructure: Vercel for the UI; Vultr VPS available for Spring Boot + FastAPI when the full-stack path is promoted.
Challenges we faced
- Extreme rate limits: Aviationstack's free tier allows ~100 requests/month. We designed an aggressive Supabase caching layer with provider-specific TTLs and a drip-scheduler to pre-warm popular routes without blowing the quota.
- CORS and secret management: Four different upstream APIs each with different auth and CORS policies — all calls had to stay server-side in Next.js Route Handlers so keys never reach the browser.
- Coordinating AI + structured data: Gemini's narrative had to be grounded in real provider facts (not hallucinated numbers). We send a compact JSON facts summary so the model cites actual METAR conditions and route data.
- Multi-sponsor integration under time pressure: Weaving Gemini, Supabase, MongoDB Atlas, Vultr, Vercel, and ElevenLabs into a coherent architecture — each satisfying its prize track — required careful planning and a strict MVP-first approach.
What we learned
- Caching strategy is everything when your APIs have wildly different rate limits and data freshness requirements.
- Grounding LLM output in structured upstream data produces far more trustworthy explanations than open-ended prompting.
- A clear JSON contract between layers (providers → cache → Gemini → UI) lets a team of four parallelize effectively even under hackathon time pressure.
What's next for GreenFlight
- Integrate real wind/jet-stream data and EUROCONTROL-style route charges for more realistic fuel estimates.
- Expand RAG with MongoDB Atlas Vector Search over ICAO documents and airline operational manuals.
- Add user accounts (Supabase Auth) to save and compare trip histories over time.
Built With
- aviationstack
- elevenlabs
- fastapi
- google-gemini-api
- java
- leaflet.js
- mongodb-atlas
- next.js
- node.js
- opensky
- openstreetmap
- overpass-api
- python
- react
- spring-boot
- supabase
- tailwind-css
- typescript
- vercel
- vultr
Log in or sign up for Devpost to join the conversation.