# xdianovx/bsi architecture

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

- Interactive diagram: https://gitdiagram.com/xdianovx/bsi
- Repository: https://github.com/xdianovx/bsi

## Overview

This is a WordPress travel-agency theme, not the generic Underscores starter described by the README. Its visible product spans travel content pages and interactive search, booking, and hotel-price features, with SamoTour as an external travel-data integration. The principal browser workflow initializes search and catalog interactions, which call WordPress AJAX endpoints; excerpts do not establish most of those endpoint connections, so they are not drawn. Some capabilities are represented by their exact tree paths, but their internal wiring is unsampled.

Main entry points: [`js/main.js`](https://github.com/xdianovx/bsi/blob/main/js/main.js) (Browser initializer), [`inc/samo/SamoService.php`](https://github.com/xdianovx/bsi/blob/main/inc/samo/SamoService.php) (Samo service), [`js/modules/ajax/hotels-prices.js`](https://github.com/xdianovx/bsi/blob/main/js/modules/ajax/hotels-prices.js) (Hotel price polling), [`inc/samo/SamoClient.php`](https://github.com/xdianovx/bsi/blob/main/inc/samo/SamoClient.php) (Samo HTTP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Theme and content"]
  node_theme["Theme templates<br/>[functions.php]"]
  node_travel_content["Travel content types"]
  node_country["Country pages<br/>[single-country.php]"]
  node_education["Education programs<br/>[education.php]"]
  node_events["Events and tours"]
  node_hotel_view["Hotel pages<br/>[view.php]"]
end

subgraph group_browser["Browser interactions"]
  node_main_js["Browser initializer<br/>[main.js]"]
  node_travel_search["Travel search<br/>[gtm-search.js]"]
  node_country_tours["Country tour filters<br/>[country-tours.js]"]
  node_education_filter["Education filters"]
  node_event_tours["Event tour filters<br/>[event-tours.js]"]
  node_hotels_catalog["Hotel catalog"]
  node_hotel_prices_js["Hotel price polling<br/>[hotels-prices.js]"]
end

subgraph group_integration["Travel data integration"]
  node_price_loader["Price loading service"]
  node_cache[("Transient cache<br/>[CacheService.php]")]
  node_crosstour["Event-tour data<br/>[crosstour.php]"]
  node_samo_service["Samo service<br/>[SamoService.php]"]
  node_samo_endpoints["Samo endpoints<br/>[SamoEndpoints.php]"]
  node_samo_client["Samo HTTP client<br/>[SamoClient.php]"]
end

subgraph group_hotelapi["Hotel API"]
  node_hotel_api_client["Hotel API client"]
  node_hotel_api_search["Hotel search handler"]
end

subgraph group_requests["Requests and bookings"]
  node_booking_forms["Booking forms"]
  node_ajax_requests["WordPress request handlers"]
end

node_visitor(("Site visitor"))
node_samo_api{{"SamoTour API"}}

node_visitor -.->|"visits"| node_theme
node_main_js -->|"initializes"| node_travel_search
node_main_js -->|"initializes"| node_hotel_prices_js
node_main_js -->|"initializes"| node_country_tours
node_main_js -->|"initializes"| node_event_tours
node_travel_search -.->|"presents search"| node_visitor
node_hotel_prices_js -.->|"updates prices"| node_visitor
node_hotel_prices_js -.->|"requests prices"| node_ajax_requests
node_hotels_catalog -.->|"requests catalog"| node_hotel_api_search
node_price_loader -->|"reads cache"| node_cache
node_price_loader -->|"loads prices"| node_samo_service
node_crosstour -->|"reads cache"| node_cache
node_crosstour -->|"requests tour data"| node_samo_service
node_samo_service -->|"creates client"| node_samo_client
node_samo_service -->|"creates endpoints"| node_samo_endpoints
node_samo_endpoints -->|"dispatches requests"| node_samo_client
node_samo_client -->|"sends HTTP request"| node_samo_api

click node_theme "https://github.com/xdianovx/bsi/blob/main/functions.php"
click node_travel_content "https://github.com/xdianovx/bsi/tree/main/inc/post-types"
click node_country "https://github.com/xdianovx/bsi/blob/main/single-country.php"
click node_education "https://github.com/xdianovx/bsi/blob/main/inc/post-types/education.php"
click node_events "https://github.com/xdianovx/bsi/blob/main/inc/post-types/custom-post-event.php"
click node_hotel_view "https://github.com/xdianovx/bsi/blob/main/inc/hotel-page/view.php"
click node_main_js "https://github.com/xdianovx/bsi/blob/main/js/main.js"
click node_travel_search "https://github.com/xdianovx/bsi/blob/main/js/modules/gtm-search.js"
click node_country_tours "https://github.com/xdianovx/bsi/blob/main/js/modules/ajax/country-tours.js"
click node_education_filter "https://github.com/xdianovx/bsi/blob/main/js/modules/ajax/education-filter.js"
click node_event_tours "https://github.com/xdianovx/bsi/blob/main/js/modules/ajax/event-tours.js"
click node_hotels_catalog "https://github.com/xdianovx/bsi/blob/main/js/modules/ajax/hotels-api-catalog.js"
click node_hotel_prices_js "https://github.com/xdianovx/bsi/blob/main/js/modules/ajax/hotels-prices.js"
click node_booking_forms "https://github.com/xdianovx/bsi/tree/main/js/modules/forms"
click node_ajax_requests "https://github.com/xdianovx/bsi/tree/main/inc/requests"
click node_hotel_api_client "https://github.com/xdianovx/bsi/blob/main/inc/hotels-api/HotelsApiClient.php"
click node_hotel_api_search "https://github.com/xdianovx/bsi/blob/main/inc/requests/ajax-hotels-api-search.php"
click node_price_loader "https://github.com/xdianovx/bsi/blob/main/inc/services/PriceLoaderService.php"
click node_cache "https://github.com/xdianovx/bsi/blob/main/inc/services/CacheService.php"
click node_crosstour "https://github.com/xdianovx/bsi/blob/main/inc/helpers/crosstour.php"
click node_samo_service "https://github.com/xdianovx/bsi/blob/main/inc/samo/SamoService.php"
click node_samo_endpoints "https://github.com/xdianovx/bsi/blob/main/inc/samo/SamoEndpoints.php"
click node_samo_client "https://github.com/xdianovx/bsi/blob/main/inc/samo/SamoClient.php"

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_theme,node_travel_content,node_country,node_education,node_events,node_hotel_view toneBlue
class node_main_js,node_travel_search,node_country_tours,node_education_filter,node_event_tours,node_hotels_catalog,node_hotel_prices_js toneAmber
class node_price_loader,node_cache,node_crosstour,node_samo_service,node_samo_endpoints,node_samo_client,node_samo_api toneMint
class node_hotel_api_client,node_hotel_api_search toneRose
class node_booking_forms,node_ajax_requests,node_visitor toneIndigo
```

## Components

### Theme and content

- [Theme templates](https://github.com/xdianovx/bsi/blob/main/functions.php): `functions.php`
- [Travel content types](https://github.com/xdianovx/bsi/tree/main/inc/post-types): `inc/post-types`
- [Country pages](https://github.com/xdianovx/bsi/blob/main/single-country.php): `single-country.php`
- [Education programs](https://github.com/xdianovx/bsi/blob/main/inc/post-types/education.php): `inc/post-types/education.php`
- [Events and tours](https://github.com/xdianovx/bsi/blob/main/inc/post-types/custom-post-event.php): `inc/post-types/custom-post-event.php`
- [Hotel pages](https://github.com/xdianovx/bsi/blob/main/inc/hotel-page/view.php): `inc/hotel-page/view.php`

### Browser interactions

- [Browser initializer](https://github.com/xdianovx/bsi/blob/main/js/main.js): `js/main.js`
- [Travel search](https://github.com/xdianovx/bsi/blob/main/js/modules/gtm-search.js): `js/modules/gtm-search.js`
- [Country tour filters](https://github.com/xdianovx/bsi/blob/main/js/modules/ajax/country-tours.js): `js/modules/ajax/country-tours.js`
- [Education filters](https://github.com/xdianovx/bsi/blob/main/js/modules/ajax/education-filter.js): `js/modules/ajax/education-filter.js`
- [Event tour filters](https://github.com/xdianovx/bsi/blob/main/js/modules/ajax/event-tours.js): `js/modules/ajax/event-tours.js`
- [Hotel catalog](https://github.com/xdianovx/bsi/blob/main/js/modules/ajax/hotels-api-catalog.js): `js/modules/ajax/hotels-api-catalog.js`
- [Hotel price polling](https://github.com/xdianovx/bsi/blob/main/js/modules/ajax/hotels-prices.js): `js/modules/ajax/hotels-prices.js`

### Travel data integration

- [Price loading service](https://github.com/xdianovx/bsi/blob/main/inc/services/PriceLoaderService.php): `inc/services/PriceLoaderService.php`
- [Transient cache](https://github.com/xdianovx/bsi/blob/main/inc/services/CacheService.php): `inc/services/CacheService.php`
- [Event-tour data](https://github.com/xdianovx/bsi/blob/main/inc/helpers/crosstour.php): `inc/helpers/crosstour.php`
- [Samo service](https://github.com/xdianovx/bsi/blob/main/inc/samo/SamoService.php): `inc/samo/SamoService.php`
- [Samo endpoints](https://github.com/xdianovx/bsi/blob/main/inc/samo/SamoEndpoints.php): `inc/samo/SamoEndpoints.php`
- [Samo HTTP client](https://github.com/xdianovx/bsi/blob/main/inc/samo/SamoClient.php): `inc/samo/SamoClient.php`

### Hotel API

- [Hotel API client](https://github.com/xdianovx/bsi/blob/main/inc/hotels-api/HotelsApiClient.php): `inc/hotels-api/HotelsApiClient.php`
- [Hotel search handler](https://github.com/xdianovx/bsi/blob/main/inc/requests/ajax-hotels-api-search.php): `inc/requests/ajax-hotels-api-search.php`

### Requests and bookings

- [Booking forms](https://github.com/xdianovx/bsi/tree/main/js/modules/forms): `js/modules/forms`
- [WordPress request handlers](https://github.com/xdianovx/bsi/tree/main/inc/requests): `inc/requests`

### Other components

- **Site visitor**
- **SamoTour API**

## Connections

- Site visitor → Theme templates: visits
- Browser initializer → Travel search: initializes (evidence: `js/main.js`)
- Browser initializer → Hotel price polling: initializes (evidence: `js/main.js`)
- Browser initializer → Country tour filters: initializes (evidence: `js/main.js`)
- Browser initializer → Event tour filters: initializes (evidence: `js/main.js`)
- Travel search → Site visitor: presents search
- Hotel price polling → Site visitor: updates prices
- Hotel price polling → WordPress request handlers: requests prices
- Hotel catalog → Hotel search handler: requests catalog
- Price loading service → Transient cache: reads cache (evidence: `inc/services/PriceLoaderService.php`)
- Price loading service → Samo service: loads prices (evidence: `inc/services/PriceLoaderService.php`)
- Event-tour data → Transient cache: reads cache (evidence: `inc/helpers/crosstour.php`)
- Event-tour data → Samo service: requests tour data (evidence: `inc/helpers/crosstour.php`)
- Samo service → Samo HTTP client: creates client (evidence: `inc/samo/SamoService.php`)
- Samo service → Samo endpoints: creates endpoints (evidence: `inc/samo/SamoService.php`)
- Samo endpoints → Samo HTTP client: dispatches requests (evidence: `inc/samo/SamoEndpoints.php`)
- Samo HTTP client → SamoTour API: sends HTTP request (evidence: `inc/samo/SamoClient.php`)
