# prashantcode69/aeroindex architecture

> Architecture diagram of the GitHub repository prashantcode69/aeroindex, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prashantcode69/aeroindex
- Repository: https://github.com/prashantcode69/aeroindex

## Overview

AeroIndex is an airfare-intelligence app: users search an Indian route and receive fare-index and airline comparisons, booking-window and trend insights, market rankings, and optional price alerts. Route searches can use cached data or trigger a multi-window collection pipeline; results and history are stored as JSON. The graph reflects the documented API capabilities, but the sampled Flask and React excerpts are incomplete, so uncertain frontend/API wiring is not expanded beyond the documented interactions.

Main entry points: [`Backend/run_pipeline.py`](https://github.com/prashantcode69/aeroindex/blob/main/Backend/run_pipeline.py) (Refresh orchestration), [`Backend/app.py`](https://github.com/prashantcode69/aeroindex/blob/main/Backend/app.py) (Flask API), [`Backend/data/routes`](https://github.com/prashantcode69/aeroindex/tree/main/Backend/data/routes) (Clean route fares), [`Backend/pipeline/alert_checker.py`](https://github.com/prashantcode69/aeroindex/blob/main/Backend/pipeline/alert_checker.py) (Alert matching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_webapp["AeroIndex UI<br/>[App.jsx]"]
end

subgraph group_service["API and analysis"]
  node_flask["Flask API<br/>[app.py]"]
  node_route_analysis["Route analysis<br/>[app.py]"]
  node_market_overview["Market overview<br/>[app.py]"]
end

subgraph group_collection["Fare collection"]
  node_refresh_pipeline["Refresh orchestration<br/>[run_pipeline.py]"]
  node_flight_search["Google Flights search<br/>[search_flights.py]"]
  node_fare_extraction["Fare extraction"]
  node_fare_dedup["Fare deduplication"]
  node_fare_cleaning["Fare cleaning<br/>[cleaner.py]"]
  node_history_saver["History snapshots<br/>[history_saver.py]"]
end

subgraph group_persistence["JSON data"]
  node_raw_text["Search result text"]
  node_window_fares["Window fare files"]
  node_merged_fares["Merged fare records"]
  node_clean_fares["Clean route fares"]
  node_route_history["Route history"]
end

subgraph group_alerts["Price alerts"]
  node_alerts[("Alert records")]
  node_alert_checker["Alert matching<br/>[alert_checker.py]"]
  node_mailer["Email sender<br/>[mailer.py]"]
end

node_traveler(("Traveler"))
node_google_flights["Google Flights"]
node_smtp["SMTP service"]

node_traveler -->|"searches routes"| node_webapp
node_webapp -->|"requests API"| node_flask
node_flask -->|"starts refresh"| node_refresh_pipeline
node_refresh_pipeline -->|"runs windows"| node_flight_search
node_flight_search -->|"searches fares"| node_google_flights
node_flight_search -->|"writes results"| node_raw_text
node_fare_extraction -->|"reads results"| node_raw_text
node_refresh_pipeline -->|"runs per window"| node_fare_extraction
node_fare_extraction -->|"writes fares"| node_window_fares
node_refresh_pipeline -->|"runs after collection"| node_fare_dedup
node_fare_dedup -->|"reads fares"| node_window_fares
node_fare_dedup -->|"writes merged fares"| node_merged_fares
node_refresh_pipeline -->|"runs cleaning"| node_fare_cleaning
node_fare_cleaning -->|"reads records"| node_merged_fares
node_fare_cleaning -->|"writes route fares"| node_clean_fares
node_refresh_pipeline -->|"saves history"| node_history_saver
node_history_saver -->|"reads route fares"| node_clean_fares
node_history_saver -->|"updates snapshots"| node_route_history
node_flask -->|"serves airfare data"| node_route_analysis
node_route_analysis -->|"reads fares"| node_clean_fares
node_route_analysis -->|"reads history"| node_route_history
node_flask -->|"serves rankings"| node_market_overview
node_market_overview -->|"reads route data"| node_clean_fares
node_flask -->|"manages alerts"| node_alerts
node_refresh_pipeline -->|"runs alert check"| node_alert_checker
node_alert_checker -->|"reads current fares"| node_clean_fares
node_alert_checker -->|"matches and updates"| node_alerts
node_alert_checker -->|"sends matched alert"| node_mailer
node_mailer -.->|"sends email"| node_smtp

click node_webapp "https://github.com/prashantcode69/aeroindex/blob/main/src/App.jsx"
click node_flask "https://github.com/prashantcode69/aeroindex/blob/main/Backend/app.py"
click node_route_analysis "https://github.com/prashantcode69/aeroindex/blob/main/Backend/app.py"
click node_market_overview "https://github.com/prashantcode69/aeroindex/blob/main/Backend/app.py"
click node_refresh_pipeline "https://github.com/prashantcode69/aeroindex/blob/main/Backend/run_pipeline.py"
click node_flight_search "https://github.com/prashantcode69/aeroindex/blob/main/Backend/scraper/search_flights.py"
click node_fare_extraction "https://github.com/prashantcode69/aeroindex/blob/main/Backend/scraper/extract_google_fares.py"
click node_fare_dedup "https://github.com/prashantcode69/aeroindex/blob/main/Backend/scraper/deduplicate_google_fares.py"
click node_fare_cleaning "https://github.com/prashantcode69/aeroindex/blob/main/Backend/pipeline/cleaner.py"
click node_history_saver "https://github.com/prashantcode69/aeroindex/blob/main/Backend/pipeline/history_saver.py"
click node_raw_text "https://github.com/prashantcode69/aeroindex/tree/main/Backend/data/raw"
click node_window_fares "https://github.com/prashantcode69/aeroindex/tree/main/Backend/data/raw"
click node_merged_fares "https://github.com/prashantcode69/aeroindex/tree/main/Backend/data/raw"
click node_clean_fares "https://github.com/prashantcode69/aeroindex/tree/main/Backend/data/routes"
click node_route_history "https://github.com/prashantcode69/aeroindex/tree/main/Backend/data/routes"
click node_alerts "https://github.com/prashantcode69/aeroindex/tree/main/Backend/data"
click node_alert_checker "https://github.com/prashantcode69/aeroindex/blob/main/Backend/pipeline/alert_checker.py"
click node_mailer "https://github.com/prashantcode69/aeroindex/blob/main/Backend/pipeline/mailer.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp toneBlue
class node_flask,node_route_analysis,node_market_overview toneAmber
class node_refresh_pipeline,node_flight_search,node_fare_extraction,node_fare_dedup,node_fare_cleaning,node_history_saver toneMint
class node_raw_text,node_window_fares,node_merged_fares,node_clean_fares,node_route_history toneRose
class node_alerts,node_alert_checker,node_mailer,node_traveler,node_google_flights,node_smtp toneIndigo
```

## Components

### User experience

- [AeroIndex UI](https://github.com/prashantcode69/aeroindex/blob/main/src/App.jsx): `src/App.jsx`

### API and analysis

- [Flask API](https://github.com/prashantcode69/aeroindex/blob/main/Backend/app.py): `Backend/app.py`
- [Route analysis](https://github.com/prashantcode69/aeroindex/blob/main/Backend/app.py): `Backend/app.py`
- [Market overview](https://github.com/prashantcode69/aeroindex/blob/main/Backend/app.py): `Backend/app.py`

### Fare collection

- [Refresh orchestration](https://github.com/prashantcode69/aeroindex/blob/main/Backend/run_pipeline.py): `Backend/run_pipeline.py`
- [Google Flights search](https://github.com/prashantcode69/aeroindex/blob/main/Backend/scraper/search_flights.py): `Backend/scraper/search_flights.py`
- [Fare extraction](https://github.com/prashantcode69/aeroindex/blob/main/Backend/scraper/extract_google_fares.py): `Backend/scraper/extract_google_fares.py`
- [Fare deduplication](https://github.com/prashantcode69/aeroindex/blob/main/Backend/scraper/deduplicate_google_fares.py): `Backend/scraper/deduplicate_google_fares.py`
- [Fare cleaning](https://github.com/prashantcode69/aeroindex/blob/main/Backend/pipeline/cleaner.py): `Backend/pipeline/cleaner.py`
- [History snapshots](https://github.com/prashantcode69/aeroindex/blob/main/Backend/pipeline/history_saver.py): `Backend/pipeline/history_saver.py`

### JSON data

- [Search result text](https://github.com/prashantcode69/aeroindex/tree/main/Backend/data/raw): `Backend/data/raw`
- [Window fare files](https://github.com/prashantcode69/aeroindex/tree/main/Backend/data/raw): `Backend/data/raw`
- [Merged fare records](https://github.com/prashantcode69/aeroindex/tree/main/Backend/data/raw): `Backend/data/raw`
- [Clean route fares](https://github.com/prashantcode69/aeroindex/tree/main/Backend/data/routes): `Backend/data/routes`
- [Route history](https://github.com/prashantcode69/aeroindex/tree/main/Backend/data/routes): `Backend/data/routes`

### Price alerts

- [Alert records](https://github.com/prashantcode69/aeroindex/tree/main/Backend/data): `Backend/data`
- [Alert matching](https://github.com/prashantcode69/aeroindex/blob/main/Backend/pipeline/alert_checker.py): `Backend/pipeline/alert_checker.py`
- [Email sender](https://github.com/prashantcode69/aeroindex/blob/main/Backend/pipeline/mailer.py): `Backend/pipeline/mailer.py`

### Other components

- **Traveler**
- **Google Flights**
- **SMTP service**

## Connections

- Traveler → AeroIndex UI: searches routes
- AeroIndex UI → Flask API: requests API
- Flask API → Refresh orchestration: starts refresh
- Refresh orchestration → Google Flights search: runs windows
- Google Flights search → Google Flights: searches fares
- Google Flights search → Search result text: writes results
- Fare extraction → Search result text: reads results
- Refresh orchestration → Fare extraction: runs per window
- Fare extraction → Window fare files: writes fares
- Refresh orchestration → Fare deduplication: runs after collection
- Fare deduplication → Window fare files: reads fares
- Fare deduplication → Merged fare records: writes merged fares
- Refresh orchestration → Fare cleaning: runs cleaning
- Fare cleaning → Merged fare records: reads records
- Fare cleaning → Clean route fares: writes route fares
- Refresh orchestration → History snapshots: saves history
- History snapshots → Clean route fares: reads route fares
- History snapshots → Route history: updates snapshots
- Flask API → Route analysis: serves airfare data
- Route analysis → Clean route fares: reads fares
- Route analysis → Route history: reads history
- Flask API → Market overview: serves rankings
- Market overview → Clean route fares: reads route data
- Flask API → Alert records: manages alerts
- Refresh orchestration → Alert matching: runs alert check
- Alert matching → Clean route fares: reads current fares
- Alert matching → Alert records: matches and updates
- Alert matching → Email sender: sends matched alert
- Email sender → SMTP service: sends email
