# raja8807/green_world_trip architecture

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

- Interactive diagram: https://gitdiagram.com/raja8807/green_world_trip
- Repository: https://github.com/raja8807/green_world_trip

## Overview

Green World Trip is a travel-tourism website for discovering destinations and tour packages, viewing tour details, and sending booking or enquiry requests, with an admin area for managing tour content and customer records. The graph highlights the public discovery flow and the evidenced tour-image upload flow. Several screens and admin subsystems are present in the tree, but their implementation was not sampled; their internal relationships are therefore not inferred.

Main entry points: [`src/lib/supabaseClient.js`](https://github.com/raja8807/green_world_trip/blob/main/src/lib/supabaseClient.js) (Supabase client), [`src/utils/r2Upload.js`](https://github.com/raja8807/green_world_trip/blob/main/src/utils/r2Upload.js) (Image upload), [`src/components/screens/admin/tour_form/tour_form.jsx`](https://github.com/raja8807/green_world_trip/blob/main/src/components/screens/admin/tour_form/tour_form.jsx) (Tour editor), [`src/components/screens/home/home.jsx`](https://github.com/raja8807/green_world_trip/blob/main/src/components/screens/home/home.jsx) (Home page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public travel site"]
  node_home["Home page<br/>[home.jsx]"]
  node_home_sections["Home sections"]
  node_tour_search["Tour search<br/>[search.module.jsx]"]
  node_tour_list["Tour listing<br/>[tours.jsx]"]
  node_tour_card["Tour card<br/>[tour_card.jsx]"]
  node_tour_detail["Tour details<br/>[tour_details.jsx]"]
  node_reviews["Tour reviews<br/>[reviews.jsx]"]
  node_booking["Booking request<br/>[booking_modal.jsx]"]
  node_enquiry["Enquiry request<br/>[enquiry_modal.jsx]"]
end

subgraph group_admin["Admin operations"]
  node_admin_login["Admin login"]
  node_auth["Authentication<br/>[AuthContext.js]"]
  node_tour_admin["Tour editor<br/>[tour_form.jsx]"]
  node_tour_admin_list["Tour management<br/>[tours_list.jsx]"]
  node_booking_admin["Booking records<br/>[index.js]"]
  node_enquiry_admin["Enquiry records<br/>[index.js]"]
  node_testimonials_admin["Testimonial management<br/>[index.js]"]
  node_destination_admin["Destination management<br/>[index.js]"]
end

subgraph group_services["Shared services"]
  node_supabase_client["Supabase client<br/>[supabaseClient.js]"]
  node_image_upload["Image upload<br/>[r2Upload.js]"]
  node_image_compress["Image compression<br/>[imageCompressor.js]"]
  node_upload_api["Upload API<br/>[upload.js]"]
  node_image_url["Image URL helper<br/>[image.js]"]
  node_seo["SEO metadata<br/>[seo.jsx]"]
  node_r2_client["R2 client<br/>[r2Client.js]"]
end

node_visitor(("Traveler"))
node_supabase[("Supabase")]
node_r2[("Cloudflare R2")]

node_visitor -.->|"visits"| node_home
node_home -->|"renders"| node_home_sections
node_home_sections -->|"includes"| node_tour_search
node_visitor -.->|"browses"| node_tour_list
node_tour_list -->|"renders"| node_tour_card
node_visitor -.->|"opens tour"| node_tour_detail
node_tour_detail -.->|"renders"| node_reviews
node_visitor -.->|"requests booking"| node_booking
node_visitor -.->|"sends enquiry"| node_enquiry
node_visitor -.->|"opens admin"| node_admin_login
node_admin_login -.->|"uses"| node_auth
node_auth -->|"calls auth"| node_supabase_client
node_supabase_client -.->|"connects"| node_supabase
node_tour_admin -->|"uploads images"| node_image_upload
node_tour_admin_list -.->|"uses"| node_supabase_client
node_booking_admin -.->|"uses"| node_supabase_client
node_enquiry_admin -.->|"uses"| node_supabase_client
node_testimonials_admin -.->|"uses"| node_supabase_client
node_destination_admin -.->|"uses"| node_supabase_client
node_image_upload -->|"compresses"| node_image_compress
node_image_upload -->|"posts files"| node_upload_api
node_upload_api -.->|"uses"| node_r2_client
node_r2_client -.->|"stores objects"| node_r2
node_tour_admin -->|"previews images"| node_image_url
node_seo -->|"formats image URL"| node_image_url

click node_home "https://github.com/raja8807/green_world_trip/blob/main/src/components/screens/home/home.jsx"
click node_home_sections "https://github.com/raja8807/green_world_trip/tree/main/src/components/screens/home/sections"
click node_tour_search "https://github.com/raja8807/green_world_trip/blob/main/src/components/screens/home/sections/banner/search/search.module.jsx"
click node_tour_list "https://github.com/raja8807/green_world_trip/blob/main/src/components/screens/tours/tours.jsx"
click node_tour_card "https://github.com/raja8807/green_world_trip/blob/main/src/components/common/tour_card/tour_card.jsx"
click node_tour_detail "https://github.com/raja8807/green_world_trip/blob/main/src/components/screens/tour_details/tour_details.jsx"
click node_reviews "https://github.com/raja8807/green_world_trip/blob/main/src/components/screens/tour_details/sections/reviews/reviews.jsx"
click node_booking "https://github.com/raja8807/green_world_trip/blob/main/src/components/common/booking_modal/booking_modal.jsx"
click node_enquiry "https://github.com/raja8807/green_world_trip/blob/main/src/components/common/enquiry_modal/enquiry_modal.jsx"
click node_admin_login "https://github.com/raja8807/green_world_trip/blob/main/src/components/screens/admin/admin_login_form/admin_login_form.jsx"
click node_auth "https://github.com/raja8807/green_world_trip/blob/main/src/context/AuthContext.js"
click node_tour_admin "https://github.com/raja8807/green_world_trip/blob/main/src/components/screens/admin/tour_form/tour_form.jsx"
click node_tour_admin_list "https://github.com/raja8807/green_world_trip/blob/main/src/components/screens/admin/tours_list/tours_list.jsx"
click node_booking_admin "https://github.com/raja8807/green_world_trip/blob/main/src/pages/admin/bookings/index.js"
click node_enquiry_admin "https://github.com/raja8807/green_world_trip/blob/main/src/pages/admin/enquiries/index.js"
click node_testimonials_admin "https://github.com/raja8807/green_world_trip/blob/main/src/pages/admin/testimonials/index.js"
click node_destination_admin "https://github.com/raja8807/green_world_trip/blob/main/src/pages/admin/top-destinations/index.js"
click node_supabase_client "https://github.com/raja8807/green_world_trip/blob/main/src/lib/supabaseClient.js"
click node_image_upload "https://github.com/raja8807/green_world_trip/blob/main/src/utils/r2Upload.js"
click node_image_compress "https://github.com/raja8807/green_world_trip/blob/main/src/utils/imageCompressor.js"
click node_upload_api "https://github.com/raja8807/green_world_trip/blob/main/src/pages/api/admin/upload.js"
click node_image_url "https://github.com/raja8807/green_world_trip/blob/main/src/utils/image.js"
click node_seo "https://github.com/raja8807/green_world_trip/blob/main/src/components/common/seo/seo.jsx"
click node_r2_client "https://github.com/raja8807/green_world_trip/blob/main/src/lib/r2Client.js"

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_home,node_home_sections,node_tour_search,node_tour_list,node_tour_card,node_tour_detail,node_reviews,node_booking,node_enquiry toneBlue
class node_admin_login,node_auth,node_tour_admin,node_tour_admin_list,node_booking_admin,node_enquiry_admin,node_testimonials_admin,node_destination_admin,node_supabase,node_r2 toneAmber
class node_supabase_client,node_image_upload,node_image_compress,node_upload_api,node_image_url,node_seo,node_r2_client toneMint
class node_visitor toneIndigo
```

## Components

### Public travel site

- [Home page](https://github.com/raja8807/green_world_trip/blob/main/src/components/screens/home/home.jsx): `src/components/screens/home/home.jsx`
- [Home sections](https://github.com/raja8807/green_world_trip/tree/main/src/components/screens/home/sections): `src/components/screens/home/sections`
- [Tour search](https://github.com/raja8807/green_world_trip/blob/main/src/components/screens/home/sections/banner/search/search.module.jsx): `src/components/screens/home/sections/banner/search/search.module.jsx`
- [Tour listing](https://github.com/raja8807/green_world_trip/blob/main/src/components/screens/tours/tours.jsx): `src/components/screens/tours/tours.jsx`
- [Tour card](https://github.com/raja8807/green_world_trip/blob/main/src/components/common/tour_card/tour_card.jsx): `src/components/common/tour_card/tour_card.jsx`
- [Tour details](https://github.com/raja8807/green_world_trip/blob/main/src/components/screens/tour_details/tour_details.jsx): `src/components/screens/tour_details/tour_details.jsx`
- [Tour reviews](https://github.com/raja8807/green_world_trip/blob/main/src/components/screens/tour_details/sections/reviews/reviews.jsx): `src/components/screens/tour_details/sections/reviews/reviews.jsx`
- [Booking request](https://github.com/raja8807/green_world_trip/blob/main/src/components/common/booking_modal/booking_modal.jsx): `src/components/common/booking_modal/booking_modal.jsx`
- [Enquiry request](https://github.com/raja8807/green_world_trip/blob/main/src/components/common/enquiry_modal/enquiry_modal.jsx): `src/components/common/enquiry_modal/enquiry_modal.jsx`

### Admin operations

- [Admin login](https://github.com/raja8807/green_world_trip/blob/main/src/components/screens/admin/admin_login_form/admin_login_form.jsx): `src/components/screens/admin/admin_login_form/admin_login_form.jsx`
- [Authentication](https://github.com/raja8807/green_world_trip/blob/main/src/context/AuthContext.js): `src/context/AuthContext.js`
- [Tour editor](https://github.com/raja8807/green_world_trip/blob/main/src/components/screens/admin/tour_form/tour_form.jsx): `src/components/screens/admin/tour_form/tour_form.jsx`
- [Tour management](https://github.com/raja8807/green_world_trip/blob/main/src/components/screens/admin/tours_list/tours_list.jsx): `src/components/screens/admin/tours_list/tours_list.jsx`
- [Booking records](https://github.com/raja8807/green_world_trip/blob/main/src/pages/admin/bookings/index.js): `src/pages/admin/bookings/index.js`
- [Enquiry records](https://github.com/raja8807/green_world_trip/blob/main/src/pages/admin/enquiries/index.js): `src/pages/admin/enquiries/index.js`
- [Testimonial management](https://github.com/raja8807/green_world_trip/blob/main/src/pages/admin/testimonials/index.js): `src/pages/admin/testimonials/index.js`
- [Destination management](https://github.com/raja8807/green_world_trip/blob/main/src/pages/admin/top-destinations/index.js): `src/pages/admin/top-destinations/index.js`

### Shared services

- [Supabase client](https://github.com/raja8807/green_world_trip/blob/main/src/lib/supabaseClient.js): `src/lib/supabaseClient.js`
- [Image upload](https://github.com/raja8807/green_world_trip/blob/main/src/utils/r2Upload.js): `src/utils/r2Upload.js`
- [Image compression](https://github.com/raja8807/green_world_trip/blob/main/src/utils/imageCompressor.js): `src/utils/imageCompressor.js`
- [Upload API](https://github.com/raja8807/green_world_trip/blob/main/src/pages/api/admin/upload.js): `src/pages/api/admin/upload.js`
- [Image URL helper](https://github.com/raja8807/green_world_trip/blob/main/src/utils/image.js): `src/utils/image.js`
- [SEO metadata](https://github.com/raja8807/green_world_trip/blob/main/src/components/common/seo/seo.jsx): `src/components/common/seo/seo.jsx`
- [R2 client](https://github.com/raja8807/green_world_trip/blob/main/src/lib/r2Client.js): `src/lib/r2Client.js`

### Other components

- **Traveler**
- **Supabase**
- **Cloudflare R2**

## Connections

- Traveler → Home page: visits
- Home page → Home sections: renders (evidence: `src/components/screens/home/home.jsx`)
- Home sections → Tour search: includes (evidence: `src/components/screens/home/sections/banner/search/search.module.jsx`)
- Traveler → Tour listing: browses
- Tour listing → Tour card: renders (evidence: `src/components/screens/tours/tours.jsx`)
- Traveler → Tour details: opens tour
- Tour details → Tour reviews: renders
- Traveler → Booking request: requests booking
- Traveler → Enquiry request: sends enquiry
- Traveler → Admin login: opens admin
- Admin login → Authentication: uses
- Authentication → Supabase client: calls auth (evidence: `src/context/AuthContext.js`)
- Supabase client → Supabase: connects
- Tour editor → Image upload: uploads images (evidence: `src/components/screens/admin/tour_form/tour_form.jsx`)
- Tour management → Supabase client: uses (evidence: `src/components/screens/admin/tours_list/tours_list.jsx`)
- Booking records → Supabase client: uses (evidence: `src/pages/admin/bookings/index.js`)
- Enquiry records → Supabase client: uses (evidence: `src/pages/admin/enquiries/index.js`)
- Testimonial management → Supabase client: uses (evidence: `src/pages/admin/testimonials/index.js`)
- Destination management → Supabase client: uses (evidence: `src/pages/admin/top-destinations/index.js`)
- Image upload → Image compression: compresses (evidence: `src/utils/r2Upload.js`)
- Image upload → Upload API: posts files (evidence: `src/utils/r2Upload.js`)
- Upload API → R2 client: uses (evidence: `src/pages/api/admin/upload.js`)
- R2 client → Cloudflare R2: stores objects
- Tour editor → Image URL helper: previews images (evidence: `src/components/screens/admin/tour_form/tour_form.jsx`)
- SEO metadata → Image URL helper: formats image URL (evidence: `src/components/common/seo/seo.jsx`)
