A multi-language, AI-powered flight price monitoring dashboard with real-time data, TimesFM forecasting, and global airport coverage.
- Overview
- Features
- Live Demo
- Tech Stack
- Quick Start
- Project Structure
- Architecture
- Multi-Language Support
- TimesFM Integration
- Real-Time Data
- API Reference
- Testing
- Deployment
- Contributing
- License
Flight Monitor Agent is a production-ready web application that monitors flight prices across 432 airports in 182 countries worldwide. It combines real-time web search for live pricing with Google Research's TimesFM 2.5 foundation model for 14-day price forecasting, all wrapped in a 6-language RTL/LTR-aware interface.
The app stores all data in the browser's localStorage β zero database setup required. Track any airport pair, get alerts when prices drop, view AI-powered buy/wait/monitor recommendations, and click through to booking sites.
- No mock data β every price is fetched live via web search or estimated using real airline pricing models
- No database setup β localStorage persists everything (trackers, price history, alerts, logs)
- TimesFM 2.5 β Google Research's 200M-parameter time-series foundation model for forecasting
- 6 languages β English, Russian, Georgian, Hebrew, Arabic, Spanish with automatic RTL switching
- 432 airports β every country with commercial aviation is represented
- Click-to-buy β every deal links directly to Skyscanner/Google Flights/airline websites
- Track any airport pair worldwide (432 airports, 182 countries)
- Round-trip and one-way support
- Cabin classes: Economy, Premium, Business, First
- 1β9 passengers
- Target price alerts (get notified when price hits your threshold)
- Pause/resume individual trackers
- Persistent storage via localStorage
- Live web search (sandbox/self-hosted): Fetches actual current prices from Skyscanner, Expedia, Google Flights, airline websites via z-ai SDK
- DuckDuckGo scraping (Vercel): Searches DuckDuckGo Lite for flight prices and parses real prices from search result snippets β no API key needed
- AI estimator (fallback): Deterministic pricing based on real airline models (distance Γ seasonal Γ advance-booking Γ cabin Γ airline factor)
- Price validation layer: Every scraped price is validated against route-specific bounds, statistical outliers (IQR), and cross-source consistency before display
- 50+ real airlines with hub airports and pricing factors
- Deep links to booking sites for every quote
- 30-minute auto-refresh + manual refresh button
- 14-day price forecast using TimesFM 2.5 (200M parameters) from Google Research
- Quantile forecast bands (80% confidence interval)
- Buy now / Wait / Keep monitoring recommendations
- Multilingual reasoning (6 languages)
- Falls back to statistical STL-decomposition if TimesFM unavailable
| Language | Code | Direction | Native Name |
|---|---|---|---|
| English | en |
LTR | English |
| Russian | ru |
LTR | Π ΡΡΡΠΊΠΈΠΉ |
| Georgian | ka |
LTR | α₯αα αα£αα |
| Hebrew | he |
RTL | Χ’ΧΧ¨ΧΧͺ |
| Arabic | ar |
RTL | Ψ§ΩΨΉΨ±Ψ¨ΩΨ© |
| Spanish | es |
LTR | EspaΓ±ol |
- All UI strings translated
- Automatic RTL/LTR layout switching
- Locale-aware date formatting
- Multilingual cabin class labels and region names
- AI forecast reasoning in user's selected language
- Language preference persisted in localStorage
- Price drop alerts (>5% decrease from previous scan)
- Target price alerts (price hits your threshold)
- New historical low alerts (lowest price ever recorded)
- Acknowledge/dismiss alerts
- All alerts stored with full context (previous price, drop %, airline, source)
- Trackers tab: Grid of tracker cards with sparklines, price stats, deal badges
- Overview tab: KPIs, live scanner status, recent alerts, hot routes, system health
- AI Forecast tab: TimesFM 14-day forecast with confidence bands and recommendations
- System tab: Health metrics, resource usage, daily summaries, filterable activity logs
- All touch targets β₯44px (Apple HIG / Material Design compliance)
- Responsive layouts (mobile stacked β desktop side-by-side)
- Touch-friendly dialogs with full-height scroll
- Adaptive charts (shorter on mobile)
- Active-state animations for tactile feedback
Vercel Deployment: https://my-project-three-zeta-61.vercel.app/
Note: The Vercel demo shows a "Demo Mode" banner when prices are AI-estimated, and switches to a green "Live Prices Active" banner when DuckDuckGo scraping succeeds. For the full live experience (z-ai web search + TimesFM forecasting), self-host using the GitHub repo.
The app runs in two modes depending on where it's deployed. Here's a clear comparison:
| Feature | Vercel (Demo) | Self-Hosted VPS (Full) |
|---|---|---|
| Price source | DuckDuckGo Lite scraping + AI estimator fallback | z-ai SDK live web search (Skyscanner, Expedia, airline sites) |
| Price accuracy | Real prices from search snippets (when scraping succeeds) + estimated prices (fallback) | Real prices directly from travel sites |
| Price validation | β Full validation (bounds + IQR + consistency) | β Full validation (bounds + IQR + consistency) |
| TimesFM forecast | β Statistical fallback (STL decomposition) | β TimesFM 2.5 (200M params, JAX/Flax) |
| Forecast accuracy | Good (trend + seasonality) | Excellent (deep learning foundation model) |
| Banner | Amber "Demo Mode" or Green "Live Prices Active" | No banner (full mode) |
| Setup | Zero config (just deploy) | Install Python + TimesFM + z-ai SDK |
| Cost | Free (Vercel hobby tier) | VPS cost (~$5/mo) |
| Latency | ~2-5s per price fetch | ~1-3s per price fetch |
| Rate limits | DuckDuckGo may rate-limit | z-ai SDK (no public rate limit) |
- Vercel: Quick demo, testing, sharing with friends. Works without any setup.
- Self-Hosted VPS: Production use, real price monitoring, accurate AI forecasts. This is how the original flight agent was designed to run.
| File | Purpose |
|---|---|
src/app/page.tsx |
Main dashboard (4 tabs, all UI) |
src/app/layout.tsx |
Root layout with RTL/LTR sync |
src/lib/airports.ts |
432 airports across 182 countries |
src/lib/localDb.ts |
localStorage database (zero-setup) |
src/lib/priceRefresh.ts |
Background price refresh service |
src/lib/priceEngine.ts |
Deterministic price engine + utilities |
src/lib/trackerStore.ts |
Zustand tracker store |
src/lib/i18n/translations.ts |
6-language dictionaries |
src/lib/i18n/index.ts |
i18n store + hooks |
src/lib/priceValidator.ts |
Price validation (bounds + IQR + consistency) |
src/components/dashboard/*.tsx |
All UI components |
src/app/api/real-prices/route.ts |
Multi-layer price fetch (z-ai β scrape β AI) |
src/app/api/client-scrape/route.ts |
DuckDuckGo scraping endpoint |
src/app/api/forecast/route.ts |
Forecast endpoint (TimesFM or TS fallback) |
| File | Purpose |
|---|---|
src/lib/priceScraper.ts |
DuckDuckGo Lite/HTML/Brave search scraper with CORS proxy fallback. This is the creative workaround that gets real prices on Vercel without API keys. |
| File | Purpose |
|---|---|
src/lib/realFlights.ts |
z-ai SDK integration (web_search + LLM extraction). Only works where the z-ai internal API is reachable (sandbox or VPS with z-ai access). Also contains the AI estimator fallback used by Vercel. |
mini-services/forecast-service/index.py |
TimesFM 2.5 Python service (port 3030). Requires Python + JAX + Flax. Only runs on a VPS or local machine β cannot run on Vercel serverless. |
| File | Purpose |
|---|---|
vercel.json (if present) |
Vercel-specific config |
| Environment variables | ZAI_BASE_URL, ZAI_API_KEY, ZAI_CHAT_ID, ZAI_TOKEN, ZAI_USER_ID β set in Vercel dashboard. Used by ensureZaiConfig() in realFlights.ts to write a temp config file. |
Price fetch request
β
ββ Layer 1: z-ai SDK (self-hosted only) βββββββββββββββββββ
β src/lib/realFlights.ts β ZAI.create() β
β β web_search for live prices β
β β LLM extracts structured quotes β
β β If success: return real prices β
β
β β If fail (Vercel IP blocked): fall through β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββ Layer 2: DuckDuckGo scraping (Vercel + self-hosted) βββ
β src/lib/priceScraper.ts β scrapeRealPrices() β
β β Search DuckDuckGo Lite for "flight TLV to JFK price" β
β β Parse prices from search result snippets β
β β Validate prices (src/lib/priceValidator.ts) β
β β If success: return real prices β
β
β β If fail (rate limited): fall through β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββ Layer 3: AI estimator (always works) ββββββββββββββββββ
β src/lib/realFlights.ts β fallbackEstimate() β
β β Deterministic pricing based on real airline models β
β β 50+ airlines with hub airports and pricing factors β
β β Generates Skyscanner deep links β
β β Always returns prices β
β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Forecast request
β
ββ Layer 1: TimesFM (self-hosted only) βββββββββββββββββββ
β src/app/api/forecast/route.ts β fetch(localhost:3030) β
β β Python service runs TimesFM 2.5 (200M params) β
β β Returns 14-day forecast with quantile bands β
β β If success: return TimesFM forecast β
β
β β If fail (service not running): fall through β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββ Layer 2: Statistical fallback (Vercel + self-hosted) ββ
β src/app/api/forecast/route.ts β forecastStatistical() β
β β STL decomposition (log-transform + trend + weekly) β
β β 80% confidence band (z=1.28) β
β β Always returns forecast β
β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Category | Technology |
|---|---|
| Framework | Next.js 16 (App Router, Turbopack) |
| Language | TypeScript 5 |
| Styling | Tailwind CSS 4 + shadcn/ui (New York) |
| Charts | Recharts |
| Animations | Framer Motion |
| State | Zustand (with persist middleware) |
| Icons | Lucide React |
| AI Forecasting | TimesFM 2.5 (200M, JAX/Flax backend) |
| Real Prices | z-ai-web-dev-sdk (web_search + LLM) |
| Database | localStorage (zero-setup) |
| Deployment | Vercel |
| Python Service | Python 3.12 + stdlib HTTP server |
- Node.js 18+ / Bun
- Python 3.10+ (optional, for TimesFM forecasting service)
# Clone the repository
git clone https://github.com/your-username/flight-monitor-agent.git
cd flight-monitor-agent
# Install dependencies
bun install
# (Optional) Install TimesFM for local forecasting
pip install timesfm jax jaxlib einshape flax jaxtyping# Start the Next.js dev server
bun run dev
# (Optional) Start the TimesFM forecast service in another terminal
cd mini-services/forecast-service
python index.pyThe app will be available at http://localhost:3000.
bun run build
bun run startflight-monitor-agent/
βββ src/
β βββ app/
β β βββ api/
β β β βββ forecast/route.ts # TimesFM forecast endpoint
β β β βββ real-prices/route.ts # Live price search endpoint
β β βββ globals.css
β β βββ layout.tsx # Root layout with RTL/LTR sync
β β βββ page.tsx # Main dashboard (4 tabs)
β βββ components/
β β βββ dashboard/
β β β βββ AirportCombobox.tsx # Searchable airport picker (432 airports)
β β β βββ FlightDealsGrid.tsx # Vendor deals grid with click-to-buy
β β β βββ ForecastPanel.tsx # TimesFM forecast display
β β β βββ LanguageSwitcher.tsx # 6-language dropdown
β β β βββ LanguageDirSync.tsx # RTL/LTR attribute sync
β β β βββ NewTrackerDialog.tsx # Create tracker modal
β β β βββ PriceHistoryChart.tsx # Recharts area chart
β β β βββ TrackerCard.tsx # Tracker card with sparkline
β β β βββ LogsViewer.tsx # Filterable activity logs
β β β βββ ScannerPanel.tsx # Live scanner status
β β β βββ StatCard.tsx # KPI card
β β β βββ Sparkline.tsx # Mini SVG sparkline
β β β βββ ...
β β βββ ui/ # shadcn/ui components
β βββ lib/
β βββ airports.ts # 432 airports, 182 countries
β βββ realFlights.ts # Live price fetcher + AI estimator
β βββ localDb.ts # localStorage database layer
β βββ priceRefresh.ts # Background price refresh service
β βββ priceEngine.ts # Deterministic price engine
β βββ trackerStore.ts # Zustand tracker store
β βββ i18n/
β βββ translations.ts # 6-language dictionaries
β βββ index.ts # i18n store + hooks
βββ mini-services/
β βββ forecast-service/
β βββ index.py # TimesFM Python service (port 3030)
βββ tests/
β βββ README.md # Test documentation
β βββ airport-search.test.ts # Airport search tests
β βββ price-engine.test.ts # Price engine tests
β βββ i18n.test.ts # Translation tests
β βββ mobile-ui.test.ts # Mobile UI tests
βββ docs/
β βββ ARCHITECTURE.md # System architecture
β βββ TIMESFM.md # TimesFM integration guide
β βββ I18N.md # Internationalization guide
β βββ DEPLOYMENT.md # Deployment guide
βββ .gitignore
βββ CHANGELOG.md
βββ CONTRIBUTING.md
βββ LICENSE
βββ README.md
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Browser (Client) β
β βββββββββββββββ ββββββββββββββββ ββββββββββββββββββββββ β
β β React UI β β Zustand β β localStorage DB β β
β β (6 langs) β β Stores β β (snapshots, β β
β β (RTL/LTR) β β (trackers, β β alerts, logs) β β
β β β β i18n) β β β β
β ββββββββ¬βββββββ ββββββββββββββββ ββββββββββββββββββββββ β
β β β
β β fetch() β
βββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Next.js API Routes β
β ββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββ
β β /api/real-prices β β /api/forecast ββ
β β (live web search)β β (TimesFM or statistical fallback) ββ
β ββββββββββ¬ββββββββββ ββββββββββββββ¬βββββββββββββββββββββββ
β β β β
β βΌ βΌ β
β ββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββ
β β z-ai-web-dev-sdk β β Python Forecast Service ββ
β β (web_search + β β (TimesFM 2.5, port 3030) ββ
β β LLM extraction) β β JAX/Flax backend ββ
β ββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- User creates a tracker β stored in Zustand + localStorage
- Background refresh (every 30 min) β calls
/api/real-prices - API route β uses z-ai SDK to web-search live prices β LLM extracts structured quotes
- Price snapshot stored in localStorage with all vendor quotes
- Alerts generated if price dropped >5%, hit target, or new historical low
- Forecast panel β calls
/api/forecastβ proxies to Python TimesFM service - TimesFM analyzes price history β 14-day forecast + recommendation
The app supports 6 languages with full RTL/LTR switching. See docs/I18N.md for details.
- Add the language code to
Languagetype insrc/lib/i18n/translations.ts - Add a new dictionary with all translation keys
- Add the language metadata to the
languagesarray - Add region label translations in
src/lib/airports.ts - Add cabin label translations in
src/lib/priceEngine.ts
The app uses TimesFM 2.5 (200M parameters) from Google Research for price forecasting. See docs/TIMESFM.md for setup details.
- The Next.js
/api/forecastroute receives price history + user's language - It proxies to the Python service at
localhost:3030 - The Python service loads TimesFM 2.5 (flax backend) via JAX
- TimesFM produces a 14-day forecast with quantile bands
- A recommendation engine combines forecast + historical stats + days-to-departure
- Reasoning text is generated in the user's selected language
- If Python is unavailable, a TS statistical fallback (STL decomposition) is used
- Uses
z-ai-web-dev-sdkto search the web for current flight prices - LLM extracts structured prices from search results
- Fetches from Skyscanner, Expedia, Google Flights, airline websites
- The z-ai internal API is IP-restricted to the sandbox
- Falls back to a deterministic price estimator based on real airline models
- Uses 50+ real airlines with hub airports and pricing factors
- Generates Skyscanner deep links for all quotes
Fetch real flight prices for a route.
Request:
{
"originIata": "TLV",
"destIata": "JFK",
"departDate": "2026-08-15",
"returnDate": "2026-08-25",
"cabin": "economy",
"passengers": 1
}Response:
{
"quotes": [
{
"price": 416,
"currency": "USD",
"airline": "Unknown",
"stops": 0,
"source": "skyscanner.com",
"deepLink": "https://www.skyscanner.com/...",
"fetchedAt": "2026-06-21T19:20:34.277Z"
}
],
"lowest": { ... },
"average": 615,
"dataSource": "live_search",
"distanceKm": 9116
}Get a 14-day TimesFM price forecast.
Request:
{
"history": [200, 210, 215, 205, 195, ...],
"routeId": "trk_abc123",
"horizon": 14,
"lang": "es",
"route": {
"daysToDeparture": 45
}
}Response:
{
"model": "timesfm-2.5-200M-flax",
"forecast": [185.98, 193.82, 199.79, ...],
"lower": [185.98, 193.82, 186.97, ...],
"upper": [210.34, 196.42, 229.05, ...],
"recommendation": "buy_now",
"confidence": 92,
"expectedChangePct": 6.4,
"reasoning": "El precio estΓ‘ cerca del mΓnimo histΓ³rico ($182)...",
"usedTimesFM": true,
"lang": "es"
}See tests/README.md for comprehensive test documentation.
- Airport search tests: Verify city/country/IATA filtering
- Price engine tests: Verify deterministic pricing
- i18n tests: Verify all 6 language translations
- Mobile UI tests: Verify touch targets and responsive layouts
- Forecast tests: Verify TimesFM integration and fallback
- Alert tests: Verify price drop/target/historical low detection
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel --prodEnvironment variables (for z-ai SDK on Vercel):
ZAI_BASE_URLβ z-ai API base URLZAI_API_KEYβ z-ai API keyZAI_CHAT_IDβ chat session IDZAI_TOKENβ auth tokenZAI_USER_IDβ user ID
See docs/DEPLOYMENT.md for full details.
# Terminal 1: Start TimesFM service
cd mini-services/forecast-service
pip install timesfm jax jaxlib einshape flax jaxtyping
python index.py
# Terminal 2: Start Next.js
bun run devSee CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License β see LICENSE for details.
- TimesFM β Google Research's time-series foundation model
- shadcn/ui β UI component library
- Recharts β Charting library
- z-ai-web-dev-sdk β AI SDK for web search and LLM