# mallickmaruf031-ux/yatripath architecture

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

- Interactive diagram: https://gitdiagram.com/mallickmaruf031-ux/yatripath
- Repository: https://github.com/mallickmaruf031-ux/yatripath

## Overview

YatriPath is a browser-only, sample-based travel booking prototype. Its main flow is route search, result selection, simulated booking and local booking/ticket viewing. The README documents all major pages and transport-specific behavior; those are represented even where source was not excerpted. Edges are limited to relationships visible in excerpts or stated in the README; unsampled page wiring is not inferred.

Main entry points: [`scripts/pages/search-results/search-results.js`](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/search-results/search-results.js) (Search results), [`scripts/pages/booking/booking-flow.js`](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/booking/booking-flow.js) (Booking flow), [`scripts/services/transport-search-service.js`](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/services/transport-search-service.js) (Route search engine), [`scripts/pages/home/home.js`](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/home/home.js) (Home and offers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Travel experience"]
  node_navigation["Navigation<br/>[navigation.js]"]
  node_home["Home and offers<br/>[home.js]"]
  node_home_data["Home content<br/>[home-data.js]"]
  node_multi_mode["Mode selection<br/>[multi-mode.js]"]
  node_login["Login and signup<br/>[login-signup.js]"]
  node_profile["Profile<br/>[profile.js]"]
  node_support["Support<br/>[support.js]"]
  node_info["Info pages<br/>[info-pages.js]"]
end

subgraph group_search["Search and locations"]
  node_autocomplete["Location autocomplete"]
  node_search_service["Route search engine"]
  node_location_data["Location datasets<br/>[air.js]"]
  node_route_data["Route datasets<br/>[routes.js]"]
  node_providers["Optional live providers<br/>[live-providers.js]"]
  node_results["Search results<br/>[search-results.js]"]
  node_result_cards["Result cards"]
end

subgraph group_transport["Transport modes"]
  node_bus_mode["Bus results and booking rules"]
  node_train_mode["Train results and booking rules"]
  node_flight_mode["Flight results and booking rules"]
  node_sample_itineraries["Sample itineraries"]
end

subgraph group_booking["Booking lifecycle"]
  node_booking_flow["Booking flow<br/>[booking-flow.js]"]
  node_fares["Fare breakdown<br/>[booking-fares.js]"]
  node_identity["Passenger identity"]
  node_mode_booking["Mode booking rules<br/>[bus-booking.js]"]
  node_my_bookings["My bookings<br/>[my-bookings.js]"]
  node_ticket["Ticket view<br/>[view-ticket.js]"]
end

subgraph group_shared["Shared runtime"]
  node_startup["App startup<br/>[main.js]"]
  node_router["Page router<br/>[router.js]"]
  node_state["App state<br/>[app-state.js]"]
end

node_traveler(("Traveler"))
node_browser_store[("Browser localStorage")]

node_traveler -.->|"opens search"| node_home
node_startup -->|"sets view"| node_state
node_startup -->|"renders view"| node_router
node_traveler -.->|"chooses page"| node_navigation
node_navigation -.->|"changes page"| node_router
node_traveler -.->|"chooses locations"| node_autocomplete
node_home -.->|"uses content"| node_home_data
node_home -.->|"offers modes"| node_multi_mode
node_autocomplete -.->|"queries locations"| node_search_service
node_search_service -->|"loads locations"| node_location_data
node_search_service -->|"checks routes"| node_route_data
node_search_service -->|"dispatches search"| node_providers
node_results -->|"runs search"| node_search_service
node_results -.->|"loads samples"| node_sample_itineraries
node_results -.->|"renders cards"| node_result_cards
node_results -->|"uses bus rendering"| node_bus_mode
node_results -->|"uses train rendering"| node_train_mode
node_results -.->|"uses flight rendering"| node_flight_mode
node_traveler -.->|"filters results"| node_results
node_results -->|"starts booking"| node_booking_flow
node_booking_flow -.->|"calculates fares"| node_fares
node_booking_flow -.->|"collects identity"| node_identity
node_booking_flow -.->|"applies rules"| node_mode_booking
node_booking_flow -.->|"saves booking"| node_my_bookings
node_my_bookings -.->|"reads bookings"| node_browser_store
node_my_bookings -.->|"opens ticket"| node_ticket
node_ticket -.->|"reads booking"| node_browser_store
node_login -.->|"stores account"| node_browser_store
node_profile -.->|"reads saved routes"| node_browser_store
node_traveler -.->|"signs in"| node_login
node_traveler -.->|"views profile"| node_profile
node_traveler -.->|"opens support"| node_support
node_traveler -.->|"reads information"| node_info

click node_startup "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/main.js"
click node_router "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/core/router.js"
click node_state "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/core/app-state.js"
click node_navigation "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/components/navigation.js"
click node_home "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/home/home.js"
click node_home_data "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/home/home-data.js"
click node_multi_mode "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/home/multi-mode.js"
click node_autocomplete "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/components/location-autocomplete.js"
click node_search_service "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/services/transport-search-service.js"
click node_location_data "https://github.com/mallickmaruf031-ux/yatripath/blob/main/data/air.js"
click node_route_data "https://github.com/mallickmaruf031-ux/yatripath/blob/main/data/routes.js"
click node_providers "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/services/live-providers.js"
click node_results "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/search-results/search-results.js"
click node_result_cards "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/search-results/search-result-cards.js"
click node_bus_mode "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/transport/bus/bus-search-results.js"
click node_train_mode "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/transport/train/train-search-results.js"
click node_flight_mode "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/transport/flight/flight-search-results.js"
click node_sample_itineraries "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/transport/bus/bus-sample-itineraries.js"
click node_booking_flow "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/booking/booking-flow.js"
click node_fares "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/booking/booking-fares.js"
click node_identity "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/booking/passenger-identity.js"
click node_mode_booking "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/transport/bus/bus-booking.js"
click node_my_bookings "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/my-bookings/my-bookings.js"
click node_ticket "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/ticket/view-ticket.js"
click node_login "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/login/login-signup.js"
click node_profile "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/profile/profile.js"
click node_support "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/support/support.js"
click node_info "https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/info-pages/info-pages.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_navigation,node_home,node_home_data,node_multi_mode,node_login,node_profile,node_support,node_info toneBlue
class node_autocomplete,node_search_service,node_location_data,node_route_data,node_providers,node_results,node_result_cards,node_browser_store toneAmber
class node_bus_mode,node_train_mode,node_flight_mode,node_sample_itineraries toneMint
class node_booking_flow,node_fares,node_identity,node_mode_booking,node_my_bookings,node_ticket toneRose
class node_startup,node_router,node_state,node_traveler toneIndigo
```

## Components

### Travel experience

- [Navigation](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/components/navigation.js): `scripts/components/navigation.js`
- [Home and offers](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/home/home.js): `scripts/pages/home/home.js`
- [Home content](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/home/home-data.js): `scripts/pages/home/home-data.js`
- [Mode selection](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/home/multi-mode.js): `scripts/pages/home/multi-mode.js`
- [Login and signup](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/login/login-signup.js): `scripts/pages/login/login-signup.js`
- [Profile](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/profile/profile.js): `scripts/pages/profile/profile.js`
- [Support](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/support/support.js): `scripts/pages/support/support.js`
- [Info pages](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/info-pages/info-pages.js): `scripts/pages/info-pages/info-pages.js`

### Search and locations

- [Location autocomplete](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/components/location-autocomplete.js): `scripts/components/location-autocomplete.js`
- [Route search engine](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/services/transport-search-service.js): `scripts/services/transport-search-service.js`
- [Location datasets](https://github.com/mallickmaruf031-ux/yatripath/blob/main/data/air.js): `data/air.js`
- [Route datasets](https://github.com/mallickmaruf031-ux/yatripath/blob/main/data/routes.js): `data/routes.js`
- [Optional live providers](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/services/live-providers.js): `scripts/services/live-providers.js`
- [Search results](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/search-results/search-results.js): `scripts/pages/search-results/search-results.js`
- [Result cards](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/search-results/search-result-cards.js): `scripts/pages/search-results/search-result-cards.js`

### Transport modes

- [Bus results and booking rules](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/transport/bus/bus-search-results.js): `scripts/transport/bus/bus-search-results.js`
- [Train results and booking rules](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/transport/train/train-search-results.js): `scripts/transport/train/train-search-results.js`
- [Flight results and booking rules](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/transport/flight/flight-search-results.js): `scripts/transport/flight/flight-search-results.js`
- [Sample itineraries](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/transport/bus/bus-sample-itineraries.js): `scripts/transport/bus/bus-sample-itineraries.js`

### Booking lifecycle

- [Booking flow](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/booking/booking-flow.js): `scripts/pages/booking/booking-flow.js`
- [Fare breakdown](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/booking/booking-fares.js): `scripts/pages/booking/booking-fares.js`
- [Passenger identity](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/booking/passenger-identity.js): `scripts/pages/booking/passenger-identity.js`
- [Mode booking rules](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/transport/bus/bus-booking.js): `scripts/transport/bus/bus-booking.js`
- [My bookings](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/my-bookings/my-bookings.js): `scripts/pages/my-bookings/my-bookings.js`
- [Ticket view](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/pages/ticket/view-ticket.js): `scripts/pages/ticket/view-ticket.js`

### Shared runtime

- [App startup](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/main.js): `scripts/main.js`
- [Page router](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/core/router.js): `scripts/core/router.js`
- [App state](https://github.com/mallickmaruf031-ux/yatripath/blob/main/scripts/core/app-state.js): `scripts/core/app-state.js`

### Other components

- **Traveler**
- **Browser localStorage**

## Connections

- Traveler → Home and offers: opens search (evidence: `README.md`)
- App startup → App state: sets view (evidence: `scripts/main.js`)
- App startup → Page router: renders view (evidence: `scripts/main.js`)
- Traveler → Navigation: chooses page (evidence: `README.md`)
- Navigation → Page router: changes page (evidence: `README.md`)
- Traveler → Location autocomplete: chooses locations (evidence: `README.md`)
- Home and offers → Home content: uses content (evidence: `README.md`)
- Home and offers → Mode selection: offers modes (evidence: `README.md`)
- Location autocomplete → Route search engine: queries locations (evidence: `README.md`)
- Route search engine → Location datasets: loads locations (evidence: `scripts/services/transport-search-service.js`)
- Route search engine → Route datasets: checks routes (evidence: `scripts/services/transport-search-service.js`)
- Route search engine → Optional live providers: dispatches search (evidence: `scripts/services/transport-search-service.js`)
- Search results → Route search engine: runs search (evidence: `scripts/pages/search-results/search-results.js`)
- Search results → Sample itineraries: loads samples (evidence: `README.md`)
- Search results → Result cards: renders cards (evidence: `README.md`)
- Search results → Bus results and booking rules: uses bus rendering (evidence: `scripts/pages/search-results/search-results.js`)
- Search results → Train results and booking rules: uses train rendering (evidence: `scripts/pages/search-results/search-results.js`)
- Search results → Flight results and booking rules: uses flight rendering (evidence: `README.md`)
- Traveler → Search results: filters results (evidence: `README.md`)
- Search results → Booking flow: starts booking (evidence: `scripts/pages/search-results/search-results.js`)
- Booking flow → Fare breakdown: calculates fares (evidence: `README.md`)
- Booking flow → Passenger identity: collects identity (evidence: `README.md`)
- Booking flow → Mode booking rules: applies rules (evidence: `README.md`)
- Booking flow → My bookings: saves booking (evidence: `README.md`)
- My bookings → Browser localStorage: reads bookings (evidence: `README.md`)
- My bookings → Ticket view: opens ticket (evidence: `README.md`)
- Ticket view → Browser localStorage: reads booking (evidence: `README.md`)
- Login and signup → Browser localStorage: stores account
- Profile → Browser localStorage: reads saved routes (evidence: `README.md`)
- Traveler → Login and signup: signs in (evidence: `README.md`)
- Traveler → Profile: views profile (evidence: `README.md`)
- Traveler → Support: opens support (evidence: `README.md`)
- Traveler → Info pages: reads information (evidence: `README.md`)
