# firstgear/realtime-claim-analytics architecture

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

- Interactive diagram: https://gitdiagram.com/firstgear/realtime-claim-analytics
- Repository: https://github.com/firstgear/realtime-claim-analytics

## Overview

This small project generates synthetic insurance-claim events and publishes them to Kafka; the README describes Spark streaming analytics as a future consumer. The producer source shows event fields, JSON serialization, topic publishing, and retrying broker connection setup. Spark is documented but not implemented in the shown source, so that link is documented rather than verified in code.

Main entry points: [`producer/producer.py`](https://github.com/firstgear/realtime-claim-analytics/blob/main/producer/producer.py) (Claim event generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_producer["Claim producer"]
  node_generator["Claim event generator<br/>[producer.py]"]
end

subgraph group_streaming["Streaming platform"]
  node_kafka["Kafka broker"]
  node_spark["Planned Spark analytics"]
end

node_generator -->|"publishes events"| node_kafka
node_kafka -.->|"feeds analytics"| node_spark

click node_generator "https://github.com/firstgear/realtime-claim-analytics/blob/main/producer/producer.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_generator toneBlue
class node_kafka,node_spark toneAmber
```

## Components

### Claim producer

- [Claim event generator](https://github.com/firstgear/realtime-claim-analytics/blob/main/producer/producer.py): `producer/producer.py`

### Streaming platform

- **Kafka broker**
- **Planned Spark analytics**

## Connections

- Claim event generator → Kafka broker: publishes events (evidence: `producer/producer.py`)
- Kafka broker → Planned Spark analytics: feeds analytics (evidence: `README.md`)
