# tonbunheng/tourism-frontend-travel architecture

> Architecture diagram of the GitHub repository tonbunheng/tourism-frontend-travel, 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/tonbunheng/tourism-frontend-travel
- Repository: https://github.com/tonbunheng/tourism-frontend-travel

## Overview

AngkorVerses is a Cambodian tourism frontend for discovering destinations, events, galleries and businesses, with saved favorites, trip planning, reviews, and account features. The primary flow routes a visitor into discovery pages, which retrieve domain data through service modules and render it for browsing; authenticated tourists can save places, review them, or plan trips. A separate protected business-owner portal supports listing management and analytics. The graph combines sampled call evidence with README-documented capabilities; unsampled page-to-service links are omitted or marked unverified.

Main entry points: [`src/routes/AppRoutes.jsx`](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/routes/AppRoutes.jsx) (Application routes), [`src/services`](https://github.com/tonbunheng/tourism-frontend-travel/tree/main/src/services) (Tourism services), [`src/pages/places/PlaceDetails.jsx`](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/places/PlaceDetails.jsx) (Place details), [`src/services/businessService.js`](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/services/businessService.js) (Business service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Tourist experience"]
  node_routes["Application routes<br/>[AppRoutes.jsx]"]
  node_main_layout["Main layout<br/>[Main.jsx]"]
  node_discovery["Destination discovery<br/>[Home.jsx]"]
  node_place_details["Place details<br/>[PlaceDetails.jsx]"]
  node_province_details["Province details"]
  node_events["Events<br/>[Events.jsx]"]
  node_gallery["Media gallery<br/>[Galleries.jsx]"]
  node_trips["Trip planning<br/>[TripDetails.jsx]"]
  node_favorites["Favorites<br/>[Favorites.jsx]"]
end

subgraph group_identity["Identity and state"]
  node_tourist_account["Tourist account<br/>[Profile.jsx]"]
  node_auth_state["Authentication state<br/>[AuthContext.jsx]"]
  node_travel_state["Travel state<br/>[TravelContext.jsx]"]
end

subgraph group_owner["Business portal"]
  node_business_discovery["Business discovery"]
  node_business_management["Business management<br/>[BusinessManage.jsx]"]
  node_business_analytics["Business analytics"]
end

subgraph group_services["Domain services"]
  node_domain_services["Tourism services"]
  node_business_service["Business service<br/>[businessService.js]"]
  node_review_service["Review service<br/>[reviewService.js]"]
  node_api_client["HTTP clients<br/>[api.js]"]
end

subgraph group_shared["Shared interface"]
  node_header["Navigation header<br/>[Header.jsx]"]
  node_chat["Support chat<br/>[ChatWidget.jsx]"]
  node_breadcrumb["Breadcrumbs<br/>[Breadcrumb.jsx]"]
  node_review_dialog["Review dialog<br/>[ReviewModal.jsx]"]
  node_alert_state["Alert state<br/>[AlertContext.jsx]"]
  node_alert_dialog["Alert dialog<br/>[AlertModal.jsx]"]
end

node_tourist(("Tourist"))
node_business_owner(("Business owner"))
node_backend(("Tourism API"))

node_tourist -->|"opens"| node_routes
node_business_owner -->|"opens"| node_routes
node_routes -->|"wraps pages"| node_main_layout
node_routes -->|"routes to"| node_discovery
node_routes -->|"routes to"| node_place_details
node_routes -->|"routes to"| node_province_details
node_routes -->|"routes to"| node_events
node_routes -->|"routes to"| node_gallery
node_routes -->|"routes to"| node_trips
node_routes -->|"routes to"| node_favorites
node_routes -->|"routes to"| node_tourist_account
node_routes -->|"routes to"| node_business_discovery
node_routes -->|"routes to"| node_business_management
node_routes -->|"routes to"| node_business_analytics
node_main_layout -->|"renders"| node_header
node_main_layout -->|"renders"| node_chat
node_discovery -->|"loads content"| node_domain_services
node_discovery -.->|"links to"| node_place_details
node_gallery -->|"loads media"| node_domain_services
node_place_details -->|"opens"| node_review_dialog
node_review_dialog -->|"submits review"| node_review_service
node_business_discovery -->|"loads business"| node_business_service
node_business_management -->|"manages listing"| node_business_service
node_business_analytics -.->|"loads metrics"| node_business_service
node_tourist_account -->|"uses account state"| node_auth_state
node_travel_state -->|"checks identity"| node_auth_state
node_travel_state -->|"loads shared data"| node_domain_services
node_chat -->|"uses chat service"| node_domain_services
node_domain_services -->|"uses HTTP client"| node_api_client
node_business_service -->|"uses HTTP clients"| node_api_client
node_review_service -->|"uses HTTP client"| node_api_client
node_api_client -->|"sends requests"| node_backend
node_place_details -->|"renders"| node_breadcrumb
node_business_management -->|"renders"| node_breadcrumb
node_alert_state -->|"renders"| node_alert_dialog
node_review_dialog -->|"shows feedback"| node_alert_state

click node_routes "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/routes/AppRoutes.jsx"
click node_main_layout "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/layouts/Main.jsx"
click node_discovery "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/home/Home.jsx"
click node_place_details "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/places/PlaceDetails.jsx"
click node_province_details "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/provinces/ProvinceDetails.jsx"
click node_events "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/events/Events.jsx"
click node_gallery "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/galleries/Galleries.jsx"
click node_trips "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/trips/TripDetails.jsx"
click node_favorites "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/favorites/Favorites.jsx"
click node_tourist_account "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/profiles/Profile.jsx"
click node_auth_state "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/context/AuthContext.jsx"
click node_travel_state "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/context/TravelContext.jsx"
click node_business_discovery "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/businesses/BusinessDetails.jsx"
click node_business_management "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/business/BusinessManage.jsx"
click node_business_analytics "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/business/BusinessAnalytics.jsx"
click node_domain_services "https://github.com/tonbunheng/tourism-frontend-travel/tree/main/src/services"
click node_business_service "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/services/businessService.js"
click node_review_service "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/services/reviewService.js"
click node_api_client "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/services/api.js"
click node_header "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/components/layout/Header.jsx"
click node_chat "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/components/chat/ChatWidget.jsx"
click node_breadcrumb "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/components/common/Breadcrumb.jsx"
click node_review_dialog "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/components/reviews/ReviewModal.jsx"
click node_alert_state "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/context/AlertContext.jsx"
click node_alert_dialog "https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/components/common/AlertModal.jsx"

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_routes,node_main_layout,node_discovery,node_place_details,node_province_details,node_events,node_gallery,node_trips,node_favorites toneBlue
class node_tourist_account,node_auth_state,node_travel_state toneAmber
class node_business_discovery,node_business_management,node_business_analytics,node_backend toneMint
class node_domain_services,node_business_service,node_review_service,node_api_client toneRose
class node_header,node_chat,node_breadcrumb,node_review_dialog,node_alert_state,node_alert_dialog,node_tourist,node_business_owner toneIndigo
```

## Components

### Tourist experience

- [Application routes](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/routes/AppRoutes.jsx): `src/routes/AppRoutes.jsx`
- [Main layout](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/layouts/Main.jsx): `src/layouts/Main.jsx`
- [Destination discovery](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/home/Home.jsx): `src/pages/home/Home.jsx`
- [Place details](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/places/PlaceDetails.jsx): `src/pages/places/PlaceDetails.jsx`
- [Province details](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/provinces/ProvinceDetails.jsx): `src/pages/provinces/ProvinceDetails.jsx`
- [Events](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/events/Events.jsx): `src/pages/events/Events.jsx`
- [Media gallery](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/galleries/Galleries.jsx): `src/pages/galleries/Galleries.jsx`
- [Trip planning](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/trips/TripDetails.jsx): `src/pages/trips/TripDetails.jsx`
- [Favorites](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/favorites/Favorites.jsx): `src/pages/favorites/Favorites.jsx`

### Identity and state

- [Tourist account](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/profiles/Profile.jsx): `src/pages/profiles/Profile.jsx`
- [Authentication state](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Travel state](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/context/TravelContext.jsx): `src/context/TravelContext.jsx`

### Business portal

- [Business discovery](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/businesses/BusinessDetails.jsx): `src/pages/businesses/BusinessDetails.jsx`
- [Business management](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/business/BusinessManage.jsx): `src/pages/business/BusinessManage.jsx`
- [Business analytics](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/pages/business/BusinessAnalytics.jsx): `src/pages/business/BusinessAnalytics.jsx`

### Domain services

- [Tourism services](https://github.com/tonbunheng/tourism-frontend-travel/tree/main/src/services): `src/services`
- [Business service](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/services/businessService.js): `src/services/businessService.js`
- [Review service](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/services/reviewService.js): `src/services/reviewService.js`
- [HTTP clients](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/services/api.js): `src/services/api.js`

### Shared interface

- [Navigation header](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/components/layout/Header.jsx): `src/components/layout/Header.jsx`
- [Support chat](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/components/chat/ChatWidget.jsx): `src/components/chat/ChatWidget.jsx`
- [Breadcrumbs](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/components/common/Breadcrumb.jsx): `src/components/common/Breadcrumb.jsx`
- [Review dialog](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/components/reviews/ReviewModal.jsx): `src/components/reviews/ReviewModal.jsx`
- [Alert state](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/context/AlertContext.jsx): `src/context/AlertContext.jsx`
- [Alert dialog](https://github.com/tonbunheng/tourism-frontend-travel/blob/main/src/components/common/AlertModal.jsx): `src/components/common/AlertModal.jsx`

### Other components

- **Tourist**
- **Business owner**
- **Tourism API**

## Connections

- Tourist → Application routes: opens (evidence: `src/routes/AppRoutes.jsx`)
- Business owner → Application routes: opens (evidence: `src/routes/AppRoutes.jsx`)
- Application routes → Main layout: wraps pages (evidence: `src/routes/AppRoutes.jsx`)
- Application routes → Destination discovery: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Application routes → Place details: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Application routes → Province details: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Application routes → Events: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Application routes → Media gallery: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Application routes → Trip planning: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Application routes → Favorites: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Application routes → Tourist account: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Application routes → Business discovery: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Application routes → Business management: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Application routes → Business analytics: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Main layout → Navigation header: renders (evidence: `src/layouts/Main.jsx`)
- Main layout → Support chat: renders (evidence: `src/layouts/Main.jsx`)
- Destination discovery → Tourism services: loads content (evidence: `src/pages/home/Home.jsx`)
- Destination discovery → Place details: links to
- Media gallery → Tourism services: loads media (evidence: `src/pages/galleries/Galleries.jsx`)
- Place details → Review dialog: opens (evidence: `src/pages/places/PlaceDetails.jsx`)
- Review dialog → Review service: submits review (evidence: `src/components/reviews/ReviewModal.jsx`)
- Business discovery → Business service: loads business (evidence: `src/pages/businesses/BusinessDetails.jsx`)
- Business management → Business service: manages listing (evidence: `src/pages/business/BusinessManage.jsx`)
- Business analytics → Business service: loads metrics
- Tourist account → Authentication state: uses account state (evidence: `src/pages/profiles/Profile.jsx`)
- Travel state → Authentication state: checks identity (evidence: `src/context/TravelContext.jsx`)
- Travel state → Tourism services: loads shared data (evidence: `src/context/TravelContext.jsx`)
- Support chat → Tourism services: uses chat service (evidence: `src/components/chat/ChatWidget.jsx`)
- Tourism services → HTTP clients: uses HTTP client (evidence: `src/services/chatService.js`)
- Business service → HTTP clients: uses HTTP clients (evidence: `src/services/businessService.js`)
- Review service → HTTP clients: uses HTTP client (evidence: `src/services/reviewService.js`)
- HTTP clients → Tourism API: sends requests (evidence: `src/services/api.js`)
- Place details → Breadcrumbs: renders (evidence: `src/pages/places/PlaceDetails.jsx`)
- Business management → Breadcrumbs: renders (evidence: `src/pages/business/BusinessManage.jsx`)
- Alert state → Alert dialog: renders (evidence: `src/context/AlertContext.jsx`)
- Review dialog → Alert state: shows feedback (evidence: `src/components/reviews/ReviewModal.jsx`)
