# clarklearnstocode/dxdiag architecture

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

- Interactive diagram: https://gitdiagram.com/clarklearnstocode/dxdiag
- Repository: https://github.com/clarklearnstocode/dxdiag

## Overview

EstateBook is a PHP property-rental booking application. Guests browse listings, authenticate, reserve dates, manage bookings, and review completed stays; administrators manage properties, reservations, users, and announcements. The front controller dispatches requests to domain controllers, which use PDO and render PHP views. Authentication includes TOTP, and a front-controller-triggered service releases expired bookings. The README is empty, so feature coverage comes from the tree and sampled files; unsampled controller behavior is represented cautiously.

Main entry points: [`public/index.php`](https://github.com/clarklearnstocode/dxdiag/blob/master/public/index.php) (Route dispatcher), [`app/controllers/AuthController.php`](https://github.com/clarklearnstocode/dxdiag/blob/master/app/controllers/AuthController.php) (Authentication and profile), [`app/controllers/PropertyController.php`](https://github.com/clarklearnstocode/dxdiag/blob/master/app/controllers/PropertyController.php) (Property and booking actions), [`config/Database.php`](https://github.com/clarklearnstocode/dxdiag/blob/master/config/Database.php) (PDO connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Request entry"]
  node_front["Route dispatcher<br/>[index.php]"]
end

subgraph group_guest["Guest experience"]
  node_auth["Authentication and profile<br/>[AuthController.php]"]
  node_totp["TOTP verification<br/>[TOTPService.php]"]
  node_auth_views["Login and MFA views<br/>[login.php]"]
  node_property_controller["Property and booking actions"]
  node_booking_controller["Booking routes"]
  node_browse_views["Browse and property views<br/>[landing.php]"]
  node_booking_views["Reservation and review views<br/>[book_property.php]"]
  node_account_views["Guest account views<br/>[dashboard.php]"]
  node_user_nav["Guest navigation<br/>[_user_navbar.php]"]
end

subgraph group_admin["Administration"]
  node_admin_controller["Admin operations"]
  node_admin_views["Admin console views"]
  node_admin_sidebar["Admin navigation<br/>[_sidebar.php]"]
end

subgraph group_core["Domain and persistence"]
  node_user_model["User lookup<br/>[Users.php]"]
  node_property_model["Property queries<br/>[Property.php]"]
  node_auto_release["Expired booking release<br/>[AutoRelease.php]"]
  node_database_config["PDO connection<br/>[Database.php]"]
  node_estate_db[("EstateBook database")]
end

node_visitor(("Guest or admin"))

node_visitor -->|"requests"| node_front
node_front -->|"dispatches"| node_auth
node_front -->|"dispatches"| node_property_controller
node_front -->|"dispatches"| node_booking_controller
node_front -->|"dispatches"| node_admin_controller
node_front -->|"runs"| node_auto_release
node_auth -->|"uses"| node_user_model
node_auth -->|"uses"| node_totp
node_auth -->|"connects"| node_database_config
node_auth -->|"renders"| node_auth_views
node_property_controller -->|"queries"| node_property_model
node_property_controller -->|"connects"| node_database_config
node_property_controller -->|"renders"| node_browse_views
node_property_controller -->|"renders"| node_booking_views
node_admin_controller -->|"uses"| node_property_model
node_admin_controller -->|"connects"| node_database_config
node_admin_controller -->|"renders"| node_admin_views
node_admin_views -->|"includes"| node_admin_sidebar
node_user_nav -->|"requests notifications"| node_front
node_auto_release -->|"uses"| node_property_model
node_front -->|"connects"| node_database_config
node_database_config -.->|"connects"| node_estate_db

click node_front "https://github.com/clarklearnstocode/dxdiag/blob/master/public/index.php"
click node_auth "https://github.com/clarklearnstocode/dxdiag/blob/master/app/controllers/AuthController.php"
click node_totp "https://github.com/clarklearnstocode/dxdiag/blob/master/app/services/TOTPService.php"
click node_auth_views "https://github.com/clarklearnstocode/dxdiag/blob/master/app/views/login.php"
click node_user_model "https://github.com/clarklearnstocode/dxdiag/blob/master/app/models/Users.php"
click node_property_controller "https://github.com/clarklearnstocode/dxdiag/blob/master/app/controllers/PropertyController.php"
click node_booking_controller "https://github.com/clarklearnstocode/dxdiag/blob/master/app/controllers/BookingController.php"
click node_browse_views "https://github.com/clarklearnstocode/dxdiag/blob/master/app/views/landing.php"
click node_booking_views "https://github.com/clarklearnstocode/dxdiag/blob/master/app/views/User/book_property.php"
click node_account_views "https://github.com/clarklearnstocode/dxdiag/blob/master/app/views/User/dashboard.php"
click node_user_nav "https://github.com/clarklearnstocode/dxdiag/blob/master/app/views/User/_user_navbar.php"
click node_admin_controller "https://github.com/clarklearnstocode/dxdiag/blob/master/app/controllers/AdminController.php"
click node_admin_views "https://github.com/clarklearnstocode/dxdiag/blob/master/app/views/Admin/admin_dashboard.php"
click node_admin_sidebar "https://github.com/clarklearnstocode/dxdiag/blob/master/app/views/Admin/_sidebar.php"
click node_property_model "https://github.com/clarklearnstocode/dxdiag/blob/master/app/models/Property.php"
click node_auto_release "https://github.com/clarklearnstocode/dxdiag/blob/master/app/services/AutoRelease.php"
click node_database_config "https://github.com/clarklearnstocode/dxdiag/blob/master/config/Database.php"
click node_estate_db "https://github.com/clarklearnstocode/dxdiag/blob/master/config/u367097290_estatebook.sql"

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_front toneBlue
class node_auth,node_totp,node_auth_views,node_property_controller,node_booking_controller,node_browse_views,node_booking_views,node_account_views,node_user_nav toneAmber
class node_admin_controller,node_admin_views,node_admin_sidebar toneMint
class node_user_model,node_property_model,node_auto_release,node_database_config,node_estate_db toneRose
class node_visitor toneIndigo
```

## Components

### Request entry

- [Route dispatcher](https://github.com/clarklearnstocode/dxdiag/blob/master/public/index.php): `public/index.php`

### Guest experience

- [Authentication and profile](https://github.com/clarklearnstocode/dxdiag/blob/master/app/controllers/AuthController.php): `app/controllers/AuthController.php`
- [TOTP verification](https://github.com/clarklearnstocode/dxdiag/blob/master/app/services/TOTPService.php): `app/services/TOTPService.php`
- [Login and MFA views](https://github.com/clarklearnstocode/dxdiag/blob/master/app/views/login.php): `app/views/login.php`
- [Property and booking actions](https://github.com/clarklearnstocode/dxdiag/blob/master/app/controllers/PropertyController.php): `app/controllers/PropertyController.php`
- [Booking routes](https://github.com/clarklearnstocode/dxdiag/blob/master/app/controllers/BookingController.php): `app/controllers/BookingController.php`
- [Browse and property views](https://github.com/clarklearnstocode/dxdiag/blob/master/app/views/landing.php): `app/views/landing.php`
- [Reservation and review views](https://github.com/clarklearnstocode/dxdiag/blob/master/app/views/User/book_property.php): `app/views/User/book_property.php`
- [Guest account views](https://github.com/clarklearnstocode/dxdiag/blob/master/app/views/User/dashboard.php): `app/views/User/dashboard.php`
- [Guest navigation](https://github.com/clarklearnstocode/dxdiag/blob/master/app/views/User/_user_navbar.php): `app/views/User/_user_navbar.php`

### Administration

- [Admin operations](https://github.com/clarklearnstocode/dxdiag/blob/master/app/controllers/AdminController.php): `app/controllers/AdminController.php`
- [Admin console views](https://github.com/clarklearnstocode/dxdiag/blob/master/app/views/Admin/admin_dashboard.php): `app/views/Admin/admin_dashboard.php`
- [Admin navigation](https://github.com/clarklearnstocode/dxdiag/blob/master/app/views/Admin/_sidebar.php): `app/views/Admin/_sidebar.php`

### Domain and persistence

- [User lookup](https://github.com/clarklearnstocode/dxdiag/blob/master/app/models/Users.php): `app/models/Users.php`
- [Property queries](https://github.com/clarklearnstocode/dxdiag/blob/master/app/models/Property.php): `app/models/Property.php`
- [Expired booking release](https://github.com/clarklearnstocode/dxdiag/blob/master/app/services/AutoRelease.php): `app/services/AutoRelease.php`
- [PDO connection](https://github.com/clarklearnstocode/dxdiag/blob/master/config/Database.php): `config/Database.php`
- [EstateBook database](https://github.com/clarklearnstocode/dxdiag/blob/master/config/u367097290_estatebook.sql): `config/u367097290_estatebook.sql`

### Other components

- **Guest or admin**

## Connections

- Guest or admin → Route dispatcher: requests (evidence: `public/index.php`)
- Route dispatcher → Authentication and profile: dispatches (evidence: `public/index.php`)
- Route dispatcher → Property and booking actions: dispatches (evidence: `public/index.php`)
- Route dispatcher → Booking routes: dispatches (evidence: `public/index.php`)
- Route dispatcher → Admin operations: dispatches (evidence: `public/index.php`)
- Route dispatcher → Expired booking release: runs (evidence: `public/index.php`)
- Authentication and profile → User lookup: uses (evidence: `app/controllers/AuthController.php`)
- Authentication and profile → TOTP verification: uses (evidence: `app/controllers/AuthController.php`)
- Authentication and profile → PDO connection: connects (evidence: `app/controllers/AuthController.php`)
- Authentication and profile → Login and MFA views: renders (evidence: `app/controllers/AuthController.php`)
- Property and booking actions → Property queries: queries (evidence: `app/controllers/PropertyController.php`)
- Property and booking actions → PDO connection: connects (evidence: `app/controllers/PropertyController.php`)
- Property and booking actions → Browse and property views: renders (evidence: `app/controllers/PropertyController.php`)
- Property and booking actions → Reservation and review views: renders (evidence: `app/controllers/PropertyController.php`)
- Admin operations → Property queries: uses (evidence: `app/controllers/AdminController.php`)
- Admin operations → PDO connection: connects (evidence: `app/controllers/AdminController.php`)
- Admin operations → Admin console views: renders (evidence: `app/controllers/AdminController.php`)
- Admin console views → Admin navigation: includes (evidence: `app/views/Admin/admin_dashboard.php`)
- Guest navigation → Route dispatcher: requests notifications (evidence: `app/views/User/_user_navbar.php`)
- Expired booking release → Property queries: uses (evidence: `app/services/AutoRelease.php`)
- Route dispatcher → PDO connection: connects (evidence: `public/index.php`)
- PDO connection → EstateBook database: connects
