GrayPane – Flight Search & Alerts

15 October 2025

Code: github.com/punitarani/flights-tracker

Flight route planning interface

Overview

GrayPane is a full‑stack flight discovery and alerting system. It enables users to search routes, track fare trends, explore award availability (via seats.aero), and receive scheduled email alerts. The app uses a typed API layer, durable background workflows, and a PostgreSQL schema designed for idempotent processing and auditability.

Flight search filters UI

System Architecture

At a high level, the system separates user‑facing interactions from durable background processing:

  1. User interacts with the Next.js app (search flights, manage alerts)
  2. API layer (tRPC) validates inputs, persists data, and orchestrates background work
  3. Cloudflare Workflows run on cron and via queues to process alerts at scale
  4. Workers call the app’s flight API for fresh data, apply alert rules, and send emails via Resend

Architecture Diagram (Workers Flow)

Flight search results UI

API & Service Layer

Core Services (Shared Between App and Workers)

Core business logic is implemented under src/core/ and reused by Workers via thin adapters:

Adapters in src/workers/adapters/ wrap these services for the Worker runtime, keeping Cloudflare‑specific code small.

Data Model Highlights

Alert Processing (Cloudflare Workers)

Seats.aero Async Search

A dedicated Workflow seats-aero-search processes award availability:

Engineering Practices

End-to-End Flow (User Perspective)

  1. Create alert(s) with typed filters (route, dates, price, cabin, stops)
  2. Cron schedules per-user processing via Cloudflare Queue (max 10 concurrent)
  3. Worker fetches fresh flights, matches filters, dedupes, records notification
  4. If eligible (6–9 PM UTC, >24h since last email), send a single daily email

References