Truth-first aviation intelligence project focused on Airport / Route Competitiveness Intelligence.
This repo currently supports three runtime modes:
- Frontend mock mode (
/api)- Default when running only
frontend. - Some legacy modules are still mock/demo-only.
- Default when running only
- Backend CSV fallback mode (
FPI_USE_CSV_FALLBACK=true)- FastAPI reads local marts CSV files.
- Backend PostgreSQL mode (
FPI_DATABASE_URLorDATABASE_URL)- FastAPI reads relational marts.
This project is not production-hardened and should be treated as an enthusiast intelligence MVP.
| Module | Runtime mode | Data source | Truth status |
|---|---|---|---|
Price Intelligence (/, /routes/*) |
Backend + frontend parity | Backend marts / demo fallback | Partial, real backend exists |
Airport Intelligence (/airports) |
Backend + frontend parity | Backend marts / demo fallback | Partial, real backend exists |
Route Changes Intel (/intelligence/route-changes) |
Backend-first | route_change_events mart |
Real backend-supported wedge |
Airport Role Intel (/intelligence/airports) |
Backend-first | airport_role_metrics mart |
Real backend-supported wedge |
Competition Intel (/intelligence/competition) |
Backend-first | route_competition_metrics, airport_competition_metrics |
Real backend-supported wedge |
Airline Intelligence (/airlines) |
Frontend mock APIs | frontend/lib/demo-data.ts |
Demo-only |
Route Network (/network) |
Frontend mock APIs | frontend/lib/demo-data.ts |
Demo-only |
Seasonality (/seasonality) |
Frontend mock APIs | frontend/lib/demo-data.ts |
Demo-only |
Learn (/learn) |
Frontend static/methodology endpoint | static + metadata | Partial documentation surface |
- Route launch/cut/resume/frequency-change intelligence endpoint:
GET /intelligence/routes/changes- Airport role metrics endpoint:
GET /intelligence/airports/{iata}/role
- Airport peer comparison endpoint:
GET /intelligence/airports/{iata}/peers
- Route competition endpoint:
GET /intelligence/routes/competition
- Airport competition endpoint:
GET /intelligence/airports/{iata}/competition
- Route insight endpoint:
GET /intelligence/routes/insights
- Airport insight endpoint:
GET /intelligence/airports/{iata}/insights
- Insight quality endpoint:
GET /meta/insight-quality
Data-model foundation now includes:
schedule_snapshotsroute_change_eventsairport_role_metricsroute_competition_metricsairport_competition_metrics
- No real-time aviation feed in this repo.
- Frequency and role metrics are MVP directional signals based on loaded slices.
- If required marts are missing, backend responses may be sparse/empty.
- Demo-only modules are explicitly labeled in UI and should not be interpreted as live intelligence.
# Terminal 1
cd backend
pip install -r requirements.txt
FPI_USE_CSV_FALLBACK=true uvicorn app.main:app --reload
# Terminal 2
cd frontend
npm install
NEXT_PUBLIC_API_BASE_URL=http://localhost:8000 npm run devcd frontend
npm install
npm run devDeploy the Next.js app from the frontend/ directory in Vercel Project Settings:
- Framework Preset:
Next.js - Root Directory:
frontend - Build Command:
npm run build - Install Command:
npm install
This repository intentionally does not use a root vercel.json override so Vercel can auto-detect and serve the Next.js app correctly from the configured root directory.
Backend-only API behavior:
- UI routes (
/,/airports,/routes/*, etc.) are served by Next.js frontend deployment. - Backend data endpoints are separate and require backend env/config (
NEXT_PUBLIC_API_BASE_URL, optionalBACKEND_URL+USE_BACKEND_PROXY=trueif you want Next.js server-side proxy rewrites).
Backend deploy config is included as render.yaml at repo root.
- Build:
pip install -r requirements.txt - Start:
uvicorn main:app --host 0.0.0.0 --port $PORT
Required backend env for production:
FPI_CORS_ORIGINSincludes your Vercel domainFPI_DATABASE_URL(preferred) orFPI_USE_CSV_FALLBACK=true
For frontend-backend connection in Vercel:
NEXT_PUBLIC_API_BASE_URL=https://<backend-host>BACKEND_URL=https://<backend-host>USE_BACKEND_PROXY=true
Core ingestion/build scripts:
scripts/ingest_bts_db1b.pyscripts/ingest_bts_ontime.pyscripts/ingest_faa_enplanements.pyscripts/build_monthly_fares.pyscripts/build_ontime_stats.pyscripts/build_schedule_snapshots.pyscripts/build_route_change_events.pyscripts/build_airport_role_metrics.pyscripts/build_route_scores.pyscripts/build_route_competition_metrics.pyscripts/build_airport_competition_metrics.py
After hardening current flagship wedge:
- Carrier competition intelligence
- Reliability disruption monitor
- Alliance/fleet intelligence (later)
MIT