# bk-nexus/tickbron architecture

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

- Interactive diagram: https://gitdiagram.com/bk-nexus/tickbron
- Repository: https://github.com/bk-nexus/tickbron

## Overview

TICKBRON is a hotel-booking platform with guest, partner, and admin experiences backed by a Django API. The guest journey spans property discovery, booking, and payment; supporting capabilities include account/review management, partner operations, promotions, and administration. The frontend routes and selected backend relationships are evidenced by excerpts and the SOURCE INDEX. Many view-to-service and frontend-to-API connections are unsampled, so those links are omitted or marked unverified rather than asserted as observed calls.

Main entry points: [`backend/bookings/models.py`](https://github.com/bk-nexus/tickbron/blob/master/backend/bookings/models.py) (Booking lifecycle), [`frontend/src/App.tsx`](https://github.com/bk-nexus/tickbron/blob/master/frontend/src/App.tsx) (Application routes), [`backend/properties/models.py`](https://github.com/bk-nexus/tickbron/blob/master/backend/properties/models.py) (Property catalogue), [`backend/payments/webhooks.py`](https://github.com/bk-nexus/tickbron/blob/master/backend/payments/webhooks.py) (Payment webhooks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Guest experience"]
  node_app["Application routes<br/>[App.tsx]"]
  node_search_ui["Property search"]
  node_property_ui["Property details"]
  node_property_search["Property search service<br/>[search.py]"]
  node_properties[("Property catalogue<br/>[models.py]")]
end

subgraph group_booking["Booking and payments"]
  node_booking_ui["Booking checkout<br/>[BookingPage.tsx]"]
  node_bookings_ui["Guest bookings<br/>[BookingsPage.tsx]"]
  node_booking_logic["Booking lifecycle<br/>[models.py]"]
  node_pricing["Booking pricing<br/>[pricing.py]"]
  node_booking_state["Booking state rules<br/>[state_machine.py]"]
  node_booking_tasks["Booking scheduled tasks<br/>[tasks.py]"]
  node_payment_webhooks["Payment webhooks<br/>[webhooks.py]"]
  node_payment_adapters["Payment provider adapters<br/>[adapters.py]"]
  node_payment_records[("Payment records<br/>[models.py]")]
end

subgraph group_operations["Hotel operations"]
  node_partner_ui["Partner dashboard"]
  node_admin_ui["Admin dashboard"]
  node_promotions["Promotion rules<br/>[service.py]"]
  node_promotion_tasks["Promotion scheduled task<br/>[tasks.py]"]
end

subgraph group_platform["Accounts and platform"]
  node_accounts[("Accounts and reviews<br/>[models.py]")]
  node_auth_ui["Authentication context<br/>[AuthContext.tsx]"]
  node_translations["Localization provider<br/>[I18nContext.tsx]"]
  node_exchange_rates["Currency rates<br/>[rates.py]"]
end

node_guest(("Guest"))
node_database[("Database")]

node_guest -->|"uses"| node_app
node_app -->|"routes to"| node_search_ui
node_app -->|"routes to"| node_property_ui
node_app -->|"routes to"| node_booking_ui
node_app -->|"routes to"| node_bookings_ui
node_app -->|"routes to"| node_partner_ui
node_app -->|"routes to"| node_admin_ui
node_app -->|"provides context"| node_auth_ui
node_app -->|"provides context"| node_translations
node_property_search -->|"queries"| node_properties
node_booking_logic -->|"uses property data"| node_properties
node_booking_logic -->|"uses pricing"| node_pricing
node_booking_logic -->|"validates transitions"| node_booking_state
node_booking_logic -->|"reads rates"| node_exchange_rates
node_booking_logic -->|"uses payment records"| node_payment_records
node_booking_tasks -->|"processes expirations"| node_booking_logic
node_booking_tasks -->|"completes stays"| node_booking_logic
node_payment_webhooks -->|"gets adapter"| node_payment_adapters
node_payment_webhooks -->|"updates records"| node_payment_records
node_payment_webhooks -->|"updates booking"| node_booking_logic
node_promotions -->|"locks property"| node_properties
node_promotion_tasks -->|"runs cleanup"| node_promotions
node_accounts -.->|"persists"| node_database
node_properties -.->|"persists"| node_database
node_booking_logic -.->|"persists"| node_database
node_payment_records -.->|"persists"| node_database
node_search_ui -.->|"requests search"| node_property_search
node_property_ui -.->|"requests details"| node_properties
node_booking_ui -.->|"submits booking"| node_booking_logic
node_booking_ui -.->|"initiates payment"| node_payment_adapters
node_partner_ui -.->|"manages promotions"| node_promotions

click node_app "https://github.com/bk-nexus/tickbron/blob/master/frontend/src/App.tsx"
click node_search_ui "https://github.com/bk-nexus/tickbron/blob/master/frontend/src/pages/SearchResultsPage.tsx"
click node_property_ui "https://github.com/bk-nexus/tickbron/blob/master/frontend/src/pages/PropertyDetailPage.tsx"
click node_booking_ui "https://github.com/bk-nexus/tickbron/blob/master/frontend/src/pages/BookingPage.tsx"
click node_bookings_ui "https://github.com/bk-nexus/tickbron/blob/master/frontend/src/pages/BookingsPage.tsx"
click node_property_search "https://github.com/bk-nexus/tickbron/blob/master/backend/properties/search.py"
click node_properties "https://github.com/bk-nexus/tickbron/blob/master/backend/properties/models.py"
click node_booking_logic "https://github.com/bk-nexus/tickbron/blob/master/backend/bookings/models.py"
click node_pricing "https://github.com/bk-nexus/tickbron/blob/master/backend/bookings/pricing.py"
click node_booking_state "https://github.com/bk-nexus/tickbron/blob/master/backend/bookings/state_machine.py"
click node_booking_tasks "https://github.com/bk-nexus/tickbron/blob/master/backend/bookings/tasks.py"
click node_payment_webhooks "https://github.com/bk-nexus/tickbron/blob/master/backend/payments/webhooks.py"
click node_payment_adapters "https://github.com/bk-nexus/tickbron/blob/master/backend/payments/adapters.py"
click node_payment_records "https://github.com/bk-nexus/tickbron/blob/master/backend/payments/models.py"
click node_partner_ui "https://github.com/bk-nexus/tickbron/blob/master/frontend/src/pages/PartnerDashboardPage.tsx"
click node_admin_ui "https://github.com/bk-nexus/tickbron/blob/master/frontend/src/pages/AdminDashboardPage.tsx"
click node_promotions "https://github.com/bk-nexus/tickbron/blob/master/backend/promotions/service.py"
click node_promotion_tasks "https://github.com/bk-nexus/tickbron/blob/master/backend/promotions/tasks.py"
click node_accounts "https://github.com/bk-nexus/tickbron/blob/master/backend/accounts/models.py"
click node_auth_ui "https://github.com/bk-nexus/tickbron/blob/master/frontend/src/contexts/AuthContext.tsx"
click node_translations "https://github.com/bk-nexus/tickbron/blob/master/frontend/src/i18n/I18nContext.tsx"
click node_exchange_rates "https://github.com/bk-nexus/tickbron/blob/master/backend/currency/rates.py"

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_search_ui,node_property_ui,node_property_search,node_properties toneBlue
class node_booking_ui,node_bookings_ui,node_booking_logic,node_pricing,node_booking_state,node_booking_tasks,node_payment_webhooks,node_payment_adapters,node_payment_records,node_database toneAmber
class node_partner_ui,node_admin_ui,node_promotions,node_promotion_tasks toneMint
class node_accounts,node_auth_ui,node_translations,node_exchange_rates toneRose
class node_guest toneIndigo
```

## Components

### Guest experience

- [Application routes](https://github.com/bk-nexus/tickbron/blob/master/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Property search](https://github.com/bk-nexus/tickbron/blob/master/frontend/src/pages/SearchResultsPage.tsx): `frontend/src/pages/SearchResultsPage.tsx`
- [Property details](https://github.com/bk-nexus/tickbron/blob/master/frontend/src/pages/PropertyDetailPage.tsx): `frontend/src/pages/PropertyDetailPage.tsx`
- [Property search service](https://github.com/bk-nexus/tickbron/blob/master/backend/properties/search.py): `backend/properties/search.py`
- [Property catalogue](https://github.com/bk-nexus/tickbron/blob/master/backend/properties/models.py): `backend/properties/models.py`

### Booking and payments

- [Booking checkout](https://github.com/bk-nexus/tickbron/blob/master/frontend/src/pages/BookingPage.tsx): `frontend/src/pages/BookingPage.tsx`
- [Guest bookings](https://github.com/bk-nexus/tickbron/blob/master/frontend/src/pages/BookingsPage.tsx): `frontend/src/pages/BookingsPage.tsx`
- [Booking lifecycle](https://github.com/bk-nexus/tickbron/blob/master/backend/bookings/models.py): `backend/bookings/models.py`
- [Booking pricing](https://github.com/bk-nexus/tickbron/blob/master/backend/bookings/pricing.py): `backend/bookings/pricing.py`
- [Booking state rules](https://github.com/bk-nexus/tickbron/blob/master/backend/bookings/state_machine.py): `backend/bookings/state_machine.py`
- [Booking scheduled tasks](https://github.com/bk-nexus/tickbron/blob/master/backend/bookings/tasks.py): `backend/bookings/tasks.py`
- [Payment webhooks](https://github.com/bk-nexus/tickbron/blob/master/backend/payments/webhooks.py): `backend/payments/webhooks.py`
- [Payment provider adapters](https://github.com/bk-nexus/tickbron/blob/master/backend/payments/adapters.py): `backend/payments/adapters.py`
- [Payment records](https://github.com/bk-nexus/tickbron/blob/master/backend/payments/models.py): `backend/payments/models.py`

### Hotel operations

- [Partner dashboard](https://github.com/bk-nexus/tickbron/blob/master/frontend/src/pages/PartnerDashboardPage.tsx): `frontend/src/pages/PartnerDashboardPage.tsx`
- [Admin dashboard](https://github.com/bk-nexus/tickbron/blob/master/frontend/src/pages/AdminDashboardPage.tsx): `frontend/src/pages/AdminDashboardPage.tsx`
- [Promotion rules](https://github.com/bk-nexus/tickbron/blob/master/backend/promotions/service.py): `backend/promotions/service.py`
- [Promotion scheduled task](https://github.com/bk-nexus/tickbron/blob/master/backend/promotions/tasks.py): `backend/promotions/tasks.py`

### Accounts and platform

- [Accounts and reviews](https://github.com/bk-nexus/tickbron/blob/master/backend/accounts/models.py): `backend/accounts/models.py`
- [Authentication context](https://github.com/bk-nexus/tickbron/blob/master/frontend/src/contexts/AuthContext.tsx): `frontend/src/contexts/AuthContext.tsx`
- [Localization provider](https://github.com/bk-nexus/tickbron/blob/master/frontend/src/i18n/I18nContext.tsx): `frontend/src/i18n/I18nContext.tsx`
- [Currency rates](https://github.com/bk-nexus/tickbron/blob/master/backend/currency/rates.py): `backend/currency/rates.py`

### Other components

- **Guest**
- **Database**

## Connections

- Guest → Application routes: uses (evidence: `frontend/src/App.tsx`)
- Application routes → Property search: routes to (evidence: `frontend/src/App.tsx`)
- Application routes → Property details: routes to (evidence: `frontend/src/App.tsx`)
- Application routes → Booking checkout: routes to (evidence: `frontend/src/App.tsx`)
- Application routes → Guest bookings: routes to (evidence: `frontend/src/App.tsx`)
- Application routes → Partner dashboard: routes to (evidence: `frontend/src/App.tsx`)
- Application routes → Admin dashboard: routes to (evidence: `frontend/src/App.tsx`)
- Application routes → Authentication context: provides context (evidence: `frontend/src/App.tsx`)
- Application routes → Localization provider: provides context (evidence: `frontend/src/App.tsx`)
- Property search service → Property catalogue: queries (evidence: `backend/properties/search.py`)
- Booking lifecycle → Property catalogue: uses property data (evidence: `backend/bookings/models.py`)
- Booking lifecycle → Booking pricing: uses pricing (evidence: `backend/bookings/models.py`)
- Booking lifecycle → Booking state rules: validates transitions (evidence: `backend/bookings/models.py`)
- Booking lifecycle → Currency rates: reads rates (evidence: `backend/bookings/models.py`)
- Booking lifecycle → Payment records: uses payment records (evidence: `backend/bookings/models.py`)
- Booking scheduled tasks → Booking lifecycle: processes expirations (evidence: `backend/bookings/tasks.py`)
- Booking scheduled tasks → Booking lifecycle: completes stays (evidence: `backend/bookings/tasks.py`)
- Payment webhooks → Payment provider adapters: gets adapter (evidence: `backend/payments/webhooks.py`)
- Payment webhooks → Payment records: updates records (evidence: `backend/payments/webhooks.py`)
- Payment webhooks → Booking lifecycle: updates booking (evidence: `backend/payments/webhooks.py`)
- Promotion rules → Property catalogue: locks property (evidence: `backend/promotions/service.py`)
- Promotion scheduled task → Promotion rules: runs cleanup (evidence: `backend/promotions/tasks.py`)
- Accounts and reviews → Database: persists
- Property catalogue → Database: persists
- Booking lifecycle → Database: persists
- Payment records → Database: persists
- Property search → Property search service: requests search
- Property details → Property catalogue: requests details
- Booking checkout → Booking lifecycle: submits booking
- Booking checkout → Payment provider adapters: initiates payment
- Partner dashboard → Promotion rules: manages promotions
