# hoainamchu/tarot-app architecture

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

- Interactive diagram: https://gitdiagram.com/hoainamchu/tarot-app
- Repository: https://github.com/hoainamchu/tarot-app

## Overview

This repository implements a tarot-reading booking platform: customers browse readings and readers, book sessions, pay, and manage bookings; readers and administrators manage bookings and platform operations. The graph includes the two web apps, backend booking/payment/notification capabilities, and core domain records. Backend relationships are supported by excerpts or SOURCE INDEX references; client-to-API connections are shown as unverified because the relevant request wiring was not excerpted. The README is empty.

Main entry points: [`backend/app/Models/Booking.php`](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Models/Booking.php) (Bookings), [`backend/app/Http/Controllers/Api/Admin/AdminController.php`](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Http/Controllers/Api/Admin/AdminController.php) (Admin operations API), [`backend/app/Services/NotificationService.php`](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Services/NotificationService.php) (Notification delivery), [`backend/app/Http/Controllers/Api/User/BookingController.php`](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Http/Controllers/Api/User/BookingController.php) (Customer booking API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer_app["Customer web app"]
  node_user_app["Customer app routes<br/>[App.jsx]"]
  node_home["Discovery and booking<br/>[Home.jsx]"]
  node_user_dashboard["Customer dashboard<br/>[Dashboard.jsx]"]
  node_payment_result["Payment result<br/>[PaymentResult.jsx]"]
  node_user_api["Customer API client<br/>[api.js]"]
end

subgraph group_admin_app["Admin and reader web app"]
  node_admin_app["Admin app routes<br/>[App.jsx]"]
  node_admin_bookings["Booking operations<br/>[Bookings.jsx]"]
  node_reader_portal["Reader portal<br/>[ReaderPortal.jsx]"]
  node_admin_api["Admin API client<br/>[api.js]"]
end

subgraph group_backend["Backend application"]
  node_user_booking_api["Customer booking API"]
  node_admin_api_controller["Admin operations API"]
  node_reader_api["Reader dashboard API"]
  node_reading_api["Reading content API"]
  node_payment_api["VNPay callback API"]
  node_booking_creation["Booking creation"]
  node_booking_conflicts["Slot conflict checks"]
  node_completion["Booking completion"]
  node_notifications["Notification delivery"]
  node_payment_config["Payment gateway config"]
end

subgraph group_domain["Booking domain"]
  node_booking[("Bookings<br/>[Booking.php]")]
  node_payment[("Payments<br/>[Payment.php]")]
  node_reader[("Readers<br/>[Reader.php]")]
  node_service[("Reading services<br/>[Service.php]")]
  node_user[("User accounts<br/>[User.php]")]
  node_app_setting[("App settings<br/>[AppSetting.php]")]
  node_app_notification[("Notifications")]
end

node_customer(("Customer"))
node_admin_actor(("Administrator"))
node_reader_actor(("Reader"))

node_customer -->|"uses"| node_user_app
node_user_app -->|"routes to"| node_home
node_user_app -->|"routes to"| node_user_dashboard
node_user_app -->|"routes to"| node_payment_result
node_user_dashboard -.->|"uses"| node_user_api
node_user_api -.->|"requests"| node_user_booking_api
node_user_api -.->|"requests"| node_reading_api
node_admin_actor -->|"uses"| node_admin_app
node_reader_actor -->|"uses"| node_admin_app
node_admin_app -->|"routes to"| node_admin_bookings
node_admin_app -->|"routes to"| node_reader_portal
node_admin_bookings -.->|"uses"| node_admin_api
node_reader_portal -.->|"uses"| node_admin_api
node_admin_api -.->|"requests"| node_admin_api_controller
node_admin_api -.->|"requests"| node_reader_api
node_user_booking_api -->|"creates via"| node_booking_creation
node_booking_creation -->|"checks slots"| node_booking_conflicts
node_booking_creation -->|"creates"| node_booking
node_booking_creation -->|"notifies"| node_notifications
node_user_booking_api -->|"delegates completion"| node_completion
node_user_booking_api -->|"checks gateway config"| node_payment_config
node_user_booking_api -->|"reads and updates"| node_payment
node_admin_api_controller -->|"manages"| node_booking
node_admin_api_controller -->|"reads"| node_payment
node_admin_api_controller -->|"manages"| node_reader
node_admin_api_controller -->|"manages"| node_service
node_admin_api_controller -->|"manages"| node_user
node_reader_api -->|"checks slots"| node_booking_conflicts
node_reader_api -->|"creates bookings"| node_booking_creation
node_reader_api -->|"delegates completion"| node_completion
node_reader_api -->|"notifies"| node_notifications
node_reading_api -->|"reads"| node_reader
node_payment_api -->|"loads config"| node_payment_config
node_payment_api -->|"updates"| node_payment
node_completion -->|"updates"| node_booking
node_completion -->|"notifies"| node_notifications
node_payment_config -->|"reads"| node_app_setting
node_payment_config -->|"reads"| node_payment
node_notifications -->|"persists"| node_app_notification
node_notifications -->|"selects recipients"| node_user
node_notifications -->|"loads booking context"| node_booking
node_booking -->|"belongs to"| node_user
node_booking -->|"belongs to"| node_reader
node_booking -->|"belongs to"| node_service
node_booking -->|"has payments"| node_payment
node_reader -->|"belongs to"| node_user

click node_user_app "https://github.com/hoainamchu/tarot-app/blob/main/frontend/user-app/src/App.jsx"
click node_home "https://github.com/hoainamchu/tarot-app/blob/main/frontend/user-app/src/pages/Home.jsx"
click node_user_dashboard "https://github.com/hoainamchu/tarot-app/blob/main/frontend/user-app/src/pages/Dashboard.jsx"
click node_payment_result "https://github.com/hoainamchu/tarot-app/blob/main/frontend/user-app/src/pages/PaymentResult.jsx"
click node_user_api "https://github.com/hoainamchu/tarot-app/blob/main/frontend/user-app/src/services/api.js"
click node_admin_app "https://github.com/hoainamchu/tarot-app/blob/main/frontend/admin-app/src/App.jsx"
click node_admin_bookings "https://github.com/hoainamchu/tarot-app/blob/main/frontend/admin-app/src/pages/Bookings/Bookings.jsx"
click node_reader_portal "https://github.com/hoainamchu/tarot-app/blob/main/frontend/admin-app/src/pages/ReaderPortal/ReaderPortal.jsx"
click node_admin_api "https://github.com/hoainamchu/tarot-app/blob/main/frontend/admin-app/src/services/api.js"
click node_user_booking_api "https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Http/Controllers/Api/User/BookingController.php"
click node_admin_api_controller "https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Http/Controllers/Api/Admin/AdminController.php"
click node_reader_api "https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Http/Controllers/Api/Reader/ReaderDashboardController.php"
click node_reading_api "https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Http/Controllers/Api/PublicApi/ReadingController.php"
click node_payment_api "https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Http/Controllers/Api/Payment/VNPayController.php"
click node_booking_creation "https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Services/Booking/CreateBookingService.php"
click node_booking_conflicts "https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Services/Booking/BookingConflictService.php"
click node_completion "https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Services/Booking/BookingCompletionService.php"
click node_notifications "https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Services/NotificationService.php"
click node_payment_config "https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Services/Payment/PaymentGatewayConfig.php"
click node_booking "https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Models/Booking.php"
click node_payment "https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Models/Payment.php"
click node_reader "https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Models/Reader.php"
click node_service "https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Models/Service.php"
click node_user "https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Models/User.php"
click node_app_setting "https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Models/AppSetting.php"
click node_app_notification "https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Models/AppNotification.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_user_app,node_home,node_user_dashboard,node_payment_result,node_user_api toneBlue
class node_admin_app,node_admin_bookings,node_reader_portal,node_admin_api toneAmber
class node_user_booking_api,node_admin_api_controller,node_reader_api,node_reading_api,node_payment_api,node_booking_creation,node_booking_conflicts,node_completion,node_notifications,node_payment_config toneMint
class node_booking,node_payment,node_reader,node_service,node_user,node_app_setting,node_app_notification toneRose
class node_customer,node_admin_actor,node_reader_actor toneIndigo
```

## Components

### Customer web app

- [Customer app routes](https://github.com/hoainamchu/tarot-app/blob/main/frontend/user-app/src/App.jsx): `frontend/user-app/src/App.jsx`
- [Discovery and booking](https://github.com/hoainamchu/tarot-app/blob/main/frontend/user-app/src/pages/Home.jsx): `frontend/user-app/src/pages/Home.jsx`
- [Customer dashboard](https://github.com/hoainamchu/tarot-app/blob/main/frontend/user-app/src/pages/Dashboard.jsx): `frontend/user-app/src/pages/Dashboard.jsx`
- [Payment result](https://github.com/hoainamchu/tarot-app/blob/main/frontend/user-app/src/pages/PaymentResult.jsx): `frontend/user-app/src/pages/PaymentResult.jsx`
- [Customer API client](https://github.com/hoainamchu/tarot-app/blob/main/frontend/user-app/src/services/api.js): `frontend/user-app/src/services/api.js`

### Admin and reader web app

- [Admin app routes](https://github.com/hoainamchu/tarot-app/blob/main/frontend/admin-app/src/App.jsx): `frontend/admin-app/src/App.jsx`
- [Booking operations](https://github.com/hoainamchu/tarot-app/blob/main/frontend/admin-app/src/pages/Bookings/Bookings.jsx): `frontend/admin-app/src/pages/Bookings/Bookings.jsx`
- [Reader portal](https://github.com/hoainamchu/tarot-app/blob/main/frontend/admin-app/src/pages/ReaderPortal/ReaderPortal.jsx): `frontend/admin-app/src/pages/ReaderPortal/ReaderPortal.jsx`
- [Admin API client](https://github.com/hoainamchu/tarot-app/blob/main/frontend/admin-app/src/services/api.js): `frontend/admin-app/src/services/api.js`

### Backend application

- [Customer booking API](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Http/Controllers/Api/User/BookingController.php): `backend/app/Http/Controllers/Api/User/BookingController.php`
- [Admin operations API](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Http/Controllers/Api/Admin/AdminController.php): `backend/app/Http/Controllers/Api/Admin/AdminController.php`
- [Reader dashboard API](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Http/Controllers/Api/Reader/ReaderDashboardController.php): `backend/app/Http/Controllers/Api/Reader/ReaderDashboardController.php`
- [Reading content API](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Http/Controllers/Api/PublicApi/ReadingController.php): `backend/app/Http/Controllers/Api/PublicApi/ReadingController.php`
- [VNPay callback API](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Http/Controllers/Api/Payment/VNPayController.php): `backend/app/Http/Controllers/Api/Payment/VNPayController.php`
- [Booking creation](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Services/Booking/CreateBookingService.php): `backend/app/Services/Booking/CreateBookingService.php`
- [Slot conflict checks](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Services/Booking/BookingConflictService.php): `backend/app/Services/Booking/BookingConflictService.php`
- [Booking completion](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Services/Booking/BookingCompletionService.php): `backend/app/Services/Booking/BookingCompletionService.php`
- [Notification delivery](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Services/NotificationService.php): `backend/app/Services/NotificationService.php`
- [Payment gateway config](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Services/Payment/PaymentGatewayConfig.php): `backend/app/Services/Payment/PaymentGatewayConfig.php`

### Booking domain

- [Bookings](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Models/Booking.php): `backend/app/Models/Booking.php`
- [Payments](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Models/Payment.php): `backend/app/Models/Payment.php`
- [Readers](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Models/Reader.php): `backend/app/Models/Reader.php`
- [Reading services](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Models/Service.php): `backend/app/Models/Service.php`
- [User accounts](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Models/User.php): `backend/app/Models/User.php`
- [App settings](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Models/AppSetting.php): `backend/app/Models/AppSetting.php`
- [Notifications](https://github.com/hoainamchu/tarot-app/blob/main/backend/app/Models/AppNotification.php): `backend/app/Models/AppNotification.php`

### Other components

- **Customer**
- **Administrator**
- **Reader**

## Connections

- Customer → Customer app routes: uses
- Customer app routes → Discovery and booking: routes to (evidence: `frontend/user-app/src/App.jsx`)
- Customer app routes → Customer dashboard: routes to (evidence: `frontend/user-app/src/App.jsx`)
- Customer app routes → Payment result: routes to (evidence: `frontend/user-app/src/App.jsx`)
- Customer dashboard → Customer API client: uses
- Customer API client → Customer booking API: requests
- Customer API client → Reading content API: requests
- Administrator → Admin app routes: uses
- Reader → Admin app routes: uses
- Admin app routes → Booking operations: routes to (evidence: `frontend/admin-app/src/App.jsx`)
- Admin app routes → Reader portal: routes to (evidence: `frontend/admin-app/src/App.jsx`)
- Booking operations → Admin API client: uses
- Reader portal → Admin API client: uses
- Admin API client → Admin operations API: requests
- Admin API client → Reader dashboard API: requests
- Customer booking API → Booking creation: creates via (evidence: `backend/app/Http/Controllers/Api/User/BookingController.php`)
- Booking creation → Slot conflict checks: checks slots (evidence: `backend/app/Services/Booking/CreateBookingService.php`)
- Booking creation → Bookings: creates (evidence: `backend/app/Services/Booking/CreateBookingService.php`)
- Booking creation → Notification delivery: notifies (evidence: `backend/app/Services/Booking/CreateBookingService.php`)
- Customer booking API → Booking completion: delegates completion (evidence: `backend/app/Http/Controllers/Api/User/BookingController.php`)
- Customer booking API → Payment gateway config: checks gateway config (evidence: `backend/app/Http/Controllers/Api/User/BookingController.php`)
- Customer booking API → Payments: reads and updates (evidence: `backend/app/Http/Controllers/Api/User/BookingController.php`)
- Admin operations API → Bookings: manages (evidence: `backend/app/Http/Controllers/Api/Admin/AdminController.php`)
- Admin operations API → Payments: reads (evidence: `backend/app/Http/Controllers/Api/Admin/AdminController.php`)
- Admin operations API → Readers: manages (evidence: `backend/app/Http/Controllers/Api/Admin/AdminController.php`)
- Admin operations API → Reading services: manages (evidence: `backend/app/Http/Controllers/Api/Admin/AdminController.php`)
- Admin operations API → User accounts: manages (evidence: `backend/app/Http/Controllers/Api/Admin/AdminController.php`)
- Reader dashboard API → Slot conflict checks: checks slots (evidence: `backend/app/Http/Controllers/Api/Reader/ReaderDashboardController.php`)
- Reader dashboard API → Booking creation: creates bookings (evidence: `backend/app/Http/Controllers/Api/Reader/ReaderDashboardController.php`)
- Reader dashboard API → Booking completion: delegates completion (evidence: `backend/app/Http/Controllers/Api/Reader/ReaderDashboardController.php`)
- Reader dashboard API → Notification delivery: notifies (evidence: `backend/app/Http/Controllers/Api/Reader/ReaderDashboardController.php`)
- Reading content API → Readers: reads (evidence: `backend/app/Http/Controllers/Api/PublicApi/ReadingController.php`)
- VNPay callback API → Payment gateway config: loads config (evidence: `backend/app/Http/Controllers/Api/Payment/VNPayController.php`)
- VNPay callback API → Payments: updates (evidence: `backend/app/Http/Controllers/Api/Payment/VNPayController.php`)
- Booking completion → Bookings: updates (evidence: `backend/app/Services/Booking/BookingCompletionService.php`)
- Booking completion → Notification delivery: notifies (evidence: `backend/app/Services/Booking/BookingCompletionService.php`)
- Payment gateway config → App settings: reads (evidence: `backend/app/Services/Payment/PaymentGatewayConfig.php`)
- Payment gateway config → Payments: reads (evidence: `backend/app/Services/Payment/PaymentGatewayConfig.php`)
- Notification delivery → Notifications: persists (evidence: `backend/app/Services/NotificationService.php`)
- Notification delivery → User accounts: selects recipients (evidence: `backend/app/Services/NotificationService.php`)
- Notification delivery → Bookings: loads booking context (evidence: `backend/app/Services/NotificationService.php`)
- Bookings → User accounts: belongs to (evidence: `backend/app/Models/Booking.php`)
- Bookings → Readers: belongs to (evidence: `backend/app/Models/Booking.php`)
- Bookings → Reading services: belongs to (evidence: `backend/app/Models/Booking.php`)
- Bookings → Payments: has payments (evidence: `backend/app/Models/Booking.php`)
- Readers → User accounts: belongs to (evidence: `backend/app/Models/Reader.php`)
