# rl1m4/kafka architecture

> Architecture diagram of the GitHub repository rl1m4/kafka, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rl1m4/kafka
- Repository: https://github.com/rl1m4/kafka

## Overview

##### Project type and purpose
- This is an event-driven, microservice proof-of-concept built with Spring Boot and Spring Kafka.
- Its goal is to demonstrate how a Producer application pushes messages to Kafka, how a Consumer application processes them, and—via the attic examples—how analytics or transactional use cases can be layered on top.

##### File structure
- Top-level “producer/” and “consumer/” directories each contain a Spring Boot service with Maven wrappers, source code, tests, and application.properties.
- A docker-compose.yml defines the Kafka broker (and Zookeeper).
- Shell scripts (native.sh, save.sh, load.sh, test.sh) automate builds, runs, and tests.
- The attic/analytics and attic/spring-kafka folders are archived examples showing further evolution (analytics pipeline, transactional Kafka usage).

##### README for additional insights
- The README’s single line confirms intent: “integrate Spring and Apache Kafka.”

##### Detail is key
- Application.properties to note bootstrap.servers and consumer.group-id.
- That each service runs in its own container (label containers).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Orchestration & Infrastructure
    subgraph "Orchestration & Infrastructure"
        DC[/"Docker Compose"\]:::orchestration
        ZK[(Zookeeper)]:::messaging
        KB[(Kafka Broker)]:::messaging
    end

    %% Core Microservices
    subgraph "Core Microservices"
        PS["Producer Service"]:::service
        CS["Consumer Service"]:::service
    end

    %% Archived Samples
    subgraph "Archived Samples"
        AS["Analytics Service"]:::service
        TS["Transactional Kafka Example"]:::service
    end

    %% Scripts & CI
    subgraph "Scripts & CI"
        NB["GraalVM Native Build"]:::scripts
        SS["Save State"]:::scripts
        LS["Bulk Load"]:::scripts
        TScr["End-to-End Test"]:::scripts
    end

    %% Infrastructure Connections
    DC -->|orchestrates| ZK
    DC -->|orchestrates| KB

    %% Data Flow
    PS -->|publishes to topic| KB
    KB -->|subscribes| CS
    CS -->|forwards to topic| KB
    KB -->|subscribes| AS
    KB -->|transactional demo| TS

    %% Click Events
    click PS "https://github.com/rl1m4/kafka/tree/main/producer/"
    click CS "https://github.com/rl1m4/kafka/tree/main/consumer/"
    click DC "https://github.com/rl1m4/kafka/blob/main/docker-compose.yml"
    click AS "https://github.com/rl1m4/kafka/tree/main/attic/analytics/"
    click TS "https://github.com/rl1m4/kafka/tree/main/attic/spring-kafka/"
    click NB "https://github.com/rl1m4/kafka/blob/main/native.sh"
    click SS "https://github.com/rl1m4/kafka/blob/main/save.sh"
    click LS "https://github.com/rl1m4/kafka/blob/main/load.sh"
    click TScr "https://github.com/rl1m4/kafka/blob/main/test.sh"

    %% Styles
    classDef service fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef messaging fill:#FFA500,stroke:#000,stroke-width:1px;
    classDef orchestration fill:#D3D3D3,stroke:#000,stroke-width:1px;
    classDef scripts fill:#90EE90,stroke:#000,stroke-width:1px;
```
