# hmooodzozo577-gif/wej architecture

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

- Interactive diagram: https://gitdiagram.com/hmooodzozo577-gif/wej
- Repository: https://github.com/hmooodzozo577-gif/wej
- Video tour (about a minute): https://gitdiagram.com/hmooodzozo577-gif/wej/video

## Overview

Wejhaty is a bilingual travel-discovery and destination-recommendation web app, backed by a Worker API. The central traveler journey is choosing a purpose, answering a quiz, reviewing ranked recommendations, and opening destination details; Explore provides a separate browse-and-filter route. Supporting capabilities include local personalization, location-aware discovery, travel and entry information, destination intelligence, and feedback. The excerpts establish app routing, selected client-to-Worker requests, and Worker dispatch; route internals and several Worker integrations were not sampled, so uncertain connections are omitted.

Main entry points: [`worker/src/index.ts`](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/worker/src/index.ts) (Worker API), [`app/src/App.tsx`](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/App.tsx) (App router), [`worker/src/cityDescriptions.ts`](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/worker/src/cityDescriptions.ts) (City description API), [`app/src/personalization/PersonalizationProvider.tsx`](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/personalization/PersonalizationProvider.tsx) (Personalization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_journey["Traveler journey"]
  node_app["App router<br/>[App.tsx]"]
  node_home["Home<br/>[Home.tsx]"]
  node_purpose["Purpose selection<br/>[PurposeSelect.tsx]"]
  node_quiz["Travel quiz<br/>[Quiz.tsx]"]
  node_engine["Recommendation engine<br/>[index.ts]"]
  node_results["Results<br/>[Results.tsx]"]
  node_destination["Destination detail<br/>[Destination.tsx]"]
  node_explore["Explore<br/>[Explore.tsx]"]
end

subgraph group_personal["Personalization"]
  node_appstate["App state"]
  node_personalization["Personalization"]
  node_profile["Profile storage<br/>[storage.ts]"]
  node_location["Location services<br/>[geolocation.ts]"]
end

subgraph group_knowledge["Destination knowledge"]
  node_catalog["Destination catalog<br/>[destinations.ts]"]
  node_countrydata["Country intelligence"]
end

subgraph group_services["Worker services"]
  node_travelservice["Flight search client<br/>[travelService.ts]"]
  node_cityclient["City description client"]
  node_detailclient["Intelligence detail client<br/>[detailClient.ts]"]
  node_entry["Entry requirements"]
  node_telemetry["Product telemetry"]
  node_worker["Worker API<br/>[index.ts]"]
  node_productapi["Product data API<br/>[product.ts]"]
  node_visaapi["Visa API<br/>[visa.ts]"]
  node_cityapi["City description API"]
  node_intelligenceapi["Intelligence API<br/>[intelligence.ts]"]
  node_flightapi["Flight provider adapter<br/>[amadeus.ts]"]
end

subgraph group_operations["Operations"]
  node_admin["Admin surface<br/>[admin.ts]"]
end

node_traveler(("Traveler"))
node_d1[("Cloudflare D1")]
node_amadeus["Amadeus"]
node_wikipedia["Wikipedia"]

node_traveler -->|"uses"| node_app
node_app -->|"routes"| node_home
node_app -->|"routes"| node_purpose
node_app -->|"routes"| node_quiz
node_app -->|"routes"| node_results
node_app -->|"routes"| node_destination
node_app -->|"routes"| node_explore
node_app -->|"provides state"| node_appstate
node_app -->|"provides profile"| node_personalization
node_personalization -->|"reads and writes"| node_profile
node_travelservice -->|"requests flights"| node_worker
node_cityclient -->|"requests descriptions"| node_worker
node_detailclient -->|"requests details"| node_worker
node_entry -->|"requests requirements"| node_worker
node_telemetry -->|"submits events"| node_worker
node_worker -->|"dispatches admin"| node_admin
node_worker -->|"dispatches product"| node_productapi
node_worker -->|"dispatches visa"| node_visaapi
node_worker -->|"dispatches descriptions"| node_cityapi
node_worker -->|"dispatches intelligence"| node_intelligenceapi
node_worker -->|"dispatches flights"| node_flightapi
node_cityapi -.->|"fetches summaries"| node_wikipedia
node_flightapi -.->|"searches offers"| node_amadeus
node_cityapi -->|"caches descriptions"| node_d1
node_productapi -->|"stores product data"| node_d1

click node_app "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/App.tsx"
click node_home "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/routes/Home.tsx"
click node_purpose "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/routes/PurposeSelect.tsx"
click node_quiz "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/routes/Quiz.tsx"
click node_engine "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/engine/index.ts"
click node_results "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/routes/Results.tsx"
click node_destination "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/routes/Destination.tsx"
click node_explore "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/routes/Explore.tsx"
click node_appstate "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/state/AppStateContext.tsx"
click node_personalization "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/personalization/PersonalizationProvider.tsx"
click node_profile "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/personalization/storage.ts"
click node_location "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/geo/geolocation.ts"
click node_catalog "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/data/destinations.ts"
click node_countrydata "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/data/countryIntelligence.ts"
click node_travelservice "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/travel/travelService.ts"
click node_cityclient "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/cities/cityDescriptionClient.ts"
click node_detailclient "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/countryIntelligence/detailClient.ts"
click node_entry "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/entry/EntryRequirements.tsx"
click node_telemetry "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/telemetry/productDataClient.ts"
click node_worker "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/worker/src/index.ts"
click node_productapi "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/worker/src/product.ts"
click node_visaapi "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/worker/src/visa.ts"
click node_cityapi "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/worker/src/cityDescriptions.ts"
click node_intelligenceapi "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/worker/src/intelligence.ts"
click node_flightapi "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/worker/src/amadeus.ts"
click node_admin "https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/worker/src/admin.ts"

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_app,node_home,node_purpose,node_quiz,node_engine,node_results,node_destination,node_explore toneBlue
class node_appstate,node_personalization,node_profile,node_location,node_d1 toneAmber
class node_catalog,node_countrydata toneMint
class node_travelservice,node_cityclient,node_detailclient,node_entry,node_telemetry,node_worker,node_productapi,node_visaapi,node_cityapi,node_intelligenceapi,node_flightapi toneRose
class node_admin,node_traveler,node_amadeus,node_wikipedia toneIndigo
```

## Components

### Traveler journey

- [App router](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/App.tsx): `app/src/App.tsx`
- [Home](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/routes/Home.tsx): `app/src/routes/Home.tsx`
- [Purpose selection](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/routes/PurposeSelect.tsx): `app/src/routes/PurposeSelect.tsx`
- [Travel quiz](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/routes/Quiz.tsx): `app/src/routes/Quiz.tsx`
- [Recommendation engine](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/engine/index.ts): `app/src/engine/index.ts`
- [Results](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/routes/Results.tsx): `app/src/routes/Results.tsx`
- [Destination detail](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/routes/Destination.tsx): `app/src/routes/Destination.tsx`
- [Explore](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/routes/Explore.tsx): `app/src/routes/Explore.tsx`

### Personalization

- [App state](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/state/AppStateContext.tsx): `app/src/state/AppStateContext.tsx`
- [Personalization](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/personalization/PersonalizationProvider.tsx): `app/src/personalization/PersonalizationProvider.tsx`
- [Profile storage](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/personalization/storage.ts): `app/src/personalization/storage.ts`
- [Location services](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/geo/geolocation.ts): `app/src/geo/geolocation.ts`

### Destination knowledge

- [Destination catalog](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/data/destinations.ts): `app/src/data/destinations.ts`
- [Country intelligence](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/data/countryIntelligence.ts): `app/src/data/countryIntelligence.ts`

### Worker services

- [Flight search client](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/travel/travelService.ts): `app/src/travel/travelService.ts`
- [City description client](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/cities/cityDescriptionClient.ts): `app/src/cities/cityDescriptionClient.ts`
- [Intelligence detail client](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/countryIntelligence/detailClient.ts): `app/src/countryIntelligence/detailClient.ts`
- [Entry requirements](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/entry/EntryRequirements.tsx): `app/src/entry/EntryRequirements.tsx`
- [Product telemetry](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/app/src/telemetry/productDataClient.ts): `app/src/telemetry/productDataClient.ts`
- [Worker API](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/worker/src/index.ts): `worker/src/index.ts`
- [Product data API](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/worker/src/product.ts): `worker/src/product.ts`
- [Visa API](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/worker/src/visa.ts): `worker/src/visa.ts`
- [City description API](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/worker/src/cityDescriptions.ts): `worker/src/cityDescriptions.ts`
- [Intelligence API](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/worker/src/intelligence.ts): `worker/src/intelligence.ts`
- [Flight provider adapter](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/worker/src/amadeus.ts): `worker/src/amadeus.ts`

### Operations

- [Admin surface](https://github.com/hmooodzozo577-gif/wej/blob/claude/marhaba-kxry8l/worker/src/admin.ts): `worker/src/admin.ts`

### Other components

- **Traveler**
- **Cloudflare D1**
- **Amadeus**
- **Wikipedia**

## Connections

- Traveler → App router: uses
- App router → Home: routes
- App router → Purpose selection: routes
- App router → Travel quiz: routes
- App router → Results: routes
- App router → Destination detail: routes
- App router → Explore: routes
- App router → App state: provides state
- App router → Personalization: provides profile
- Personalization → Profile storage: reads and writes
- Flight search client → Worker API: requests flights
- City description client → Worker API: requests descriptions
- Intelligence detail client → Worker API: requests details
- Entry requirements → Worker API: requests requirements
- Product telemetry → Worker API: submits events
- Worker API → Admin surface: dispatches admin
- Worker API → Product data API: dispatches product
- Worker API → Visa API: dispatches visa
- Worker API → City description API: dispatches descriptions
- Worker API → Intelligence API: dispatches intelligence
- Worker API → Flight provider adapter: dispatches flights
- City description API → Wikipedia: fetches summaries
- Flight provider adapter → Amadeus: searches offers
- City description API → Cloudflare D1: caches descriptions
- Product data API → Cloudflare D1: stores product data
