# hasishinfant/tbo architecture

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

- Interactive diagram: https://gitdiagram.com/hasishinfant/tbo
- Repository: https://github.com/hasishinfant/tbo

## Overview

TravelSphere is a React travel-companion application spanning destination discovery, itinerary planning, flight and hotel search/booking, assistant chat, and emergency support. The typical journey is to plan a trip, view its itinerary, and continue into booking or travel assistance; emergency support is also a separate capability. The graph focuses on product flows and the flight/hotel search internals visible in the supplied excerpts. Several feature implementations were not sampled, so their connections are omitted or marked unverified.

Main entry points: [`src/App.tsx`](https://github.com/hasishinfant/tbo/blob/main/src/App.tsx) (TravelSphere app), [`src/pages/TripPlannerPage.tsx`](https://github.com/hasishinfant/tbo/blob/main/src/pages/TripPlannerPage.tsx) (Trip planner page), [`src/pages/HotelBookingPage.tsx`](https://github.com/hasishinfant/tbo/blob/main/src/pages/HotelBookingPage.tsx) (Hotel booking page), [`src/pages/ChatPage.tsx`](https://github.com/hasishinfant/tbo/blob/main/src/pages/ChatPage.tsx) (Assistant chat)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_application["TravelSphere app<br/>[App.tsx]"]
  node_home["Home and discovery<br/>[HomePage.tsx]"]
  node_destination_ui["Destination discovery"]
end

subgraph group_planning["Trip planning"]
  node_planner_page["Trip planner page"]
  node_planner_form["Trip preferences"]
  node_itinerary_service["Itinerary generation"]
  node_itinerary_page["Itinerary view<br/>[ItineraryPage.tsx]"]
  node_timeline["Itinerary timeline"]
end

subgraph group_booking["Travel booking"]
  node_hotel_page["Hotel booking page"]
  node_hotel_form["Hotel search form"]
  node_hotel_results["Hotel search results"]
  node_hotel_booking["Hotel booking workflow"]
  node_combined_booking["Combined itinerary booking"]
end

subgraph group_assistance["Travel assistance"]
  node_chat_page["Assistant chat<br/>[ChatPage.tsx]"]
  node_chat_ui["Chat interface<br/>[ChatContainer.tsx]"]
  node_assistant["AI assistant service"]
  node_codex["Codex integration<br/>[codexService.ts]"]
  node_emergency_page["Emergency support<br/>[EmergencyPage.tsx]"]
  node_emergency_service["Emergency requests"]
end

subgraph group_internals["Search and API"]
  node_api_hooks["API hooks<br/>[useApi.ts]"]
  node_hotel_search["Hotel search service"]
  node_tbo_client["TBO API client"]
  node_flight_search["Flight search service"]
  node_tek_client["Tek Travels client"]
  node_fallback["Search fallback"]
end

node_traveler(("Traveler"))

node_traveler -->|"uses"| node_application
node_application -->|"routes to"| node_home
node_application -->|"routes to"| node_planner_page
node_application -->|"routes to"| node_itinerary_page
node_application -->|"routes to"| node_chat_page
node_application -->|"routes to"| node_emergency_page
node_application -->|"routes to"| node_hotel_page
node_home -.->|"explores"| node_destination_ui
node_planner_page -.->|"presents"| node_planner_form
node_planner_page -.->|"uses"| node_api_hooks
node_api_hooks -->|"calls"| node_itinerary_service
node_planner_page -.->|"continues to"| node_itinerary_page
node_itinerary_page -->|"renders"| node_timeline
node_traveler -.->|"asks for assistance"| node_chat_page
node_chat_page -->|"uses"| node_chat_ui
node_chat_page -.->|"gets responses"| node_assistant
node_assistant -->|"requests AI response"| node_codex
node_emergency_page -.->|"submits requests"| node_emergency_service
node_hotel_page -.->|"presents"| node_hotel_form
node_hotel_form -->|"searches"| node_hotel_search
node_hotel_results -->|"uses"| node_hotel_search
node_hotel_search -->|"calls"| node_tbo_client
node_hotel_page -.->|"continues booking"| node_hotel_booking
node_hotel_page -.->|"searches flights"| node_flight_search
node_flight_search -->|"calls"| node_tek_client
node_flight_search -.->|"uses fallback"| node_fallback
node_hotel_search -.->|"uses fallback"| node_fallback
node_traveler -.->|"books trip"| node_combined_booking

click node_application "https://github.com/hasishinfant/tbo/blob/main/src/App.tsx"
click node_home "https://github.com/hasishinfant/tbo/blob/main/src/pages/HomePage.tsx"
click node_destination_ui "https://github.com/hasishinfant/tbo/tree/main/src/components/destination"
click node_planner_page "https://github.com/hasishinfant/tbo/blob/main/src/pages/TripPlannerPage.tsx"
click node_planner_form "https://github.com/hasishinfant/tbo/blob/main/src/components/trip-planner/TripPlannerForm.tsx"
click node_api_hooks "https://github.com/hasishinfant/tbo/blob/main/src/hooks/useApi.ts"
click node_itinerary_service "https://github.com/hasishinfant/tbo/blob/main/src/services/itineraryService.ts"
click node_itinerary_page "https://github.com/hasishinfant/tbo/blob/main/src/pages/ItineraryPage.tsx"
click node_timeline "https://github.com/hasishinfant/tbo/blob/main/src/components/itinerary/ItineraryTimeline.tsx"
click node_chat_page "https://github.com/hasishinfant/tbo/blob/main/src/pages/ChatPage.tsx"
click node_chat_ui "https://github.com/hasishinfant/tbo/blob/main/src/components/chat/ChatContainer.tsx"
click node_assistant "https://github.com/hasishinfant/tbo/blob/main/src/confidence-engine/services/assistantService.ts"
click node_codex "https://github.com/hasishinfant/tbo/blob/main/src/services/codexService.ts"
click node_emergency_page "https://github.com/hasishinfant/tbo/blob/main/src/pages/EmergencyPage.tsx"
click node_emergency_service "https://github.com/hasishinfant/tbo/blob/main/src/services/emergencyService.ts"
click node_hotel_page "https://github.com/hasishinfant/tbo/blob/main/src/pages/HotelBookingPage.tsx"
click node_hotel_form "https://github.com/hasishinfant/tbo/blob/main/src/components/hotel/HotelSearchForm.tsx"
click node_hotel_results "https://github.com/hasishinfant/tbo/blob/main/src/components/hotel/HotelSearchResults.tsx"
click node_hotel_search "https://github.com/hasishinfant/tbo/blob/main/src/services/hotelSearchService.ts"
click node_tbo_client "https://github.com/hasishinfant/tbo/blob/main/src/services/api/tboHotelApiClient.ts"
click node_hotel_booking "https://github.com/hasishinfant/tbo/blob/main/src/services/hotelBookingService.ts"
click node_flight_search "https://github.com/hasishinfant/tbo/blob/main/src/services/flightSearchService.ts"
click node_tek_client "https://github.com/hasishinfant/tbo/blob/main/src/services/api/tekTravelsApiClient.ts"
click node_fallback "https://github.com/hasishinfant/tbo/blob/main/src/services/mockFallbackHandler.ts"
click node_combined_booking "https://github.com/hasishinfant/tbo/blob/main/src/components/booking/CombinedBookingWorkflow.tsx"

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_application,node_home,node_destination_ui toneBlue
class node_planner_page,node_planner_form,node_itinerary_service,node_itinerary_page,node_timeline toneAmber
class node_hotel_page,node_hotel_form,node_hotel_results,node_hotel_booking,node_combined_booking toneMint
class node_chat_page,node_chat_ui,node_assistant,node_codex,node_emergency_page,node_emergency_service toneRose
class node_api_hooks,node_hotel_search,node_tbo_client,node_flight_search,node_tek_client,node_fallback,node_traveler toneIndigo
```

## Components

### Application shell

- [TravelSphere app](https://github.com/hasishinfant/tbo/blob/main/src/App.tsx): `src/App.tsx`
- [Home and discovery](https://github.com/hasishinfant/tbo/blob/main/src/pages/HomePage.tsx): `src/pages/HomePage.tsx`
- [Destination discovery](https://github.com/hasishinfant/tbo/tree/main/src/components/destination): `src/components/destination`

### Trip planning

- [Trip planner page](https://github.com/hasishinfant/tbo/blob/main/src/pages/TripPlannerPage.tsx): `src/pages/TripPlannerPage.tsx`
- [Trip preferences](https://github.com/hasishinfant/tbo/blob/main/src/components/trip-planner/TripPlannerForm.tsx): `src/components/trip-planner/TripPlannerForm.tsx`
- [Itinerary generation](https://github.com/hasishinfant/tbo/blob/main/src/services/itineraryService.ts): `src/services/itineraryService.ts`
- [Itinerary view](https://github.com/hasishinfant/tbo/blob/main/src/pages/ItineraryPage.tsx): `src/pages/ItineraryPage.tsx`
- [Itinerary timeline](https://github.com/hasishinfant/tbo/blob/main/src/components/itinerary/ItineraryTimeline.tsx): `src/components/itinerary/ItineraryTimeline.tsx`

### Travel booking

- [Hotel booking page](https://github.com/hasishinfant/tbo/blob/main/src/pages/HotelBookingPage.tsx): `src/pages/HotelBookingPage.tsx`
- [Hotel search form](https://github.com/hasishinfant/tbo/blob/main/src/components/hotel/HotelSearchForm.tsx): `src/components/hotel/HotelSearchForm.tsx`
- [Hotel search results](https://github.com/hasishinfant/tbo/blob/main/src/components/hotel/HotelSearchResults.tsx): `src/components/hotel/HotelSearchResults.tsx`
- [Hotel booking workflow](https://github.com/hasishinfant/tbo/blob/main/src/services/hotelBookingService.ts): `src/services/hotelBookingService.ts`
- [Combined itinerary booking](https://github.com/hasishinfant/tbo/blob/main/src/components/booking/CombinedBookingWorkflow.tsx): `src/components/booking/CombinedBookingWorkflow.tsx`

### Travel assistance

- [Assistant chat](https://github.com/hasishinfant/tbo/blob/main/src/pages/ChatPage.tsx): `src/pages/ChatPage.tsx`
- [Chat interface](https://github.com/hasishinfant/tbo/blob/main/src/components/chat/ChatContainer.tsx): `src/components/chat/ChatContainer.tsx`
- [AI assistant service](https://github.com/hasishinfant/tbo/blob/main/src/confidence-engine/services/assistantService.ts): `src/confidence-engine/services/assistantService.ts`
- [Codex integration](https://github.com/hasishinfant/tbo/blob/main/src/services/codexService.ts): `src/services/codexService.ts`
- [Emergency support](https://github.com/hasishinfant/tbo/blob/main/src/pages/EmergencyPage.tsx): `src/pages/EmergencyPage.tsx`
- [Emergency requests](https://github.com/hasishinfant/tbo/blob/main/src/services/emergencyService.ts): `src/services/emergencyService.ts`

### Search and API

- [API hooks](https://github.com/hasishinfant/tbo/blob/main/src/hooks/useApi.ts): `src/hooks/useApi.ts`
- [Hotel search service](https://github.com/hasishinfant/tbo/blob/main/src/services/hotelSearchService.ts): `src/services/hotelSearchService.ts`
- [TBO API client](https://github.com/hasishinfant/tbo/blob/main/src/services/api/tboHotelApiClient.ts): `src/services/api/tboHotelApiClient.ts`
- [Flight search service](https://github.com/hasishinfant/tbo/blob/main/src/services/flightSearchService.ts): `src/services/flightSearchService.ts`
- [Tek Travels client](https://github.com/hasishinfant/tbo/blob/main/src/services/api/tekTravelsApiClient.ts): `src/services/api/tekTravelsApiClient.ts`
- [Search fallback](https://github.com/hasishinfant/tbo/blob/main/src/services/mockFallbackHandler.ts): `src/services/mockFallbackHandler.ts`

### Other components

- **Traveler**

## Connections

- Traveler → TravelSphere app: uses (evidence: `README.md`)
- TravelSphere app → Home and discovery: routes to (evidence: `src/App.tsx`)
- TravelSphere app → Trip planner page: routes to (evidence: `src/App.tsx`)
- TravelSphere app → Itinerary view: routes to (evidence: `src/App.tsx`)
- TravelSphere app → Assistant chat: routes to (evidence: `src/App.tsx`)
- TravelSphere app → Emergency support: routes to (evidence: `src/App.tsx`)
- TravelSphere app → Hotel booking page: routes to (evidence: `src/App.tsx`)
- Home and discovery → Destination discovery: explores
- Trip planner page → Trip preferences: presents
- Trip planner page → API hooks: uses
- API hooks → Itinerary generation: calls (evidence: `src/hooks/useApi.ts`)
- Trip planner page → Itinerary view: continues to (evidence: `README.md`)
- Itinerary view → Itinerary timeline: renders (evidence: `src/pages/ItineraryPage.tsx`)
- Traveler → Assistant chat: asks for assistance
- Assistant chat → Chat interface: uses (evidence: `src/pages/ChatPage.tsx`)
- Assistant chat → AI assistant service: gets responses
- AI assistant service → Codex integration: requests AI response (evidence: `src/confidence-engine/services/assistantService.ts`)
- Emergency support → Emergency requests: submits requests
- Hotel booking page → Hotel search form: presents
- Hotel search form → Hotel search service: searches (evidence: `src/components/hotel/HotelSearchForm.tsx`)
- Hotel search results → Hotel search service: uses (evidence: `src/components/hotel/HotelSearchResults.tsx`)
- Hotel search service → TBO API client: calls (evidence: `src/services/hotelSearchService.ts`)
- Hotel booking page → Hotel booking workflow: continues booking
- Hotel booking page → Flight search service: searches flights
- Flight search service → Tek Travels client: calls (evidence: `src/services/flightSearchService.ts`)
- Flight search service → Search fallback: uses fallback (evidence: `src/services/flightSearchService.ts`)
- Hotel search service → Search fallback: uses fallback (evidence: `src/services/hotelSearchService.ts`)
- Traveler → Combined itinerary booking: books trip
