# bhavik-ksvss/real-time-ticket-booking-sync-gcp architecture

> Architecture diagram of the GitHub repository bhavik-ksvss/real-time-ticket-booking-sync-gcp, 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/bhavik-ksvss/real-time-ticket-booking-sync-gcp
- Repository: https://github.com/bhavik-ksvss/real-time-ticket-booking-sync-gcp

## Overview

This small project demonstrates a mock-data-to-BigQuery workflow: it generates records and publishes them to Google Cloud Pub/Sub, while a separate UDF cleans and enriches records and a SQL file defines a BigQuery table. The publisher’s generation and publish calls are visible in source. The README describes the BigQuery goal, but the available files do not show a subscription, UDF invocation, or load step connecting Pub/Sub to BigQuery; those links are therefore unverified.

Main entry points: [`irctc_mock_data_to_pubsub.py`](https://github.com/bhavik-ksvss/real-time-ticket-booking-sync-gcp/blob/main/irctc_mock_data_to_pubsub.py) (Pub/Sub Publisher), [`transform_udf.py`](https://github.com/bhavik-ksvss/real-time-ticket-booking-sync-gcp/blob/main/transform_udf.py) (Record Transform UDF), [`bigquery_create_table.sql`](https://github.com/bhavik-ksvss/real-time-ticket-booking-sync-gcp/blob/main/bigquery_create_table.sql) (BigQuery Table Definition)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Data Ingestion"]
  node_generator["Mock Data Generator"]
  node_publisher["Pub/Sub Publisher"]
  node_pubsub["Google Cloud Pub/Sub"]
end

subgraph group_processing["Record Processing"]
  node_transform["Record Transform UDF<br/>[transform_udf.py]"]
end

subgraph group_warehouse["BigQuery Warehouse"]
  node_table[("BigQuery Table Definition")]
end

node_operator(("Script Operator"))

node_operator -->|"runs generation"| node_generator
node_generator -->|"returns records"| node_publisher
node_operator -->|"publishes records"| node_publisher
node_publisher -->|"publishes messages"| node_pubsub
node_pubsub -.->|"invokes transform"| node_transform
node_transform -.->|"loads records"| node_table

click node_generator "https://github.com/bhavik-ksvss/real-time-ticket-booking-sync-gcp/blob/main/irctc_mock_data_to_pubsub.py"
click node_publisher "https://github.com/bhavik-ksvss/real-time-ticket-booking-sync-gcp/blob/main/irctc_mock_data_to_pubsub.py"
click node_transform "https://github.com/bhavik-ksvss/real-time-ticket-booking-sync-gcp/blob/main/transform_udf.py"
click node_table "https://github.com/bhavik-ksvss/real-time-ticket-booking-sync-gcp/blob/main/bigquery_create_table.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_generator,node_publisher,node_pubsub toneBlue
class node_transform toneAmber
class node_table toneMint
class node_operator toneIndigo
```

## Components

### Data Ingestion

- [Mock Data Generator](https://github.com/bhavik-ksvss/real-time-ticket-booking-sync-gcp/blob/main/irctc_mock_data_to_pubsub.py): `irctc_mock_data_to_pubsub.py`
- [Pub/Sub Publisher](https://github.com/bhavik-ksvss/real-time-ticket-booking-sync-gcp/blob/main/irctc_mock_data_to_pubsub.py): `irctc_mock_data_to_pubsub.py`
- **Google Cloud Pub/Sub**

### Record Processing

- [Record Transform UDF](https://github.com/bhavik-ksvss/real-time-ticket-booking-sync-gcp/blob/main/transform_udf.py): `transform_udf.py`

### BigQuery Warehouse

- [BigQuery Table Definition](https://github.com/bhavik-ksvss/real-time-ticket-booking-sync-gcp/blob/main/bigquery_create_table.sql): `bigquery_create_table.sql`

### Other components

- **Script Operator**

## Connections

- Script Operator → Mock Data Generator: runs generation (evidence: `irctc_mock_data_to_pubsub.py`)
- Mock Data Generator → Pub/Sub Publisher: returns records (evidence: `irctc_mock_data_to_pubsub.py`)
- Script Operator → Pub/Sub Publisher: publishes records (evidence: `irctc_mock_data_to_pubsub.py`)
- Pub/Sub Publisher → Google Cloud Pub/Sub: publishes messages (evidence: `irctc_mock_data_to_pubsub.py`)
- Google Cloud Pub/Sub → Record Transform UDF: invokes transform
- Record Transform UDF → BigQuery Table Definition: loads records
