# mazenessam99/liwan-saudi-group architecture

> Architecture diagram of the GitHub repository mazenessam99/liwan-saudi-group, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mazenessam99/liwan-saudi-group
- Repository: https://github.com/mazenessam99/liwan-saudi-group

## Overview

Liwan Saudi Group is an Arabic-first hospitality discovery frontend covering accommodations, restaurants, destinations, events, offers, and related travel content. A visitor enters through the routed React app, browses listings and detail pages, and can use favorites or account screens. The README describes local mock data, while sampled property, restaurant, and authentication code also uses Supabase; the diagram reflects only those observed integrations. Several capabilities are documented but their implementation was not sampled, so their internal links are omitted.

Main entry points: [`src/routes/routes.tsx`](https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/routes/routes.tsx) (Route Table), [`src/lib/supabase.ts`](https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/lib/supabase.ts) (Supabase Client), [`src/features/auth/pages`](https://github.com/mazenessam99/liwan-saudi-group/tree/main/src/features/auth/pages) (Login & Register), [`src/services/propertyService.ts`](https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/services/propertyService.ts) (Property Queries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Shell"]
  node_application["React App<br/>[App.tsx]"]
  node_router["Route Table<br/>[routes.tsx]"]
  node_layout["Main Layout<br/>[MainLayout.tsx]"]
end

subgraph group_stay["Accommodation Discovery"]
  node_accommodation_pages["Hotel &amp; Resort Pages"]
  node_property_details["Property Details"]
end

subgraph group_travel["Travel Experiences"]
  node_restaurant_pages["Restaurant Pages"]
  node_destination_pages["Destinations<br/>[Destinations.tsx]"]
  node_offer_pages["Offers &amp; Events"]
  node_other_pages["Travel &amp; Info Pages"]
end

subgraph group_identity["User Accounts"]
  node_auth_pages["Login &amp; Register"]
  node_auth_schema["Auth Validation<br/>[auth-schema.ts]"]
  node_auth_service["Auth Operations<br/>[auth.service.ts]"]
  node_auth_errors["Auth Error Text<br/>[auth-errors.ts]"]
end

subgraph group_data["Data Access"]
  node_property_service["Property Queries<br/>[propertyService.ts]"]
  node_property_types["Property Models<br/>[hotels.ts]"]
  node_room_types["Room Models<br/>[rooms.ts]"]
  node_restaurant_api["Restaurant Queries<br/>[restaurants.ts]"]
  node_attraction_service["Attraction Queries"]
  node_supabase["Supabase Client<br/>[supabase.ts]"]
  node_database[("Supabase Data")]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_application
node_application -->|"mounts routes"| node_router
node_router -->|"wraps pages"| node_layout
node_router -->|"routes to"| node_accommodation_pages
node_router -->|"routes to"| node_property_details
node_router -->|"routes to"| node_restaurant_pages
node_router -->|"routes to"| node_destination_pages
node_router -->|"routes to"| node_offer_pages
node_router -->|"routes to"| node_other_pages
node_router -->|"routes to"| node_auth_pages
node_property_details -->|"loads property"| node_property_service
node_property_service -->|"queries"| node_supabase
node_property_service -->|"maps records"| node_property_types
node_property_service -->|"maps rooms"| node_room_types
node_restaurant_pages -->|"loads listings"| node_restaurant_api
node_restaurant_api -->|"uses client"| node_supabase
node_destination_pages -->|"loads attractions"| node_attraction_service
node_attraction_service -->|"uses client"| node_supabase
node_auth_pages -->|"validates forms"| node_auth_schema
node_auth_pages -->|"submits credentials"| node_auth_service
node_auth_pages -->|"formats errors"| node_auth_errors
node_auth_service -->|"calls auth"| node_supabase
node_supabase -.->|"accesses"| node_database

click node_application "https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/App.tsx"
click node_router "https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/routes/routes.tsx"
click node_layout "https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/layouts/MainLayout.tsx"
click node_accommodation_pages "https://github.com/mazenessam99/liwan-saudi-group/tree/main/src/pages"
click node_property_details "https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/pages/PropertyDetails.tsx"
click node_property_service "https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/services/propertyService.ts"
click node_property_types "https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/types/hotels.ts"
click node_room_types "https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/types/rooms.ts"
click node_restaurant_pages "https://github.com/mazenessam99/liwan-saudi-group/tree/main/src/pages"
click node_restaurant_api "https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/lib/api/restaurants.ts"
click node_destination_pages "https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/pages/Destinations.tsx"
click node_attraction_service "https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/services/attractionService.ts"
click node_offer_pages "https://github.com/mazenessam99/liwan-saudi-group/tree/main/src/pages"
click node_other_pages "https://github.com/mazenessam99/liwan-saudi-group/tree/main/src/pages"
click node_auth_pages "https://github.com/mazenessam99/liwan-saudi-group/tree/main/src/features/auth/pages"
click node_auth_schema "https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/features/auth/schemas/auth-schema.ts"
click node_auth_service "https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/features/auth/services/auth.service.ts"
click node_auth_errors "https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/features/auth/utils/auth-errors.ts"
click node_supabase "https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/lib/supabase.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_application,node_router,node_layout toneBlue
class node_accommodation_pages,node_property_details toneAmber
class node_restaurant_pages,node_destination_pages,node_offer_pages,node_other_pages toneMint
class node_auth_pages,node_auth_schema,node_auth_service,node_auth_errors toneRose
class node_property_service,node_property_types,node_room_types,node_restaurant_api,node_attraction_service,node_supabase,node_database,node_visitor toneIndigo
```

## Components

### Application Shell

- [React App](https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/App.tsx): `src/App.tsx`
- [Route Table](https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/routes/routes.tsx): `src/routes/routes.tsx`
- [Main Layout](https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/layouts/MainLayout.tsx): `src/layouts/MainLayout.tsx`

### Accommodation Discovery

- [Hotel & Resort Pages](https://github.com/mazenessam99/liwan-saudi-group/tree/main/src/pages): `src/pages`
- [Property Details](https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/pages/PropertyDetails.tsx): `src/pages/PropertyDetails.tsx`

### Travel Experiences

- [Restaurant Pages](https://github.com/mazenessam99/liwan-saudi-group/tree/main/src/pages): `src/pages`
- [Destinations](https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/pages/Destinations.tsx): `src/pages/Destinations.tsx`
- [Offers & Events](https://github.com/mazenessam99/liwan-saudi-group/tree/main/src/pages): `src/pages`
- [Travel & Info Pages](https://github.com/mazenessam99/liwan-saudi-group/tree/main/src/pages): `src/pages`

### User Accounts

- [Login & Register](https://github.com/mazenessam99/liwan-saudi-group/tree/main/src/features/auth/pages): `src/features/auth/pages`
- [Auth Validation](https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/features/auth/schemas/auth-schema.ts): `src/features/auth/schemas/auth-schema.ts`
- [Auth Operations](https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/features/auth/services/auth.service.ts): `src/features/auth/services/auth.service.ts`
- [Auth Error Text](https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/features/auth/utils/auth-errors.ts): `src/features/auth/utils/auth-errors.ts`

### Data Access

- [Property Queries](https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/services/propertyService.ts): `src/services/propertyService.ts`
- [Property Models](https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/types/hotels.ts): `src/types/hotels.ts`
- [Room Models](https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/types/rooms.ts): `src/types/rooms.ts`
- [Restaurant Queries](https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/lib/api/restaurants.ts): `src/lib/api/restaurants.ts`
- [Attraction Queries](https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/services/attractionService.ts): `src/services/attractionService.ts`
- [Supabase Client](https://github.com/mazenessam99/liwan-saudi-group/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Supabase Data**

### Other components

- **Visitor**

## Connections

- Visitor → React App: opens
- React App → Route Table: mounts routes (evidence: `src/App.tsx`)
- Route Table → Main Layout: wraps pages (evidence: `src/routes/routes.tsx`)
- Route Table → Hotel & Resort Pages: routes to (evidence: `src/routes/routes.tsx`)
- Route Table → Property Details: routes to (evidence: `src/routes/routes.tsx`)
- Route Table → Restaurant Pages: routes to (evidence: `src/routes/routes.tsx`)
- Route Table → Destinations: routes to (evidence: `src/routes/routes.tsx`)
- Route Table → Offers & Events: routes to (evidence: `src/routes/routes.tsx`)
- Route Table → Travel & Info Pages: routes to (evidence: `src/routes/routes.tsx`)
- Route Table → Login & Register: routes to (evidence: `src/routes/routes.tsx`)
- Property Details → Property Queries: loads property (evidence: `src/pages/PropertyDetails.tsx`)
- Property Queries → Supabase Client: queries (evidence: `src/services/propertyService.ts`)
- Property Queries → Property Models: maps records (evidence: `src/services/propertyService.ts`)
- Property Queries → Room Models: maps rooms (evidence: `src/services/propertyService.ts`)
- Restaurant Pages → Restaurant Queries: loads listings (evidence: `src/pages/Restaurants.tsx`)
- Restaurant Queries → Supabase Client: uses client (evidence: `src/lib/api/restaurants.ts`)
- Destinations → Attraction Queries: loads attractions (evidence: `src/pages/Destinations.tsx`)
- Attraction Queries → Supabase Client: uses client (evidence: `src/services/attractionService.ts`)
- Login & Register → Auth Validation: validates forms (evidence: `src/features/auth/pages/Login.tsx`)
- Login & Register → Auth Operations: submits credentials (evidence: `src/features/auth/pages/Login.tsx`)
- Login & Register → Auth Error Text: formats errors (evidence: `src/features/auth/pages/Login.tsx`)
- Auth Operations → Supabase Client: calls auth (evidence: `src/features/auth/services/auth.service.ts`)
- Supabase Client → Supabase Data: accesses
