# baliadventours/tripbone-saas-production architecture

> Architecture diagram of the GitHub repository baliadventours/tripbone-saas-production, 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/baliadventours/tripbone-saas-production
- Repository: https://github.com/baliadventours/tripbone-saas-production

## Overview

This repository appears to be a multi-tenant travel-booking and rental application with SaaS marketing and administration surfaces. The main user journey is tenant/site discovery, tour or vehicle selection, booking and payment, then booking communications and management. The graph also shows tenant configuration, fleet operations, and server-side services. The README is a generic AI Studio run guide rather than product documentation, so capability coverage is inferred from the source tree and indexed module references; unsampled modules are included only where their paths and responsibilities are clear.

Main entry points: [`src/App.tsx`](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/App.tsx) (App Router), [`src/lib/SettingsContext.tsx`](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/lib/SettingsContext.tsx) (Site Configuration), [`server.ts`](https://github.com/baliadventours/tripbone-saas-production/blob/main/server.ts) (API Server), [`src/services/emailHandler.ts`](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/services/emailHandler.ts) (Email Handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Traveler Experience"]
  node_app["App Router<br/>[App.tsx]"]
  node_tour["Tour Discovery<br/>[Tours.tsx]"]
  node_tour_detail["Tour Details<br/>[TourDetail.tsx]"]
  node_checkout["Booking Checkout<br/>[Checkout.tsx]"]
  node_rental_browse["Vehicle Browse<br/>[CarRentals.tsx]"]
end

subgraph group_tenant["Tenant Platform"]
  node_tenant_context["Tenant Resolution<br/>[TenantContext.tsx]"]
  node_site_settings["Site Configuration"]
  node_website_builder["Website Builder<br/>[WebsiteBuilder.tsx]"]
end

subgraph group_operations["Booking Operations"]
  node_admin["Admin Workspace<br/>[Admin.tsx]"]
  node_tour_bookings["Tour Booking Operations<br/>[BookingManager.tsx]"]
  node_fleet["Fleet Management<br/>[FleetManager.tsx]"]
  node_rental_bookings["Rental Operations"]
  node_rental_service["Rental Service"]
end

subgraph group_commerce["Payments and Billing"]
  node_payment_admin["Payment Administration<br/>[PaymentManager.tsx]"]
  node_payment_service["Payment Service<br/>[PaymentService.ts]"]
  node_gateway_registry["Gateway Registry"]
end

subgraph group_backend["Server Services"]
  node_server["API Server<br/>[server.ts]"]
  node_email_handler["Email Handler<br/>[emailHandler.ts]"]
  node_recipient_resolver["Email Configuration"]
  node_voucher["Voucher Generator"]
  node_creem["Creem Checkout<br/>[creemService.ts]"]
  node_firestore[("Firebase Firestore")]
end

node_traveler(("Traveler"))

node_traveler -->|"opens"| node_app
node_app -->|"routes to"| node_tour
node_app -->|"routes to"| node_rental_browse
node_app -->|"uses context"| node_tenant_context
node_traveler -.->|"selects tour"| node_tour_detail
node_tour_detail -.->|"continues booking"| node_checkout
node_app -->|"uses context"| node_site_settings
node_tenant_context -->|"resolves tenant"| node_firestore
node_site_settings -->|"reads tenant"| node_tenant_context
node_site_settings -->|"loads settings"| node_firestore
node_site_settings -->|"uses settings type"| node_website_builder
node_app -->|"routes to"| node_admin
node_admin -.->|"administers"| node_tour_bookings
node_tour_bookings -->|"updates bookings"| node_firestore
node_fleet -->|"manages fleet via"| node_rental_service
node_rental_bookings -->|"uses rental data"| node_rental_service
node_rental_bookings -->|"updates bookings"| node_firestore
node_rental_service -->|"reads and writes"| node_firestore
node_payment_admin -->|"configures payments"| node_payment_service
node_payment_service -->|"selects gateway"| node_gateway_registry
node_server -->|"dispatches email"| node_email_handler
node_email_handler -->|"resolves config"| node_recipient_resolver
node_email_handler -->|"generates voucher"| node_voucher
node_server -->|"creates checkout"| node_creem
node_server -->|"writes documents"| node_firestore

click node_app "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/App.tsx"
click node_tour "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/pages/Tours.tsx"
click node_tour_detail "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/pages/TourDetail.tsx"
click node_checkout "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/pages/Checkout.tsx"
click node_rental_browse "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/pages/CarRentals.tsx"
click node_tenant_context "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/lib/TenantContext.tsx"
click node_site_settings "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/lib/SettingsContext.tsx"
click node_website_builder "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/components/Admin/WebsiteBuilder.tsx"
click node_admin "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/pages/Admin.tsx"
click node_tour_bookings "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/components/Admin/BookingManager.tsx"
click node_fleet "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/components/Admin/CarRental/FleetManager.tsx"
click node_rental_bookings "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/components/Admin/CarRental/CarRentalBookingManager.tsx"
click node_rental_service "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/lib/carRentalService.ts"
click node_payment_admin "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/components/Admin/PaymentManager.tsx"
click node_payment_service "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/services/payment/PaymentService.ts"
click node_gateway_registry "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/services/payment/PaymentGatewayRegistry.ts"
click node_server "https://github.com/baliadventours/tripbone-saas-production/blob/main/server.ts"
click node_email_handler "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/services/emailHandler.ts"
click node_recipient_resolver "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/services/email/recipientResolver.ts"
click node_voucher "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/services/email/voucherGenerator.ts"
click node_creem "https://github.com/baliadventours/tripbone-saas-production/blob/main/src/services/creemService.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_app,node_tour,node_tour_detail,node_checkout,node_rental_browse toneBlue
class node_tenant_context,node_site_settings,node_website_builder toneAmber
class node_admin,node_tour_bookings,node_fleet,node_rental_bookings,node_rental_service toneMint
class node_payment_admin,node_payment_service,node_gateway_registry toneRose
class node_server,node_email_handler,node_recipient_resolver,node_voucher,node_creem,node_firestore,node_traveler toneIndigo
```

## Components

### Traveler Experience

- [App Router](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/App.tsx): `src/App.tsx`
- [Tour Discovery](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/pages/Tours.tsx): `src/pages/Tours.tsx`
- [Tour Details](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/pages/TourDetail.tsx): `src/pages/TourDetail.tsx`
- [Booking Checkout](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/pages/Checkout.tsx): `src/pages/Checkout.tsx`
- [Vehicle Browse](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/pages/CarRentals.tsx): `src/pages/CarRentals.tsx`

### Tenant Platform

- [Tenant Resolution](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/lib/TenantContext.tsx): `src/lib/TenantContext.tsx`
- [Site Configuration](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/lib/SettingsContext.tsx): `src/lib/SettingsContext.tsx`
- [Website Builder](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/components/Admin/WebsiteBuilder.tsx): `src/components/Admin/WebsiteBuilder.tsx`

### Booking Operations

- [Admin Workspace](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/pages/Admin.tsx): `src/pages/Admin.tsx`
- [Tour Booking Operations](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/components/Admin/BookingManager.tsx): `src/components/Admin/BookingManager.tsx`
- [Fleet Management](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/components/Admin/CarRental/FleetManager.tsx): `src/components/Admin/CarRental/FleetManager.tsx`
- [Rental Operations](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/components/Admin/CarRental/CarRentalBookingManager.tsx): `src/components/Admin/CarRental/CarRentalBookingManager.tsx`
- [Rental Service](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/lib/carRentalService.ts): `src/lib/carRentalService.ts`

### Payments and Billing

- [Payment Administration](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/components/Admin/PaymentManager.tsx): `src/components/Admin/PaymentManager.tsx`
- [Payment Service](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/services/payment/PaymentService.ts): `src/services/payment/PaymentService.ts`
- [Gateway Registry](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/services/payment/PaymentGatewayRegistry.ts): `src/services/payment/PaymentGatewayRegistry.ts`

### Server Services

- [API Server](https://github.com/baliadventours/tripbone-saas-production/blob/main/server.ts): `server.ts`
- [Email Handler](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/services/emailHandler.ts): `src/services/emailHandler.ts`
- [Email Configuration](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/services/email/recipientResolver.ts): `src/services/email/recipientResolver.ts`
- [Voucher Generator](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/services/email/voucherGenerator.ts): `src/services/email/voucherGenerator.ts`
- [Creem Checkout](https://github.com/baliadventours/tripbone-saas-production/blob/main/src/services/creemService.ts): `src/services/creemService.ts`
- **Firebase Firestore**

### Other components

- **Traveler**

## Connections

- Traveler → App Router: opens (evidence: `src/App.tsx`)
- App Router → Tour Discovery: routes to (evidence: `src/App.tsx`)
- App Router → Vehicle Browse: routes to (evidence: `src/App.tsx`)
- App Router → Tenant Resolution: uses context (evidence: `src/App.tsx`)
- Traveler → Tour Details: selects tour
- Tour Details → Booking Checkout: continues booking
- App Router → Site Configuration: uses context (evidence: `src/App.tsx`)
- Tenant Resolution → Firebase Firestore: resolves tenant (evidence: `src/lib/TenantContext.tsx`)
- Site Configuration → Tenant Resolution: reads tenant (evidence: `src/lib/SettingsContext.tsx`)
- Site Configuration → Firebase Firestore: loads settings (evidence: `src/lib/SettingsContext.tsx`)
- Site Configuration → Website Builder: uses settings type (evidence: `src/lib/SettingsContext.tsx`)
- App Router → Admin Workspace: routes to (evidence: `src/App.tsx`)
- Admin Workspace → Tour Booking Operations: administers
- Tour Booking Operations → Firebase Firestore: updates bookings (evidence: `src/components/Admin/BookingManager.tsx`)
- Fleet Management → Rental Service: manages fleet via (evidence: `src/components/Admin/CarRental/FleetManager.tsx`)
- Rental Operations → Rental Service: uses rental data (evidence: `src/components/Admin/CarRental/CarRentalBookingManager.tsx`)
- Rental Operations → Firebase Firestore: updates bookings (evidence: `src/components/Admin/CarRental/CarRentalBookingManager.tsx`)
- Rental Service → Firebase Firestore: reads and writes (evidence: `src/lib/carRentalService.ts`)
- Payment Administration → Payment Service: configures payments (evidence: `src/components/Admin/PaymentManager.tsx`)
- Payment Service → Gateway Registry: selects gateway (evidence: `src/services/payment/PaymentService.ts`)
- API Server → Email Handler: dispatches email (evidence: `server.ts`)
- Email Handler → Email Configuration: resolves config (evidence: `src/services/emailHandler.ts`)
- Email Handler → Voucher Generator: generates voucher (evidence: `src/services/emailHandler.ts`)
- API Server → Creem Checkout: creates checkout (evidence: `server.ts`)
- API Server → Firebase Firestore: writes documents (evidence: `server.ts`)
