# kasemfatani/mzarapp architecture

> Architecture diagram of the GitHub repository kasemfatani/mzarapp, 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/kasemfatani/mzarapp
- Repository: https://github.com/kasemfatani/mzarapp

## Overview

Mzar is a Saudi tourism and travel-booking platform: visitors discover tours, Umrah packages, transport and editorial content, then use booking flows that can include payment and confirmation. The tree also shows separate hotel-partner, National Day and Diyafah Athar experiences. This map emphasizes those product areas and the API behavior visible in excerpts. Several page and booking components are unsampled, so their internal wiring is not inferred; dashed links mark optional or unverified integrations.

Main entry points: [`src/app/api/national-day/payment-session/route.js`](https://github.com/kasemfatani/mzarapp/blob/main/src/app/api/national-day/payment-session/route.js) (National Day booking), [`src/app/api/national-day/clickpay/init/route.js`](https://github.com/kasemfatani/mzarapp/blob/main/src/app/api/national-day/clickpay/init/route.js) (National Day payment), [`src/app/llms.txt/route.ts`](https://github.com/kasemfatani/mzarapp/blob/main/src/app/llms.txt/route.ts) (Live site map), [`src/app/api/national-day/finalize/route.js`](https://github.com/kasemfatani/mzarapp/blob/main/src/app/api/national-day/finalize/route.js) (Payment finalization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Discovery and content"]
  node_tour_catalog["Tour catalog<br/>[page.jsx]"]
  node_tour_detail["Tour details<br/>[page.jsx]"]
  node_umrah_catalog["Umrah packages<br/>[page.jsx]"]
  node_transport["Transportation<br/>[page.jsx]"]
  node_editorial["Articles<br/>[page.jsx]"]
  node_site_map["Live site map<br/>[route.ts]"]
end

subgraph group_booking["Bookings and payments"]
  node_booking_pages["Booking pages<br/>[page.jsx]"]
  node_payment_routes["Payment routes<br/>[route.js]"]
end

subgraph group_campaigns["Campaign experiences"]
  node_national_booking["National Day booking<br/>[route.js]"]
  node_national_init["National Day payment<br/>[route.js]"]
  node_national_finalize["Payment finalization<br/>[route.js]"]
  node_diyafah["Diyafah participation<br/>[route.js]"]
  node_hotel_shell["Hotel partner experience"]
  node_hotel_hero["Hotel offer hero<br/>[Hero.jsx]"]
  node_hotel_sections["Hotel content sections"]
end

subgraph group_platform["Platform services"]
  node_contact_api["Contact submission<br/>[route.ts]"]
  node_revalidation["Blog revalidation<br/>[route.ts]"]
  node_blog_cache["Blog cache tags<br/>[blogCache.js]"]
end

node_visitor(("Visitor"))
node_travel_backend["Mzar API"]
node_blog_service["Blog service"]
node_clickpay["ClickPay"]
node_captcha["Google reCAPTCHA"]
node_laravel(("Publishing backend"))

node_visitor -.->|"browses"| node_tour_catalog
node_visitor -.->|"books through"| node_booking_pages
node_visitor -.->|"submits details"| node_national_booking
node_national_booking -->|"checks availability"| node_travel_backend
node_national_booking -->|"saves customer"| node_travel_backend
node_national_booking -.->|"returns signed session"| node_national_init
node_national_init -->|"creates payment"| node_clickpay
node_national_init -->|"sets callback URL"| node_payment_routes
node_national_finalize -->|"queries payment"| node_payment_routes
node_national_finalize -->|"confirms booking"| node_travel_backend
node_diyafah -->|"forwards participation"| node_travel_backend
node_hotel_shell -->|"renders"| node_hotel_hero
node_hotel_shell -->|"renders"| node_hotel_sections
node_hotel_hero -.->|"requests loading"| node_hotel_sections
node_contact_api -->|"verifies token"| node_captcha
node_contact_api -->|"forwards inquiry"| node_travel_backend
node_revalidation -->|"invalidates tags"| node_blog_cache
node_laravel -->|"requests refresh"| node_revalidation
node_site_map -->|"fetches packages"| node_travel_backend
node_site_map -->|"fetches articles"| node_blog_service

click node_tour_catalog "https://github.com/kasemfatani/mzarapp/blob/main/src/app/all-trips/page.jsx"
click node_tour_detail "https://github.com/kasemfatani/mzarapp/blob/main/src/app/trip-detail/%5Bid%5D/page.jsx"
click node_umrah_catalog "https://github.com/kasemfatani/mzarapp/blob/main/src/app/umrah-packages/page.jsx"
click node_transport "https://github.com/kasemfatani/mzarapp/blob/main/src/app/transportation/page.jsx"
click node_editorial "https://github.com/kasemfatani/mzarapp/blob/main/src/app/blog/%5Bslug%5D/page.jsx"
click node_site_map "https://github.com/kasemfatani/mzarapp/blob/main/src/app/llms.txt/route.ts"
click node_booking_pages "https://github.com/kasemfatani/mzarapp/blob/main/src/app/book-path/%5Bid%5D/page.jsx"
click node_payment_routes "https://github.com/kasemfatani/mzarapp/blob/main/src/app/api/pay/clickpay/init/route.js"
click node_national_booking "https://github.com/kasemfatani/mzarapp/blob/main/src/app/api/national-day/payment-session/route.js"
click node_national_init "https://github.com/kasemfatani/mzarapp/blob/main/src/app/api/national-day/clickpay/init/route.js"
click node_national_finalize "https://github.com/kasemfatani/mzarapp/blob/main/src/app/api/national-day/finalize/route.js"
click node_diyafah "https://github.com/kasemfatani/mzarapp/blob/main/src/app/api/diyafah-athar/participation/route.js"
click node_hotel_shell "https://github.com/kasemfatani/mzarapp/blob/main/src/components/hotel/HotelClientShell.jsx"
click node_hotel_hero "https://github.com/kasemfatani/mzarapp/blob/main/src/components/hotel/Hero.jsx"
click node_hotel_sections "https://github.com/kasemfatani/mzarapp/blob/main/src/components/hotel/LazyBottomSections.jsx"
click node_contact_api "https://github.com/kasemfatani/mzarapp/blob/main/src/app/api/contact-submit/route.ts"
click node_revalidation "https://github.com/kasemfatani/mzarapp/blob/main/src/app/api/revalidate/route.ts"
click node_blog_cache "https://github.com/kasemfatani/mzarapp/blob/main/src/lib/blogCache.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_tour_catalog,node_tour_detail,node_umrah_catalog,node_transport,node_editorial,node_site_map toneBlue
class node_booking_pages,node_payment_routes toneAmber
class node_national_booking,node_national_init,node_national_finalize,node_diyafah,node_hotel_shell,node_hotel_hero,node_hotel_sections,node_travel_backend toneMint
class node_contact_api,node_revalidation,node_blog_cache toneRose
class node_visitor,node_blog_service,node_clickpay,node_captcha,node_laravel toneIndigo
```

## Components

### Discovery and content

- [Tour catalog](https://github.com/kasemfatani/mzarapp/blob/main/src/app/all-trips/page.jsx): `src/app/all-trips/page.jsx`
- [Tour details](https://github.com/kasemfatani/mzarapp/blob/main/src/app/trip-detail/%5Bid%5D/page.jsx): `src/app/trip-detail/[id]/page.jsx`
- [Umrah packages](https://github.com/kasemfatani/mzarapp/blob/main/src/app/umrah-packages/page.jsx): `src/app/umrah-packages/page.jsx`
- [Transportation](https://github.com/kasemfatani/mzarapp/blob/main/src/app/transportation/page.jsx): `src/app/transportation/page.jsx`
- [Articles](https://github.com/kasemfatani/mzarapp/blob/main/src/app/blog/%5Bslug%5D/page.jsx): `src/app/blog/[slug]/page.jsx`
- [Live site map](https://github.com/kasemfatani/mzarapp/blob/main/src/app/llms.txt/route.ts): `src/app/llms.txt/route.ts`

### Bookings and payments

- [Booking pages](https://github.com/kasemfatani/mzarapp/blob/main/src/app/book-path/%5Bid%5D/page.jsx): `src/app/book-path/[id]/page.jsx`
- [Payment routes](https://github.com/kasemfatani/mzarapp/blob/main/src/app/api/pay/clickpay/init/route.js): `src/app/api/pay/clickpay/init/route.js`

### Campaign experiences

- [National Day booking](https://github.com/kasemfatani/mzarapp/blob/main/src/app/api/national-day/payment-session/route.js): `src/app/api/national-day/payment-session/route.js`
- [National Day payment](https://github.com/kasemfatani/mzarapp/blob/main/src/app/api/national-day/clickpay/init/route.js): `src/app/api/national-day/clickpay/init/route.js`
- [Payment finalization](https://github.com/kasemfatani/mzarapp/blob/main/src/app/api/national-day/finalize/route.js): `src/app/api/national-day/finalize/route.js`
- [Diyafah participation](https://github.com/kasemfatani/mzarapp/blob/main/src/app/api/diyafah-athar/participation/route.js): `src/app/api/diyafah-athar/participation/route.js`
- [Hotel partner experience](https://github.com/kasemfatani/mzarapp/blob/main/src/components/hotel/HotelClientShell.jsx): `src/components/hotel/HotelClientShell.jsx`
- [Hotel offer hero](https://github.com/kasemfatani/mzarapp/blob/main/src/components/hotel/Hero.jsx): `src/components/hotel/Hero.jsx`
- [Hotel content sections](https://github.com/kasemfatani/mzarapp/blob/main/src/components/hotel/LazyBottomSections.jsx): `src/components/hotel/LazyBottomSections.jsx`

### Platform services

- [Contact submission](https://github.com/kasemfatani/mzarapp/blob/main/src/app/api/contact-submit/route.ts): `src/app/api/contact-submit/route.ts`
- [Blog revalidation](https://github.com/kasemfatani/mzarapp/blob/main/src/app/api/revalidate/route.ts): `src/app/api/revalidate/route.ts`
- [Blog cache tags](https://github.com/kasemfatani/mzarapp/blob/main/src/lib/blogCache.js): `src/lib/blogCache.js`

### Other components

- **Visitor**
- **Mzar API**
- **Blog service**
- **ClickPay**
- **Google reCAPTCHA**
- **Publishing backend**

## Connections

- Visitor → Tour catalog: browses
- Visitor → Booking pages: books through
- Visitor → National Day booking: submits details
- National Day booking → Mzar API: checks availability (evidence: `src/app/api/national-day/payment-session/route.js`)
- National Day booking → Mzar API: saves customer (evidence: `src/app/api/national-day/payment-session/route.js`)
- National Day booking → National Day payment: returns signed session
- National Day payment → ClickPay: creates payment (evidence: `src/app/api/national-day/clickpay/init/route.js`)
- National Day payment → Payment routes: sets callback URL (evidence: `src/app/api/national-day/clickpay/init/route.js`)
- Payment finalization → Payment routes: queries payment (evidence: `src/app/api/national-day/finalize/route.js`)
- Payment finalization → Mzar API: confirms booking (evidence: `src/app/api/national-day/finalize/route.js`)
- Diyafah participation → Mzar API: forwards participation (evidence: `src/app/api/diyafah-athar/participation/route.js`)
- Hotel partner experience → Hotel offer hero: renders (evidence: `src/components/hotel/HotelClientShell.jsx`)
- Hotel partner experience → Hotel content sections: renders (evidence: `src/components/hotel/HotelClientShell.jsx`)
- Hotel offer hero → Hotel content sections: requests loading
- Contact submission → Google reCAPTCHA: verifies token (evidence: `src/app/api/contact-submit/route.ts`)
- Contact submission → Mzar API: forwards inquiry (evidence: `src/app/api/contact-submit/route.ts`)
- Blog revalidation → Blog cache tags: invalidates tags (evidence: `src/app/api/revalidate/route.ts`)
- Publishing backend → Blog revalidation: requests refresh (evidence: `src/app/api/revalidate/route.ts`)
- Live site map → Mzar API: fetches packages (evidence: `src/app/llms.txt/route.ts`)
- Live site map → Blog service: fetches articles (evidence: `src/app/llms.txt/route.ts`)
