# craigman123/sidehouse architecture

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

- Interactive diagram: https://gitdiagram.com/craigman123/sidehouse
- Repository: https://github.com/craigman123/sidehouse

## Overview

Side House is a Laravel court-booking system for padel and pickleball. Guests can book without accounts; signed-in users have booking and dashboard features. The core workflow checks court availability and business hours, creates bookings with equipment and payment references, then presents payment status. Admins manage courts, bookings, closures, settings, announcements, and reports. The README documents QRPH payment confirmation via forwarded payment SMS; the listed tree does not include the webhook controller path it mentions, so that implementation is not represented. Some admin and user capabilities are documented but their controller internals were not sampled.

Main entry points: [`app/Http/Controllers/Guest/GuestBookingController.php`](https://github.com/craigman123/sidehouse/blob/master/app/Http/Controllers/Guest/GuestBookingController.php) (Guest booking), [`app/Http/Controllers/User/User_UserController.php`](https://github.com/craigman123/sidehouse/blob/master/app/Http/Controllers/User/User_UserController.php) (User booking), [`app/Models/Booking.php`](https://github.com/craigman123/sidehouse/blob/master/app/Models/Booking.php) (Bookings), [`app/Models/PaymentReference.php`](https://github.com/craigman123/sidehouse/blob/master/app/Models/PaymentReference.php) (Payment references)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_booking["Booking workflows"]
  node_guest["Guest booking"]
  node_signedbooking["User booking"]
  node_bookingdata[("Bookings<br/>[Booking.php]")]
  node_slots[("Booking slots<br/>[BookingSlot.php]")]
  node_equipment[("Equipment rental<br/>[Equipment.php]")]
  node_hours["Hours and closures<br/>[BookingHours.php]"]
  node_businesssettings[("Business settings")]
  node_courts[("Courts<br/>[Court.php]")]
end

subgraph group_payments["Payments"]
  node_payment["QRPH checkout"]
  node_paymentref[("Payment references")]
  node_paymentobserver["Payment receipt dispatch"]
end

subgraph group_accounts["Accounts and service"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_mfa["Admin MFA<br/>[MfaController.php]"]
  node_users[("User accounts<br/>[User.php]")]
  node_activity["Activity logging<br/>[ActivityLogger.php]"]
end

subgraph group_admin["Administration"]
  node_adminbookings["Booking administration"]
  node_adminconfig["Business configuration"]
  node_adminreports["Reports"]
  node_adminextras["Admin operations"]
end

node_visitor(("Guest"))
node_member(("Signed-in user"))
node_administrator(("Administrator"))
node_smsforwarder(("SMS forwarder"))

node_visitor -->|"books through"| node_guest
node_member -->|"books through"| node_signedbooking
node_guest -->|"creates and checks"| node_bookingdata
node_guest -->|"checks availability"| node_slots
node_guest -->|"resolves rental"| node_equipment
node_guest -->|"uses booking hours"| node_hours
node_guest -->|"reads settings"| node_businesssettings
node_guest -->|"reads courts"| node_courts
node_signedbooking -->|"creates and reads"| node_bookingdata
node_signedbooking -->|"checks availability"| node_slots
node_signedbooking -->|"checks availability"| node_equipment
node_signedbooking -->|"uses booking hours"| node_hours
node_signedbooking -->|"reads settings"| node_businesssettings
node_signedbooking -->|"reads courts"| node_courts
node_bookingdata -->|"has many"| node_slots
node_bookingdata -->|"belongs to"| node_paymentref
node_payment -->|"updates payment status"| node_bookingdata
node_payment -->|"confirms payment"| node_paymentref
node_paymentref -->|"triggers observer"| node_paymentobserver
node_paymentobserver -->|"observes"| node_paymentref
node_smsforwarder -.->|"forwards payment SMS"| node_payment
node_auth -->|"authenticates"| node_users
node_auth -->|"logs account activity"| node_activity
node_auth -->|"routes admin challenge"| node_mfa
node_adminconfig -.->|"configures hours"| node_businesssettings
node_administrator -.->|"manages bookings"| node_adminbookings
node_administrator -.->|"configures business"| node_adminconfig
node_administrator -.->|"views reports"| node_adminreports
node_administrator -.->|"manages operations"| node_adminextras
node_adminreports -->|"aggregates bookings"| node_bookingdata

click node_guest "https://github.com/craigman123/sidehouse/blob/master/app/Http/Controllers/Guest/GuestBookingController.php"
click node_signedbooking "https://github.com/craigman123/sidehouse/blob/master/app/Http/Controllers/User/User_UserController.php"
click node_bookingdata "https://github.com/craigman123/sidehouse/blob/master/app/Models/Booking.php"
click node_slots "https://github.com/craigman123/sidehouse/blob/master/app/Models/BookingSlot.php"
click node_equipment "https://github.com/craigman123/sidehouse/blob/master/app/Models/Equipment.php"
click node_hours "https://github.com/craigman123/sidehouse/blob/master/app/Support/BookingHours.php"
click node_businesssettings "https://github.com/craigman123/sidehouse/blob/master/app/Models/BusinessSetting.php"
click node_courts "https://github.com/craigman123/sidehouse/blob/master/app/Models/Court.php"
click node_payment "https://github.com/craigman123/sidehouse/blob/master/app/Http/Controllers/Guest/PaymongoQrPhController.php"
click node_paymentref "https://github.com/craigman123/sidehouse/blob/master/app/Models/PaymentReference.php"
click node_paymentobserver "https://github.com/craigman123/sidehouse/blob/master/app/Observers/PaymentReferenceObserver.php"
click node_auth "https://github.com/craigman123/sidehouse/blob/master/app/Http/Controllers/Auth/AuthController.php"
click node_mfa "https://github.com/craigman123/sidehouse/blob/master/app/Http/Controllers/Auth/MfaController.php"
click node_users "https://github.com/craigman123/sidehouse/blob/master/app/Models/User.php"
click node_activity "https://github.com/craigman123/sidehouse/blob/master/app/Support/ActivityLogger.php"
click node_adminbookings "https://github.com/craigman123/sidehouse/blob/master/app/Http/Controllers/Admin/BookingController.php"
click node_adminconfig "https://github.com/craigman123/sidehouse/blob/master/app/Http/Controllers/Admin/ConfigurationController.php"
click node_adminreports "https://github.com/craigman123/sidehouse/blob/master/app/Http/Controllers/Admin/ReportController.php"
click node_adminextras "https://github.com/craigman123/sidehouse/tree/master/app/Http/Controllers/Admin"

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_guest,node_signedbooking,node_bookingdata,node_slots,node_equipment,node_hours,node_businesssettings,node_courts,node_member toneBlue
class node_payment,node_paymentref,node_paymentobserver toneAmber
class node_auth,node_mfa,node_users,node_activity toneMint
class node_adminbookings,node_adminconfig,node_adminreports,node_adminextras toneRose
class node_visitor,node_administrator,node_smsforwarder toneIndigo
```

## Components

### Booking workflows

- [Guest booking](https://github.com/craigman123/sidehouse/blob/master/app/Http/Controllers/Guest/GuestBookingController.php): `app/Http/Controllers/Guest/GuestBookingController.php`
- [User booking](https://github.com/craigman123/sidehouse/blob/master/app/Http/Controllers/User/User_UserController.php): `app/Http/Controllers/User/User_UserController.php`
- [Bookings](https://github.com/craigman123/sidehouse/blob/master/app/Models/Booking.php): `app/Models/Booking.php`
- [Booking slots](https://github.com/craigman123/sidehouse/blob/master/app/Models/BookingSlot.php): `app/Models/BookingSlot.php`
- [Equipment rental](https://github.com/craigman123/sidehouse/blob/master/app/Models/Equipment.php): `app/Models/Equipment.php`
- [Hours and closures](https://github.com/craigman123/sidehouse/blob/master/app/Support/BookingHours.php): `app/Support/BookingHours.php`
- [Business settings](https://github.com/craigman123/sidehouse/blob/master/app/Models/BusinessSetting.php): `app/Models/BusinessSetting.php`
- [Courts](https://github.com/craigman123/sidehouse/blob/master/app/Models/Court.php): `app/Models/Court.php`

### Payments

- [QRPH checkout](https://github.com/craigman123/sidehouse/blob/master/app/Http/Controllers/Guest/PaymongoQrPhController.php): `app/Http/Controllers/Guest/PaymongoQrPhController.php`
- [Payment references](https://github.com/craigman123/sidehouse/blob/master/app/Models/PaymentReference.php): `app/Models/PaymentReference.php`
- [Payment receipt dispatch](https://github.com/craigman123/sidehouse/blob/master/app/Observers/PaymentReferenceObserver.php): `app/Observers/PaymentReferenceObserver.php`

### Accounts and service

- [Authentication](https://github.com/craigman123/sidehouse/blob/master/app/Http/Controllers/Auth/AuthController.php): `app/Http/Controllers/Auth/AuthController.php`
- [Admin MFA](https://github.com/craigman123/sidehouse/blob/master/app/Http/Controllers/Auth/MfaController.php): `app/Http/Controllers/Auth/MfaController.php`
- [User accounts](https://github.com/craigman123/sidehouse/blob/master/app/Models/User.php): `app/Models/User.php`
- [Activity logging](https://github.com/craigman123/sidehouse/blob/master/app/Support/ActivityLogger.php): `app/Support/ActivityLogger.php`

### Administration

- [Booking administration](https://github.com/craigman123/sidehouse/blob/master/app/Http/Controllers/Admin/BookingController.php): `app/Http/Controllers/Admin/BookingController.php`
- [Business configuration](https://github.com/craigman123/sidehouse/blob/master/app/Http/Controllers/Admin/ConfigurationController.php): `app/Http/Controllers/Admin/ConfigurationController.php`
- [Reports](https://github.com/craigman123/sidehouse/blob/master/app/Http/Controllers/Admin/ReportController.php): `app/Http/Controllers/Admin/ReportController.php`
- [Admin operations](https://github.com/craigman123/sidehouse/tree/master/app/Http/Controllers/Admin): `app/Http/Controllers/Admin`

### Other components

- **Guest**
- **Signed-in user**
- **Administrator**
- **SMS forwarder**

## Connections

- Guest → Guest booking: books through
- Signed-in user → User booking: books through
- Guest booking → Bookings: creates and checks (evidence: `app/Http/Controllers/Guest/GuestBookingController.php`)
- Guest booking → Booking slots: checks availability (evidence: `app/Http/Controllers/Guest/GuestBookingController.php`)
- Guest booking → Equipment rental: resolves rental (evidence: `app/Http/Controllers/Guest/GuestBookingController.php`)
- Guest booking → Hours and closures: uses booking hours (evidence: `app/Http/Controllers/Guest/GuestBookingController.php`)
- Guest booking → Business settings: reads settings (evidence: `app/Http/Controllers/Guest/GuestBookingController.php`)
- Guest booking → Courts: reads courts (evidence: `app/Http/Controllers/Guest/GuestBookingController.php`)
- User booking → Bookings: creates and reads (evidence: `app/Http/Controllers/User/User_UserController.php`)
- User booking → Booking slots: checks availability (evidence: `app/Http/Controllers/User/User_UserController.php`)
- User booking → Equipment rental: checks availability (evidence: `app/Http/Controllers/User/User_UserController.php`)
- User booking → Hours and closures: uses booking hours (evidence: `app/Http/Controllers/User/User_UserController.php`)
- User booking → Business settings: reads settings (evidence: `app/Http/Controllers/User/User_UserController.php`)
- User booking → Courts: reads courts (evidence: `app/Http/Controllers/User/User_UserController.php`)
- Bookings → Booking slots: has many (evidence: `app/Models/Booking.php`)
- Bookings → Payment references: belongs to (evidence: `app/Models/Booking.php`)
- QRPH checkout → Bookings: updates payment status (evidence: `app/Http/Controllers/Guest/PaymongoQrPhController.php`)
- QRPH checkout → Payment references: confirms payment (evidence: `app/Models/PaymentReference.php`)
- Payment references → Payment receipt dispatch: triggers observer (evidence: `app/Providers/AppServiceProvider.php`)
- Payment receipt dispatch → Payment references: observes (evidence: `app/Providers/AppServiceProvider.php`)
- SMS forwarder → QRPH checkout: forwards payment SMS
- Authentication → User accounts: authenticates (evidence: `app/Http/Controllers/Auth/AuthController.php`)
- Authentication → Activity logging: logs account activity (evidence: `app/Http/Controllers/Auth/AuthController.php`)
- Authentication → Admin MFA: routes admin challenge (evidence: `app/Http/Controllers/Auth/AuthController.php`)
- Business configuration → Business settings: configures hours
- Administrator → Booking administration: manages bookings
- Administrator → Business configuration: configures business
- Administrator → Reports: views reports
- Administrator → Admin operations: manages operations
- Reports → Bookings: aggregates bookings (evidence: `app/Http/Controllers/Admin/ReportController.php`)
