# abdulrhman-hosseini/project-stayease architecture

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

- Interactive diagram: https://gitdiagram.com/abdulrhman-hosseini/project-stayease
- Repository: https://github.com/abdulrhman-hosseini/project-stayease

## Overview

StayEase is a PHP lodging marketplace. A visitor discovers and filters properties, views details, then—after signing in—books a stay, receives a confirmation, and can manage bookings or review completed stays. Accounts also support password recovery and saved favorites; administrators manage users, properties, bookings, and reviews and view dashboard metrics. Pages use a shared MySQL connection, with authentication checks on protected actions. The graph preserves README-described capabilities even where their implementation was not sampled; those links cite the README rather than implying source inspection.

Main entry points: [`config/database.php`](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/config/database.php) (Database connection), [`includes/auth_guard.php`](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/includes/auth_guard.php) (Access guard), [`properties/index.php`](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/properties/index.php) (Property listing), [`booking/book.php`](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/booking/book.php) (Create booking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Property discovery"]
  node_home["Home and featured stays<br/>[index.php]"]
  node_about["About<br/>[about.php]"]
  node_listing["Property listing<br/>[index.php]"]
  node_search["Search and availability<br/>[search.php]"]
  node_details["Property details<br/>[details.php]"]
end

subgraph group_account["Accounts and saved stays"]
  node_auth["Login and registration<br/>[login.php]"]
  node_registration["Registration validation<br/>[validate.php]"]
  node_profile["Profile and account<br/>[profile.php]"]
  node_recovery["Password recovery"]
  node_favorites["Saved favorites<br/>[index.php]"]
  node_favorite_action["Favorite toggle<br/>[toggle.php]"]
end

subgraph group_stay["Booking and reviews"]
  node_booking["Create booking<br/>[book.php]"]
  node_confirmation["Booking confirmation<br/>[confirmation.php]"]
  node_my_bookings["My bookings<br/>[my-bookings.php]"]
  node_cancel["Cancel booking<br/>[cancel.php]"]
  node_reviews["Add and delete reviews<br/>[add.php]"]
end

subgraph group_operations["Administration and shared runtime"]
  node_admin_dashboard["Admin dashboard<br/>[dashboard.php]"]
  node_admin_properties["Manage properties<br/>[properties.php]"]
  node_admin_bookings["Manage bookings<br/>[bookings.php]"]
  node_admin_users["Manage users<br/>[users.php]"]
  node_admin_reviews["Manage reviews<br/>[reviews.php]"]
  node_sidebar["Admin navigation<br/>[admin_sidebar.php]"]
  node_auth_guard["Access guard<br/>[auth_guard.php]"]
  node_navigation["Shared navigation<br/>[navbar.php]"]
  node_footer["Shared footer<br/>[footer.php]"]
  node_connection["Database connection<br/>[database.php]"]
end

node_guest(("Visitor"))
node_database[("StayEase database")]
node_mail["Email service"]

node_guest -->|"opens"| node_home
node_home -->|"queries"| node_connection
node_home -->|"links to"| node_listing
node_home -->|"links to"| node_about
node_guest -->|"browses"| node_listing
node_listing -->|"queries"| node_connection
node_listing -->|"links to"| node_search
node_listing -->|"links to"| node_details
node_guest -->|"filters"| node_search
node_search -->|"queries"| node_connection
node_guest -->|"views"| node_details
node_details -->|"queries"| node_connection
node_guest -->|"signs in"| node_auth
node_auth -->|"validates with"| node_registration
node_auth -->|"recovers account"| node_recovery
node_auth -->|"opens account"| node_profile
node_profile -->|"queries"| node_connection
node_guest -->|"views saved stays"| node_favorites
node_favorites -->|"queries"| node_connection
node_listing -->|"submits toggle"| node_favorite_action
node_favorite_action -->|"updates"| node_connection
node_guest -->|"requests stay"| node_booking
node_booking -->|"requires login"| node_auth_guard
node_booking -->|"checks and creates"| node_connection
node_booking -->|"redirects to"| node_confirmation
node_booking -->|"sends confirmation"| node_mail
node_guest -->|"views bookings"| node_my_bookings
node_my_bookings -->|"queries"| node_connection
node_my_bookings -.->|"offers cancellation"| node_cancel
node_guest -->|"reviews completed stay"| node_reviews
node_reviews -->|"writes review"| node_connection
node_guest -.->|"administers"| node_admin_dashboard
node_admin_dashboard -->|"queries metrics"| node_connection
node_admin_properties -->|"manages records"| node_connection
node_admin_bookings -->|"manages records"| node_connection
node_admin_users -->|"manages records"| node_connection
node_admin_reviews -->|"queries reviews"| node_connection
node_admin_dashboard -->|"renders"| node_sidebar
node_admin_properties -->|"renders"| node_sidebar
node_admin_bookings -->|"renders"| node_sidebar
node_admin_users -->|"renders"| node_sidebar
node_admin_reviews -->|"renders"| node_sidebar
node_admin_dashboard -->|"checks access"| node_auth_guard
node_admin_properties -->|"checks access"| node_auth_guard
node_admin_bookings -->|"checks access"| node_auth_guard
node_admin_users -->|"checks access"| node_auth_guard
node_admin_reviews -->|"checks access"| node_auth_guard
node_auth_guard -->|"redirects guests"| node_auth

click node_home "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/index.php"
click node_about "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/about.php"
click node_listing "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/properties/index.php"
click node_search "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/properties/search.php"
click node_details "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/properties/details.php"
click node_auth "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/login.php"
click node_registration "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/validate.php"
click node_profile "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/profile.php"
click node_recovery "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/forgot-password.php"
click node_favorites "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/favorites/index.php"
click node_favorite_action "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/favorites/toggle.php"
click node_booking "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/booking/book.php"
click node_confirmation "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/booking/confirmation.php"
click node_my_bookings "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/booking/my-bookings.php"
click node_cancel "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/booking/cancel.php"
click node_reviews "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/reviews/add.php"
click node_admin_dashboard "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/admin/dashboard.php"
click node_admin_properties "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/admin/properties.php"
click node_admin_bookings "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/admin/bookings.php"
click node_admin_users "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/admin/users.php"
click node_admin_reviews "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/admin/reviews.php"
click node_sidebar "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/includes/admin_sidebar.php"
click node_auth_guard "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/includes/auth_guard.php"
click node_navigation "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/includes/navbar.php"
click node_footer "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/includes/footer.php"
click node_connection "https://github.com/abdulrhman-hosseini/project-stayease/blob/master/config/database.php"

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_about,node_listing,node_search,node_details toneBlue
class node_auth,node_registration,node_profile,node_recovery,node_favorites,node_favorite_action,node_database toneAmber
class node_booking,node_confirmation,node_my_bookings,node_cancel,node_reviews toneMint
class node_admin_dashboard,node_admin_properties,node_admin_bookings,node_admin_users,node_admin_reviews,node_sidebar,node_auth_guard,node_navigation,node_footer,node_connection toneRose
class node_guest,node_mail toneIndigo
```

## Components

### Property discovery

- [Home and featured stays](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/index.php): `index.php`
- [About](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/about.php): `about.php`
- [Property listing](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/properties/index.php): `properties/index.php`
- [Search and availability](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/properties/search.php): `properties/search.php`
- [Property details](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/properties/details.php): `properties/details.php`

### Accounts and saved stays

- [Login and registration](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/login.php): `login.php`
- [Registration validation](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/validate.php): `validate.php`
- [Profile and account](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/profile.php): `profile.php`
- [Password recovery](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/forgot-password.php): `forgot-password.php`
- [Saved favorites](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/favorites/index.php): `favorites/index.php`
- [Favorite toggle](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/favorites/toggle.php): `favorites/toggle.php`

### Booking and reviews

- [Create booking](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/booking/book.php): `booking/book.php`
- [Booking confirmation](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/booking/confirmation.php): `booking/confirmation.php`
- [My bookings](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/booking/my-bookings.php): `booking/my-bookings.php`
- [Cancel booking](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/booking/cancel.php): `booking/cancel.php`
- [Add and delete reviews](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/reviews/add.php): `reviews/add.php`

### Administration and shared runtime

- [Admin dashboard](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/admin/dashboard.php): `admin/dashboard.php`
- [Manage properties](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/admin/properties.php): `admin/properties.php`
- [Manage bookings](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/admin/bookings.php): `admin/bookings.php`
- [Manage users](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/admin/users.php): `admin/users.php`
- [Manage reviews](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/admin/reviews.php): `admin/reviews.php`
- [Admin navigation](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/includes/admin_sidebar.php): `includes/admin_sidebar.php`
- [Access guard](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/includes/auth_guard.php): `includes/auth_guard.php`
- [Shared navigation](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/includes/navbar.php): `includes/navbar.php`
- [Shared footer](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/includes/footer.php): `includes/footer.php`
- [Database connection](https://github.com/abdulrhman-hosseini/project-stayease/blob/master/config/database.php): `config/database.php`

### Other components

- **Visitor**
- **StayEase database**
- **Email service**

## Connections

- Visitor → Home and featured stays: opens (evidence: `README.md`)
- Home and featured stays → Database connection: queries (evidence: `index.php`)
- Home and featured stays → Property listing: links to (evidence: `index.php`)
- Home and featured stays → About: links to (evidence: `index.php`)
- Visitor → Property listing: browses (evidence: `README.md`)
- Property listing → Database connection: queries (evidence: `properties/index.php`)
- Property listing → Search and availability: links to (evidence: `properties/index.php`)
- Property listing → Property details: links to (evidence: `properties/index.php`)
- Visitor → Search and availability: filters (evidence: `README.md`)
- Search and availability → Database connection: queries (evidence: `properties/search.php`)
- Visitor → Property details: views (evidence: `README.md`)
- Property details → Database connection: queries (evidence: `properties/details.php`)
- Visitor → Login and registration: signs in (evidence: `README.md`)
- Login and registration → Registration validation: validates with
- Login and registration → Password recovery: recovers account (evidence: `README.md`)
- Login and registration → Profile and account: opens account (evidence: `README.md`)
- Profile and account → Database connection: queries (evidence: `profile.php`)
- Visitor → Saved favorites: views saved stays (evidence: `README.md`)
- Saved favorites → Database connection: queries (evidence: `favorites/index.php`)
- Property listing → Favorite toggle: submits toggle (evidence: `properties/index.php`)
- Favorite toggle → Database connection: updates (evidence: `favorites/toggle.php`)
- Visitor → Create booking: requests stay (evidence: `README.md`)
- Create booking → Access guard: requires login (evidence: `booking/book.php`)
- Create booking → Database connection: checks and creates (evidence: `booking/book.php`)
- Create booking → Booking confirmation: redirects to (evidence: `booking/book.php`)
- Create booking → Email service: sends confirmation (evidence: `booking/book.php`)
- Visitor → My bookings: views bookings (evidence: `README.md`)
- My bookings → Database connection: queries (evidence: `booking/my-bookings.php`)
- My bookings → Cancel booking: offers cancellation (evidence: `README.md`)
- Visitor → Add and delete reviews: reviews completed stay (evidence: `README.md`)
- Add and delete reviews → Database connection: writes review (evidence: `reviews/add.php`)
- Visitor → Admin dashboard: administers (evidence: `README.md`)
- Admin dashboard → Database connection: queries metrics (evidence: `admin/dashboard.php`)
- Manage properties → Database connection: manages records (evidence: `admin/properties.php`)
- Manage bookings → Database connection: manages records (evidence: `admin/bookings.php`)
- Manage users → Database connection: manages records (evidence: `admin/users.php`)
- Manage reviews → Database connection: queries reviews (evidence: `admin/reviews.php`)
- Admin dashboard → Admin navigation: renders (evidence: `admin/dashboard.php`)
- Manage properties → Admin navigation: renders (evidence: `admin/properties.php`)
- Manage bookings → Admin navigation: renders (evidence: `admin/bookings.php`)
- Manage users → Admin navigation: renders (evidence: `admin/users.php`)
- Manage reviews → Admin navigation: renders (evidence: `admin/reviews.php`)
- Admin dashboard → Access guard: checks access (evidence: `admin/dashboard.php`)
- Manage properties → Access guard: checks access (evidence: `admin/properties.php`)
- Manage bookings → Access guard: checks access (evidence: `admin/bookings.php`)
- Manage users → Access guard: checks access (evidence: `admin/users.php`)
- Manage reviews → Access guard: checks access (evidence: `admin/reviews.php`)
- Access guard → Login and registration: redirects guests (evidence: `includes/auth_guard.php`)
