# fakhahmed/pipeline-streaming architecture

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

- Interactive diagram: https://gitdiagram.com/fakhahmed/pipeline-streaming
- Repository: https://github.com/fakhahmed/pipeline-streaming

## Overview

Le dépôt implémente un pipeline de détection de fraude : un générateur publie des transactions Avro, Flink les traite par fenêtres temporelles, calcule un score ML et route les résultats vers le lac analytique, les alertes et une DLQ. Les appels et transferts représentés sont visibles dans les extraits. BigQuery est cité comme usage futur dans le README, mais aucune implémentation n’est montrée ; le routage multi-sink décrit par le README est représenté par ses trois branches visibles.

Main entry points: [`flink_jobs/streaming_job.py`](https://github.com/fakhahmed/pipeline-streaming/blob/main/flink_jobs/streaming_job.py) (Job de streaming), [`producer/main.py`](https://github.com/fakhahmed/pipeline-streaming/blob/main/producer/main.py) (Producteur de transactions), [`producer/alerts_consumer.py`](https://github.com/fakhahmed/pipeline-streaming/blob/main/producer/alerts_consumer.py) (Consommateur d’alertes), [`producer/transaction.avsc`](https://github.com/fakhahmed/pipeline-streaming/blob/main/producer/transaction.avsc) (Contrat Avro)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Ingestion"]
  node_producer["Producteur de transactions<br/>[main.py]"]
  node_schema["Contrat Avro<br/>[transaction.avsc]"]
  node_registry["Schema Registry"]
  node_kafka_input["Topic transactions"]
end

subgraph group_processing["Traitement Flink"]
  node_flink["Job de streaming<br/>[streaming_job.py]"]
  node_windows["Profils temporels<br/>[streaming_job.py]"]
  node_ml["Score fraude UDF<br/>[streaming_job.py]"]
end

subgraph group_outputs["Sorties"]
  node_lake[("Tables Iceberg")]
  node_gcs[("Data Lake GCS")]
  node_warehouse[("BigQuery BI")]
  node_urgent["Topic alertes"]
  node_dlq["Topic DLQ"]
end

subgraph group_notification["Notification"]
  node_consumer["Consommateur d’alertes<br/>[alerts_consumer.py]"]
end

node_bank(("Générateur bancaire"))
node_client(("Client alerté"))

node_bank -->|"génère"| node_producer
node_producer -->|"charge le schéma"| node_schema
node_producer -->|"valide Avro"| node_registry
node_producer -->|"publie transactions"| node_kafka_input
node_kafka_input -->|"alimente"| node_flink
node_flink -->|"calcule fenêtres"| node_windows
node_windows -->|"fournit métriques"| node_ml
node_flink -->|"écrit profils"| node_lake
node_lake -->|"stocke dans"| node_gcs
node_gcs -.->|"alimente analyses"| node_warehouse
node_flink -->|"publie alertes"| node_urgent
node_flink -->|"isole montants négatifs"| node_dlq
node_urgent -->|"consomme alertes"| node_consumer
node_consumer -->|"simule SMS"| node_client

click node_producer "https://github.com/fakhahmed/pipeline-streaming/blob/main/producer/main.py"
click node_schema "https://github.com/fakhahmed/pipeline-streaming/blob/main/producer/transaction.avsc"
click node_flink "https://github.com/fakhahmed/pipeline-streaming/blob/main/flink_jobs/streaming_job.py"
click node_windows "https://github.com/fakhahmed/pipeline-streaming/blob/main/flink_jobs/streaming_job.py"
click node_ml "https://github.com/fakhahmed/pipeline-streaming/blob/main/flink_jobs/streaming_job.py"
click node_consumer "https://github.com/fakhahmed/pipeline-streaming/blob/main/producer/alerts_consumer.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_producer,node_schema,node_registry,node_kafka_input,node_client toneBlue
class node_flink,node_windows,node_ml toneAmber
class node_lake,node_gcs,node_warehouse,node_urgent,node_dlq toneMint
class node_consumer toneRose
class node_bank toneIndigo
```

## Components

### Ingestion

- [Producteur de transactions](https://github.com/fakhahmed/pipeline-streaming/blob/main/producer/main.py): `producer/main.py`
- [Contrat Avro](https://github.com/fakhahmed/pipeline-streaming/blob/main/producer/transaction.avsc): `producer/transaction.avsc`
- **Schema Registry**
- **Topic transactions**

### Traitement Flink

- [Job de streaming](https://github.com/fakhahmed/pipeline-streaming/blob/main/flink_jobs/streaming_job.py): `flink_jobs/streaming_job.py`
- [Profils temporels](https://github.com/fakhahmed/pipeline-streaming/blob/main/flink_jobs/streaming_job.py): `flink_jobs/streaming_job.py`
- [Score fraude UDF](https://github.com/fakhahmed/pipeline-streaming/blob/main/flink_jobs/streaming_job.py): `flink_jobs/streaming_job.py`

### Sorties

- **Tables Iceberg**
- **Data Lake GCS**
- **BigQuery BI**
- **Topic alertes**
- **Topic DLQ**

### Notification

- [Consommateur d’alertes](https://github.com/fakhahmed/pipeline-streaming/blob/main/producer/alerts_consumer.py): `producer/alerts_consumer.py`

### Other components

- **Générateur bancaire**
- **Client alerté**

## Connections

- Générateur bancaire → Producteur de transactions: génère (evidence: `producer/main.py`)
- Producteur de transactions → Contrat Avro: charge le schéma (evidence: `producer/main.py`)
- Producteur de transactions → Schema Registry: valide Avro (evidence: `producer/main.py`)
- Producteur de transactions → Topic transactions: publie transactions (evidence: `producer/main.py`)
- Topic transactions → Job de streaming: alimente (evidence: `flink_jobs/streaming_job.py`)
- Job de streaming → Profils temporels: calcule fenêtres (evidence: `flink_jobs/streaming_job.py`)
- Profils temporels → Score fraude UDF: fournit métriques (evidence: `flink_jobs/streaming_job.py`)
- Job de streaming → Tables Iceberg: écrit profils (evidence: `flink_jobs/streaming_job.py`)
- Tables Iceberg → Data Lake GCS: stocke dans
- Data Lake GCS → BigQuery BI: alimente analyses (evidence: `README.md`)
- Job de streaming → Topic alertes: publie alertes (evidence: `flink_jobs/streaming_job.py`)
- Job de streaming → Topic DLQ: isole montants négatifs (evidence: `flink_jobs/streaming_job.py`)
- Topic alertes → Consommateur d’alertes: consomme alertes (evidence: `producer/alerts_consumer.py`)
- Consommateur d’alertes → Client alerté: simule SMS (evidence: `producer/alerts_consumer.py`)
