# chanakya0727/ai-smart-travel-planner architecture

> Architecture diagram of the GitHub repository chanakya0727/ai-smart-travel-planner, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chanakya0727/ai-smart-travel-planner
- Repository: https://github.com/chanakya0727/ai-smart-travel-planner

## Overview

Smart AI Travel Planner is a Flask travel dashboard. Users register or sign in, enter trip parameters, and the dashboard gathers travel data, displays a route map, and requests a personalized itinerary. The README documents major integrations and capabilities not fully visible in the excerpts; those relationships are cited to the README, while source-level links use the shown calls. The backend excerpt is partial, so omitted implementation details are not inferred.

Main entry points: [`static/js/main.js`](https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/static/js/main.js) (Dashboard orchestration), [`templates/dashboard.html`](https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/templates/dashboard.html) (Dashboard view), [`app.py`](https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/app.py) (Flight lookup), [`templates/auth.html`](https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/templates/auth.html) (Login and signup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Access and trip setup"]
  node_auth_ui["Login and signup<br/>[auth.html]"]
  node_trip_form["Trip parameters<br/>[index.html]"]
end

subgraph group_dashboard["Travel dashboard"]
  node_dashboard_ui["Dashboard view<br/>[dashboard.html]"]
  node_orchestration["Dashboard orchestration<br/>[main.js]"]
  node_map["Route map<br/>[map.js]"]
  node_itinerary["Personalized itinerary<br/>[main.js]"]
end

subgraph group_backend["Travel services"]
  node_auth_routes["Authentication<br/>[app.py]"]
  node_user_db[("User database")]
  node_flight_service["Flight lookup<br/>[app.py]"]
  node_iata_mapping["Offline IATA mapping"]
  node_weather_service["Weather lookup<br/>[app.py]"]
  node_hotel_service["Hotel search<br/>[app.py]"]
  node_places_service["Attraction search<br/>[app.py]"]
  node_plan_service["AI itinerary generation<br/>[app.py]"]
end

subgraph group_integrations["External providers"]
  node_aviationstack["Aviationstack"]
  node_serpapi["SerpApi"]
  node_openweather["OpenWeatherMap"]
  node_gemini["Google Gemini"]
  node_mapbox["Mapbox services"]
end

node_traveler(("Traveler"))

node_traveler -->|"signs in"| node_auth_ui
node_auth_ui -.->|"submits credentials"| node_auth_routes
node_auth_routes -->|"reads and writes"| node_user_db
node_traveler -->|"enters trip"| node_trip_form
node_trip_form -.->|"opens dashboard"| node_dashboard_ui
node_dashboard_ui -.->|"loads script"| node_orchestration
node_orchestration -->|"requests weather"| node_weather_service
node_orchestration -->|"requests flights"| node_flight_service
node_orchestration -->|"requests hotels"| node_hotel_service
node_orchestration -->|"requests attractions"| node_places_service
node_orchestration -->|"sends trip data"| node_plan_service
node_flight_service -->|"looks up codes"| node_iata_mapping
node_flight_service -->|"fetches schedules"| node_aviationstack
node_weather_service -->|"fetches forecast"| node_openweather
node_hotel_service -->|"searches hotels"| node_serpapi
node_places_service -->|"searches attractions"| node_serpapi
node_plan_service -->|"generates itinerary"| node_gemini
node_plan_service -.->|"returns plan"| node_itinerary
node_orchestration -->|"renders plan"| node_itinerary
node_dashboard_ui -.->|"provides map view"| node_map
node_map -->|"geocodes and routes"| node_mapbox

click node_auth_ui "https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/templates/auth.html"
click node_auth_routes "https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/app.py"
click node_trip_form "https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/templates/index.html"
click node_dashboard_ui "https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/templates/dashboard.html"
click node_orchestration "https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/static/js/main.js"
click node_map "https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/static/js/map.js"
click node_flight_service "https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/app.py"
click node_iata_mapping "https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/city_iata_mapping.json"
click node_weather_service "https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/app.py"
click node_hotel_service "https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/app.py"
click node_places_service "https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/app.py"
click node_plan_service "https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/app.py"
click node_itinerary "https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/static/js/main.js"

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_auth_ui,node_trip_form toneBlue
class node_dashboard_ui,node_orchestration,node_map,node_itinerary toneAmber
class node_auth_routes,node_user_db,node_flight_service,node_iata_mapping,node_weather_service,node_hotel_service,node_places_service,node_plan_service toneMint
class node_aviationstack,node_serpapi,node_openweather,node_gemini,node_mapbox toneRose
class node_traveler toneIndigo
```

## Components

### Access and trip setup

- [Login and signup](https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/templates/auth.html): `templates/auth.html`
- [Trip parameters](https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/templates/index.html): `templates/index.html`

### Travel dashboard

- [Dashboard view](https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/templates/dashboard.html): `templates/dashboard.html`
- [Dashboard orchestration](https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/static/js/main.js): `static/js/main.js`
- [Route map](https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/static/js/map.js): `static/js/map.js`
- [Personalized itinerary](https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/static/js/main.js): `static/js/main.js`

### Travel services

- [Authentication](https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/app.py): `app.py`
- **User database**
- [Flight lookup](https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/app.py): `app.py`
- [Offline IATA mapping](https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/city_iata_mapping.json): `city_iata_mapping.json`
- [Weather lookup](https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/app.py): `app.py`
- [Hotel search](https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/app.py): `app.py`
- [Attraction search](https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/app.py): `app.py`
- [AI itinerary generation](https://github.com/chanakya0727/ai-smart-travel-planner/blob/main/app.py): `app.py`

### External providers

- **Aviationstack**
- **SerpApi**
- **OpenWeatherMap**
- **Google Gemini**
- **Mapbox services**

### Other components

- **Traveler**

## Connections

- Traveler → Login and signup: signs in (evidence: `README.md`)
- Login and signup → Authentication: submits credentials
- Authentication → User database: reads and writes (evidence: `app.py`)
- Traveler → Trip parameters: enters trip (evidence: `README.md`)
- Trip parameters → Dashboard view: opens dashboard
- Dashboard view → Dashboard orchestration: loads script
- Dashboard orchestration → Weather lookup: requests weather (evidence: `static/js/main.js`)
- Dashboard orchestration → Flight lookup: requests flights (evidence: `static/js/main.js`)
- Dashboard orchestration → Hotel search: requests hotels (evidence: `static/js/main.js`)
- Dashboard orchestration → Attraction search: requests attractions (evidence: `static/js/main.js`)
- Dashboard orchestration → AI itinerary generation: sends trip data (evidence: `static/js/main.js`)
- Flight lookup → Offline IATA mapping: looks up codes (evidence: `app.py`)
- Flight lookup → Aviationstack: fetches schedules (evidence: `README.md`)
- Weather lookup → OpenWeatherMap: fetches forecast (evidence: `app.py`)
- Hotel search → SerpApi: searches hotels (evidence: `app.py`)
- Attraction search → SerpApi: searches attractions (evidence: `app.py`)
- AI itinerary generation → Google Gemini: generates itinerary (evidence: `README.md`)
- AI itinerary generation → Personalized itinerary: returns plan
- Dashboard orchestration → Personalized itinerary: renders plan (evidence: `static/js/main.js`)
- Dashboard view → Route map: provides map view
- Route map → Mapbox services: geocodes and routes (evidence: `static/js/map.js`)
