# thiha129/frontend_booking_tour_dulich architecture

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

- Interactive diagram: https://gitdiagram.com/thiha129/frontend_booking_tour_dulich
- Repository: https://github.com/thiha129/frontend_booking_tour_dulich

## Overview

This is the React frontend of a MERN tour-booking product. Travelers browse and search tours, inspect details, and proceed through a protected booking checkout; accounts, reviews, and wishlists support that journey. A separate admin workflow manages tours, users, and bookings. The graph shows the frontend’s documented API boundary, local wishlist persistence, and key shared services. Backend internals are not present in this tree, and several page implementations are unsampled, so uncertain links are omitted rather than inferred.

Main entry points: [`src/router/Routers.jsx`](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/router/Routers.jsx) (Page routing), [`src/pages/AdminPage.jsx`](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/pages/AdminPage.jsx) (Admin console), [`src/pages/SearchResultList.jsx`](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/pages/SearchResultList.jsx) (Search results), [`src/context/WishlistContext.js`](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/context/WishlistContext.js) (Wishlist state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Tour discovery"]
  node_tours["Tour catalogue<br/>[Tours.jsx]"]
  node_searchbar["Tour search<br/>[SearchBar.jsx]"]
  node_searchresults["Search results"]
  node_tourdetail["Tour details<br/>[TourDetails.jsx]"]
  node_tourcard["Tour card<br/>[TourCard.jsx]"]
end

subgraph group_booking["Booking journey"]
  node_bookingform["Booking form<br/>[Booking.jsx]"]
  node_checkout["Booking checkout"]
  node_price["Booking pricing<br/>[bookingPrice.js]"]
end

subgraph group_account["Accounts and admin"]
  node_auth["Session state<br/>[AuthContext.js]"]
  node_wishlist["Wishlist state<br/>[WishlistContext.js]"]
  node_localstore[("Browser storage")]
  node_profile["User profile<br/>[ProfilePage.jsx]"]
  node_admin["Admin console<br/>[AdminPage.jsx]"]
  node_tourform["Tour editor<br/>[TourFormModal.jsx]"]
  node_userform["User editor<br/>[UserFormModal.jsx]"]
  node_upload["Image upload<br/>[uploadImage.js]"]
end

subgraph group_platform["Shared frontend"]
  node_app["Application shell<br/>[App.js]"]
  node_routes["Page routing<br/>[Routers.jsx]"]
  node_language["Language service"]
end

node_traveler(("Traveler"))
node_api["Backend API"]

node_traveler -->|"uses"| node_app
node_app -->|"renders"| node_routes
node_routes -->|"routes to"| node_tours
node_routes -->|"routes to"| node_tourdetail
node_routes -->|"routes to"| node_searchresults
node_routes -->|"protects route"| node_checkout
node_routes -->|"protects route"| node_profile
node_routes -->|"guards route"| node_admin
node_searchbar -->|"requests matches"| node_api
node_searchbar -->|"navigates with results"| node_searchresults
node_searchresults -->|"fetches matches"| node_api
node_tours -->|"renders"| node_tourcard
node_searchresults -->|"renders"| node_tourcard
node_tourdetail -->|"renders"| node_bookingform
node_bookingform -->|"calculates with"| node_price
node_bookingform -.->|"submits booking"| node_api
node_checkout -->|"calculates with"| node_price
node_auth -->|"checks session"| node_api
node_wishlist -->|"reads session"| node_auth
node_wishlist -->|"syncs wishlist"| node_api
node_wishlist -->|"persists locally"| node_localstore
node_profile -->|"loads profile"| node_api
node_admin -->|"manages records"| node_api
node_admin -->|"opens editor"| node_tourform
node_admin -->|"manages users"| node_userform
node_tourform -->|"uploads images"| node_upload
node_tourform -.->|"saves tour"| node_api
node_userform -.->|"saves user"| node_api
node_tours -->|"translates labels"| node_language
node_admin -->|"translates labels"| node_language

click node_app "https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/App.js"
click node_routes "https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/router/Routers.jsx"
click node_tours "https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/pages/Tours.jsx"
click node_searchbar "https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/shared/SearchBar.jsx"
click node_searchresults "https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/pages/SearchResultList.jsx"
click node_tourdetail "https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/pages/TourDetails.jsx"
click node_tourcard "https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/shared/TourCard.jsx"
click node_bookingform "https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/components/Booking/Booking.jsx"
click node_checkout "https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/pages/BookingCheckout.jsx"
click node_price "https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/utils/bookingPrice.js"
click node_auth "https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/context/AuthContext.js"
click node_wishlist "https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/context/WishlistContext.js"
click node_profile "https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/pages/ProfilePage.jsx"
click node_admin "https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/pages/AdminPage.jsx"
click node_tourform "https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/components/admin/TourFormModal.jsx"
click node_userform "https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/components/admin/UserFormModal.jsx"
click node_upload "https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/utils/uploadImage.js"
click node_language "https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/i18n/LanguageContext.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_tours,node_searchbar,node_searchresults,node_tourdetail,node_tourcard toneBlue
class node_bookingform,node_checkout,node_price toneAmber
class node_auth,node_wishlist,node_localstore,node_profile,node_admin,node_tourform,node_userform,node_upload,node_api toneMint
class node_app,node_routes,node_language toneRose
class node_traveler toneIndigo
```

## Components

### Tour discovery

- [Tour catalogue](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/pages/Tours.jsx): `src/pages/Tours.jsx`
- [Tour search](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/shared/SearchBar.jsx): `src/shared/SearchBar.jsx`
- [Search results](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/pages/SearchResultList.jsx): `src/pages/SearchResultList.jsx`
- [Tour details](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/pages/TourDetails.jsx): `src/pages/TourDetails.jsx`
- [Tour card](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/shared/TourCard.jsx): `src/shared/TourCard.jsx`

### Booking journey

- [Booking form](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/components/Booking/Booking.jsx): `src/components/Booking/Booking.jsx`
- [Booking checkout](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/pages/BookingCheckout.jsx): `src/pages/BookingCheckout.jsx`
- [Booking pricing](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/utils/bookingPrice.js): `src/utils/bookingPrice.js`

### Accounts and admin

- [Session state](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/context/AuthContext.js): `src/context/AuthContext.js`
- [Wishlist state](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/context/WishlistContext.js): `src/context/WishlistContext.js`
- **Browser storage**
- [User profile](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/pages/ProfilePage.jsx): `src/pages/ProfilePage.jsx`
- [Admin console](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/pages/AdminPage.jsx): `src/pages/AdminPage.jsx`
- [Tour editor](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/components/admin/TourFormModal.jsx): `src/components/admin/TourFormModal.jsx`
- [User editor](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/components/admin/UserFormModal.jsx): `src/components/admin/UserFormModal.jsx`
- [Image upload](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/utils/uploadImage.js): `src/utils/uploadImage.js`

### Shared frontend

- [Application shell](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/App.js): `src/App.js`
- [Page routing](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/router/Routers.jsx): `src/router/Routers.jsx`
- [Language service](https://github.com/thiha129/frontend_booking_tour_dulich/blob/main/src/i18n/LanguageContext.jsx): `src/i18n/LanguageContext.jsx`

### Other components

- **Traveler**
- **Backend API**

## Connections

- Traveler → Application shell: uses (evidence: `README.md`)
- Application shell → Page routing: renders (evidence: `src/App.js`)
- Page routing → Tour catalogue: routes to (evidence: `src/router/Routers.jsx`)
- Page routing → Tour details: routes to (evidence: `src/router/Routers.jsx`)
- Page routing → Search results: routes to (evidence: `src/router/Routers.jsx`)
- Page routing → Booking checkout: protects route (evidence: `src/router/Routers.jsx`)
- Page routing → User profile: protects route (evidence: `src/router/Routers.jsx`)
- Page routing → Admin console: guards route (evidence: `src/router/Routers.jsx`)
- Tour search → Backend API: requests matches (evidence: `src/shared/SearchBar.jsx`)
- Tour search → Search results: navigates with results (evidence: `src/shared/SearchBar.jsx`)
- Search results → Backend API: fetches matches (evidence: `src/pages/SearchResultList.jsx`)
- Tour catalogue → Tour card: renders (evidence: `src/pages/Tours.jsx`)
- Search results → Tour card: renders (evidence: `src/pages/SearchResultList.jsx`)
- Tour details → Booking form: renders (evidence: `src/pages/TourDetails.jsx`)
- Booking form → Booking pricing: calculates with (evidence: `src/components/Booking/Booking.jsx`)
- Booking form → Backend API: submits booking (evidence: `README.md`)
- Booking checkout → Booking pricing: calculates with (evidence: `src/pages/BookingCheckout.jsx`)
- Session state → Backend API: checks session (evidence: `src/context/AuthContext.js`)
- Wishlist state → Session state: reads session (evidence: `src/context/WishlistContext.js`)
- Wishlist state → Backend API: syncs wishlist (evidence: `src/context/WishlistContext.js`)
- Wishlist state → Browser storage: persists locally (evidence: `src/context/WishlistContext.js`)
- User profile → Backend API: loads profile (evidence: `src/pages/ProfilePage.jsx`)
- Admin console → Backend API: manages records (evidence: `src/pages/AdminPage.jsx`)
- Admin console → Tour editor: opens editor (evidence: `src/pages/AdminPage.jsx`)
- Admin console → User editor: manages users (evidence: `src/pages/AdminPage.jsx`)
- Tour editor → Image upload: uploads images (evidence: `src/components/admin/TourFormModal.jsx`)
- Tour editor → Backend API: saves tour
- User editor → Backend API: saves user
- Tour catalogue → Language service: translates labels (evidence: `src/pages/Tours.jsx`)
- Admin console → Language service: translates labels (evidence: `src/pages/AdminPage.jsx`)
