# souravkumar-dev/aerovista architecture

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

- Interactive diagram: https://gitdiagram.com/souravkumar-dev/aerovista
- Repository: https://github.com/souravkumar-dev/aerovista

## Overview

Aerovista is a travel-booking web application for flights, hotels, and vacation packages, with account registration/sign-in and per-user bookings. The main workflow is: a traveler uses the browser interface to search travel options, selects an option, submits booking details, and later views or cancels bookings. The server also serves the site and handles authentication. Search and booking logic are in server.js; catalog.js supplies travel catalog data. Source excerpts are partial, so uncertain endpoint-to-storage details are not expanded.

Main entry points: [`server.js`](https://github.com/souravkumar-dev/aerovista/blob/main/server.js) (HTTP server and router), [`script.js`](https://github.com/souravkumar-dev/aerovista/blob/main/script.js) (Browser interactions), [`index.html`](https://github.com/souravkumar-dev/aerovista/blob/main/index.html) (Travel site), [`catalog.js`](https://github.com/souravkumar-dev/aerovista/blob/main/catalog.js) (Destination catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_page["Travel site<br/>[index.html]"]
  node_browser["Browser interactions<br/>[script.js]"]
  node_server["HTTP server and router<br/>[server.js]"]
end

subgraph group_travel["Travel discovery"]
  node_flights["Flight search<br/>[server.js]"]
  node_hotels["Hotel search<br/>[server.js]"]
  node_packages["Package search<br/>[server.js]"]
  node_destinations["Destination catalog<br/>[catalog.js]"]
end

subgraph group_identity["Accounts"]
  node_auth["Authentication<br/>[server.js]"]
  node_passwords["Password verification<br/>[server.js]"]
  node_attempts["Login attempt guard<br/>[server.js]"]
  node_users[("User records<br/>[users.json]")]
  node_sessions[("Session records<br/>[sessions.json]")]
end

subgraph group_booking["Booking and state"]
  node_bookingui["Booking and account views<br/>[script.js]"]
  node_bookingapi["Booking operations<br/>[server.js]"]
  node_bookings[("Booking records<br/>[bookings.json]")]
end

node_traveler(("Traveler"))

node_traveler -->|"uses"| node_page
node_page -->|"loads script"| node_browser
node_browser -->|"requests APIs"| node_server
node_server -->|"serves site"| node_page
node_server -->|"dispatches search"| node_flights
node_server -->|"dispatches search"| node_hotels
node_server -->|"dispatches search"| node_packages
node_flights -->|"reads catalog"| node_destinations
node_hotels -->|"reads catalog"| node_destinations
node_packages -->|"reads catalog"| node_destinations
node_server -->|"dispatches auth"| node_auth
node_auth -->|"checks credentials"| node_passwords
node_auth -->|"tracks failures"| node_attempts
node_auth -->|"reads and writes"| node_users
node_auth -->|"manages sessions"| node_sessions
node_browser -->|"opens booking views"| node_bookingui
node_bookingui -->|"requests booking actions"| node_server
node_server -->|"dispatches booking"| node_bookingapi
node_bookingapi -->|"reads and writes"| node_bookings

click node_page "https://github.com/souravkumar-dev/aerovista/blob/main/index.html"
click node_browser "https://github.com/souravkumar-dev/aerovista/blob/main/script.js"
click node_server "https://github.com/souravkumar-dev/aerovista/blob/main/server.js"
click node_flights "https://github.com/souravkumar-dev/aerovista/blob/main/server.js"
click node_hotels "https://github.com/souravkumar-dev/aerovista/blob/main/server.js"
click node_packages "https://github.com/souravkumar-dev/aerovista/blob/main/server.js"
click node_destinations "https://github.com/souravkumar-dev/aerovista/blob/main/catalog.js"
click node_auth "https://github.com/souravkumar-dev/aerovista/blob/main/server.js"
click node_passwords "https://github.com/souravkumar-dev/aerovista/blob/main/server.js"
click node_attempts "https://github.com/souravkumar-dev/aerovista/blob/main/server.js"
click node_users "https://github.com/souravkumar-dev/aerovista/blob/main/data/users.json"
click node_sessions "https://github.com/souravkumar-dev/aerovista/blob/main/data/sessions.json"
click node_bookingui "https://github.com/souravkumar-dev/aerovista/blob/main/script.js"
click node_bookingapi "https://github.com/souravkumar-dev/aerovista/blob/main/server.js"
click node_bookings "https://github.com/souravkumar-dev/aerovista/blob/main/data/bookings.json"

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_page,node_browser,node_server toneBlue
class node_flights,node_hotels,node_packages,node_destinations toneAmber
class node_auth,node_passwords,node_attempts,node_users,node_sessions toneMint
class node_bookingui,node_bookingapi,node_bookings toneRose
class node_traveler toneIndigo
```

## Components

### Web experience

- [Travel site](https://github.com/souravkumar-dev/aerovista/blob/main/index.html): `index.html`
- [Browser interactions](https://github.com/souravkumar-dev/aerovista/blob/main/script.js): `script.js`
- [HTTP server and router](https://github.com/souravkumar-dev/aerovista/blob/main/server.js): `server.js`

### Travel discovery

- [Flight search](https://github.com/souravkumar-dev/aerovista/blob/main/server.js): `server.js`
- [Hotel search](https://github.com/souravkumar-dev/aerovista/blob/main/server.js): `server.js`
- [Package search](https://github.com/souravkumar-dev/aerovista/blob/main/server.js): `server.js`
- [Destination catalog](https://github.com/souravkumar-dev/aerovista/blob/main/catalog.js): `catalog.js`

### Accounts

- [Authentication](https://github.com/souravkumar-dev/aerovista/blob/main/server.js): `server.js`
- [Password verification](https://github.com/souravkumar-dev/aerovista/blob/main/server.js): `server.js`
- [Login attempt guard](https://github.com/souravkumar-dev/aerovista/blob/main/server.js): `server.js`
- [User records](https://github.com/souravkumar-dev/aerovista/blob/main/data/users.json): `data/users.json`
- [Session records](https://github.com/souravkumar-dev/aerovista/blob/main/data/sessions.json): `data/sessions.json`

### Booking and state

- [Booking and account views](https://github.com/souravkumar-dev/aerovista/blob/main/script.js): `script.js`
- [Booking operations](https://github.com/souravkumar-dev/aerovista/blob/main/server.js): `server.js`
- [Booking records](https://github.com/souravkumar-dev/aerovista/blob/main/data/bookings.json): `data/bookings.json`

### Other components

- **Traveler**

## Connections

- Traveler → Travel site: uses
- Travel site → Browser interactions: loads script
- Browser interactions → HTTP server and router: requests APIs
- HTTP server and router → Travel site: serves site
- HTTP server and router → Flight search: dispatches search
- HTTP server and router → Hotel search: dispatches search
- HTTP server and router → Package search: dispatches search
- Flight search → Destination catalog: reads catalog
- Hotel search → Destination catalog: reads catalog
- Package search → Destination catalog: reads catalog
- HTTP server and router → Authentication: dispatches auth
- Authentication → Password verification: checks credentials
- Authentication → Login attempt guard: tracks failures
- Authentication → User records: reads and writes
- Authentication → Session records: manages sessions
- Browser interactions → Booking and account views: opens booking views
- Booking and account views → HTTP server and router: requests booking actions
- HTTP server and router → Booking operations: dispatches booking
- Booking operations → Booking records: reads and writes
