How sriharichincholi/napier-frontend works
NAPIER is an airfare-index dashboard backed by a scraping and calculation pipeline. Users select a route and advance-purchase window, the dashboard requests trend data, and the API reads stored index metrics for charting. Separately, the scraper collects fare quotes and the engine computes Jevons metrics for API consumption. The scraper writes a price field, while the engine expects base_fare and total_fare; the sampled code does not establish how that schema difference is resolved. UI-to-summary wiring is not shown in the excerpt.
Main entry points: napier_scraper.py Route fare scraper · main.py Index API · page.tsx Dashboard and charts · napier_engine.py Jevons engine
Components 10
Dashboard
- Dashboard and charts
src/app/page.tsx - App shell
src/app/layout.tsx
Fare collection
- Scrape cycle
backend/napier_scraper.py - Route fare scraper
backend/napier_scraper.py
Index calculation
- Jevons engine
backend/napier_engine.py
API and storage
- Index API
backend/main.py - Raw fare records
- Index metrics
Other components
- Dashboard user
- Google Flights
Connections 10
- Dashboard user → Dashboard and charts: uses
- App shell → Dashboard and charts: renders
- Dashboard and charts → Index API: requests trends
- Index API → Index metrics: reads trends
- Scrape cycle → Route fare scraper: dispatches routes
- Route fare scraper → Google Flights: fetches fares
- Route fare scraper → Raw fare records: writes quotes
- Jevons engine → Raw fare records: reads fares
- Jevons engine → Index metrics: writes metrics
- Index API → Index metrics: reads latest snapshot