# streamnative/examples architecture

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

- Interactive diagram: https://gitdiagram.com/streamnative/examples
- Repository: https://github.com/streamnative/examples

## Overview

This repository is a curated collection of messaging and event-streaming demos, not one integrated application. Its principal workflow is to configure a client, produce events to a broker, and consume or administer them; the taxi utility adds a distinct CSV-download, parse, and publish workflow. Kafka examples also cover serialization, consumer groups, and transactions. README-listed capabilities without corresponding files in the supplied tree are omitted; sampled source supports the specific wiring shown here, while other demo branches are inferred only from filenames.

Main entry points: [`cloud_kafka`](https://github.com/streamnative/examples/tree/master/cloud_kafka) (Kafka client demos), [`cloud`](https://github.com/streamnative/examples/tree/master/cloud) (Cloud Pulsar clients), [`nyctaxi/taxidata/main.go`](https://github.com/streamnative/examples/blob/master/nyctaxi/taxidata/main.go) (Taxi ingestion CLI), [`cloud/go/ccloud/client.go`](https://github.com/streamnative/examples/blob/master/cloud/go/ccloud/client.go) (OAuth client setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pulsar["Pulsar demos"]
  node_cloud_pulsar["Cloud Pulsar clients"]
  node_tls_pulsar["TLS Pulsar clients"]
  node_amqp_pulsar["AMQP 0-9-1 clients"]
  node_oauth_config["OAuth client setup<br/>[client.go]"]
  node_pulsar_producer["Pulsar producers<br/>[sampleProducer.go]"]
  node_pulsar_consumer["Pulsar consumers<br/>[sampleConsumer.go]"]
end

subgraph group_kafka["Kafka demos"]
  node_kafka_clients["Kafka client demos"]
  node_kafka_producer["Producer examples<br/>[main.go]"]
  node_kafka_consumer["Consumer groups<br/>[main.go]"]
  node_kafka_admin["Topic administration"]
  node_kafka_formats["Schema formats"]
  node_kafka_transactions["Transactional examples<br/>[main.go]"]
  node_kafka_http["HTTP event logging<br/>[main.go]"]
end

subgraph group_ingest["Data ingestion"]
  node_taxi_cli["Taxi ingestion CLI<br/>[main.go]"]
  node_taxi_types["Taxi record schemas"]
end

node_developer(("Demo user"))
node_pulsar_broker[("Pulsar service")]
node_identity["OAuth identity provider"]
node_kafka_broker[("Kafka cluster")]
node_taxi_source["NYC taxi CSV data"]

node_developer -->|"runs demos"| node_cloud_pulsar
node_developer -->|"runs demos"| node_tls_pulsar
node_developer -->|"runs demos"| node_amqp_pulsar
node_cloud_pulsar -->|"creates client"| node_oauth_config
node_oauth_config -.->|"requests credentials"| node_identity
node_oauth_config -->|"connects"| node_pulsar_broker
node_cloud_pulsar -->|"includes"| node_pulsar_producer
node_cloud_pulsar -->|"includes"| node_pulsar_consumer
node_pulsar_producer -->|"publishes messages"| node_pulsar_broker
node_pulsar_broker -->|"delivers messages"| node_pulsar_consumer
node_tls_pulsar -->|"connects securely"| node_pulsar_broker
node_amqp_pulsar -->|"connects"| node_pulsar_broker
node_developer -->|"runs demos"| node_kafka_clients
node_kafka_clients -->|"includes"| node_kafka_producer
node_kafka_clients -->|"includes"| node_kafka_consumer
node_kafka_clients -->|"includes"| node_kafka_admin
node_kafka_clients -->|"includes"| node_kafka_formats
node_kafka_clients -->|"includes"| node_kafka_transactions
node_kafka_producer -->|"publishes messages"| node_kafka_broker
node_kafka_broker -->|"delivers messages"| node_kafka_consumer
node_kafka_admin -->|"administers topics"| node_kafka_broker
node_kafka_formats -->|"publishes records"| node_kafka_broker
node_kafka_transactions -->|"transacts messages"| node_kafka_broker
node_kafka_http -->|"writes events"| node_kafka_broker
node_developer -->|"runs ingestion"| node_taxi_cli
node_taxi_cli -->|"downloads CSV"| node_taxi_source
node_taxi_cli -->|"uses schemas"| node_taxi_types
node_taxi_cli -->|"publishes records"| node_pulsar_broker

click node_cloud_pulsar "https://github.com/streamnative/examples/tree/master/cloud"
click node_tls_pulsar "https://github.com/streamnative/examples/tree/master/tls"
click node_amqp_pulsar "https://github.com/streamnative/examples/tree/master/aop/amqp091-go"
click node_oauth_config "https://github.com/streamnative/examples/blob/master/cloud/go/ccloud/client.go"
click node_pulsar_producer "https://github.com/streamnative/examples/blob/master/cloud/go/sampleProducer.go"
click node_pulsar_consumer "https://github.com/streamnative/examples/blob/master/cloud/go/sampleConsumer.go"
click node_kafka_clients "https://github.com/streamnative/examples/tree/master/cloud_kafka"
click node_kafka_producer "https://github.com/streamnative/examples/blob/master/cloud_kafka/sarama/produce/main.go"
click node_kafka_consumer "https://github.com/streamnative/examples/blob/master/cloud_kafka/sarama/consumergroup/main.go"
click node_kafka_admin "https://github.com/streamnative/examples/tree/master/cloud_kafka/confluent-kafka-go/admin_create_topic"
click node_kafka_formats "https://github.com/streamnative/examples/tree/master/cloud_kafka/confluent-kafka-go/avro_generic_producer_example"
click node_kafka_transactions "https://github.com/streamnative/examples/blob/master/cloud_kafka/sarama/exactly_once/main.go"
click node_kafka_http "https://github.com/streamnative/examples/blob/master/cloud_kafka/sarama/http_server/main.go"
click node_taxi_cli "https://github.com/streamnative/examples/blob/master/nyctaxi/taxidata/main.go"
click node_taxi_types "https://github.com/streamnative/examples/tree/master/nyctaxi/taxidata/pkg/types"

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_cloud_pulsar,node_tls_pulsar,node_amqp_pulsar,node_oauth_config,node_pulsar_producer,node_pulsar_consumer,node_developer toneBlue
class node_kafka_clients,node_kafka_producer,node_kafka_consumer,node_kafka_admin,node_kafka_formats,node_kafka_transactions,node_kafka_http,node_pulsar_broker,node_kafka_broker toneAmber
class node_taxi_cli,node_taxi_types toneMint
class node_identity,node_taxi_source toneIndigo
```

## Components

### Pulsar demos

- [Cloud Pulsar clients](https://github.com/streamnative/examples/tree/master/cloud): `cloud`
- [TLS Pulsar clients](https://github.com/streamnative/examples/tree/master/tls): `tls`
- [AMQP 0-9-1 clients](https://github.com/streamnative/examples/tree/master/aop/amqp091-go): `aop/amqp091-go`
- [OAuth client setup](https://github.com/streamnative/examples/blob/master/cloud/go/ccloud/client.go): `cloud/go/ccloud/client.go`
- [Pulsar producers](https://github.com/streamnative/examples/blob/master/cloud/go/sampleProducer.go): `cloud/go/sampleProducer.go`
- [Pulsar consumers](https://github.com/streamnative/examples/blob/master/cloud/go/sampleConsumer.go): `cloud/go/sampleConsumer.go`

### Kafka demos

- [Kafka client demos](https://github.com/streamnative/examples/tree/master/cloud_kafka): `cloud_kafka`
- [Producer examples](https://github.com/streamnative/examples/blob/master/cloud_kafka/sarama/produce/main.go): `cloud_kafka/sarama/produce/main.go`
- [Consumer groups](https://github.com/streamnative/examples/blob/master/cloud_kafka/sarama/consumergroup/main.go): `cloud_kafka/sarama/consumergroup/main.go`
- [Topic administration](https://github.com/streamnative/examples/tree/master/cloud_kafka/confluent-kafka-go/admin_create_topic): `cloud_kafka/confluent-kafka-go/admin_create_topic`
- [Schema formats](https://github.com/streamnative/examples/tree/master/cloud_kafka/confluent-kafka-go/avro_generic_producer_example): `cloud_kafka/confluent-kafka-go/avro_generic_producer_example`
- [Transactional examples](https://github.com/streamnative/examples/blob/master/cloud_kafka/sarama/exactly_once/main.go): `cloud_kafka/sarama/exactly_once/main.go`
- [HTTP event logging](https://github.com/streamnative/examples/blob/master/cloud_kafka/sarama/http_server/main.go): `cloud_kafka/sarama/http_server/main.go`

### Data ingestion

- [Taxi ingestion CLI](https://github.com/streamnative/examples/blob/master/nyctaxi/taxidata/main.go): `nyctaxi/taxidata/main.go`
- [Taxi record schemas](https://github.com/streamnative/examples/tree/master/nyctaxi/taxidata/pkg/types): `nyctaxi/taxidata/pkg/types`

### Other components

- **Demo user**
- **Pulsar service**
- **OAuth identity provider**
- **Kafka cluster**
- **NYC taxi CSV data**

## Connections

- Demo user → Cloud Pulsar clients: runs demos
- Demo user → TLS Pulsar clients: runs demos
- Demo user → AMQP 0-9-1 clients: runs demos
- Cloud Pulsar clients → OAuth client setup: creates client
- OAuth client setup → OAuth identity provider: requests credentials
- OAuth client setup → Pulsar service: connects
- Cloud Pulsar clients → Pulsar producers: includes
- Cloud Pulsar clients → Pulsar consumers: includes
- Pulsar producers → Pulsar service: publishes messages
- Pulsar service → Pulsar consumers: delivers messages
- TLS Pulsar clients → Pulsar service: connects securely
- AMQP 0-9-1 clients → Pulsar service: connects
- Demo user → Kafka client demos: runs demos
- Kafka client demos → Producer examples: includes
- Kafka client demos → Consumer groups: includes
- Kafka client demos → Topic administration: includes
- Kafka client demos → Schema formats: includes
- Kafka client demos → Transactional examples: includes
- Producer examples → Kafka cluster: publishes messages
- Kafka cluster → Consumer groups: delivers messages
- Topic administration → Kafka cluster: administers topics
- Schema formats → Kafka cluster: publishes records
- Transactional examples → Kafka cluster: transacts messages
- HTTP event logging → Kafka cluster: writes events
- Demo user → Taxi ingestion CLI: runs ingestion
- Taxi ingestion CLI → NYC taxi CSV data: downloads CSV
- Taxi ingestion CLI → Taxi record schemas: uses schemas
- Taxi ingestion CLI → Pulsar service: publishes records
