INITIALIZING...
tushar jain.
Back to Archives
Flagship Web Application

FlightDeck

Real-Time Flight Tracking Platform. Synchronizing live arrivals, delay matrices, terminal gates, baggage carousel routing, and destination weather feeds.

Simulation Sandbox

Interactive Flight Tracker

Flight Status Monitor (Active AirLabs API)
Lufthansa German Airlines

LH430

FRA âž” ORD (Frankfurt to Chicago)

STATUSEn Route
DESTINATION WEATHEROvercast, 14°C
Route Progression
DEPARTURE
Frankfurt Am Main (FRA)
Scheduled: 10:45 AM CEST
ARRIVAL INFO
Chicago O'Hare Intl (ORD)
ETA: 01:15 PM CDT
TERMINALTerminal 1
GATEB18
BAGGAGE CLAIMCarousel 5

Key Highlights

Engineered for Latency

Global Coverage10,000+ Flights
Data Refresh Rate15 Seconds
API ProviderAirLabs Engine
Cache Policy60s Server Edge
Response Latency< 120ms
Uptime SLA99.9%

System Design

REST API Integration Topology

Clean pipeline caching live global aviation feeds at Next.js server borders, minimizing client loading penalties.

Next.js ClientInteractive GridFramer Motion HUDREST API RouterNext.js Server borderResponse Cache (60s)AirLabs API NodeGlobal Flight EnginePayload FilteringLive Flight FeedFAA / ADSB radarsReal-time coordinates

Software Quality

Engineering & Implementation Highlights

src/app/api/flights/route.tsNext.js API Handler
import { NextResponse } from 'next/server';

let cachedData: any = null;
let lastFetchTime = 0;
const CACHE_TTL = 60 * 1000; 

export async function GET(request: Request) {
  const { searchParams } = new URL(request.url);
  const flightNo = searchParams.get('flightNo')?.toUpperCase();
  
  if (!flightNo) {
    return NextResponse.json({ error: 'Flight number required' }, { status: 400 });
  }

  try {
    const now = Date.now();
    
    if (cachedData && (now - lastFetchTime < CACHE_TTL)) {
      const flight = cachedData.find((f: any) => f.flight_iata === flightNo);
      if (flight) return NextResponse.json({ data: flight, source: 'cache' });
    }

    const response = await fetch(
      `https://airlabs.co/api/v9/flights?api_key=${process.env.AIRLABS_API_KEY}`
    );
    
    const json = await response.json();
    cachedData = json.response || [];
    lastFetchTime = now;

    const flight = cachedData.find((f: any) => f.flight_iata === flightNo);
    if (!flight) {
      return NextResponse.json({ error: 'Flight details not found' }, { status: 404 });
    }

    return NextResponse.json({ data: flight, source: 'live' });
  } catch (error) {
    return NextResponse.json({ error: 'Failed to retrieve flight data' }, { status: 500 });
  }
}