# abyshah/fifa-assignment architecture

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

- Interactive diagram: https://gitdiagram.com/abyshah/fifa-assignment
- Repository: https://github.com/abyshah/fifa-assignment

## Overview

This repository collects World Cup data, converts it into match, group-standing, and player-goal event files, then sends events to Dynatrace. The main workflow is collection → normalization → event files → change-aware ingestion. Separate scripts also provide direct match-event ingestion, including a dry-run/limited check variant. The collector and normalizers show the raw-data handoff through generated files, but those raw files are not present in the tree. The README is empty; arrows reflect the sampled source only.

Main entry points: [`send_changed_events_to_dynatrace.py`](https://github.com/abyshah/fifa-assignment/blob/main/send_changed_events_to_dynatrace.py) (Changed-event sender), [`events/match_events.json`](https://github.com/abyshah/fifa-assignment/blob/main/events/match_events.json) (Match events), [`collector.py`](https://github.com/abyshah/fifa-assignment/blob/main/collector.py) (API collector), [`normalize_games.py`](https://github.com/abyshah/fifa-assignment/blob/main/normalize_games.py) (Match normalizer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Data collection"]
  node_collector["API collector<br/>[collector.py]"]
  node_raw_data["Collected snapshots"]
end

subgraph group_normalization["Event normalization"]
  node_match_normalizer["Match normalizer<br/>[normalize_games.py]"]
  node_standing_normalizer["Standings normalizer"]
  node_goal_normalizer["Goal normalizer"]
end

subgraph group_artifacts["Event artifacts"]
  node_match_events["Match events<br/>[match_events.json]"]
  node_standing_events["Standing events"]
  node_goal_events["Goal events"]
end

subgraph group_delivery["Dynatrace delivery"]
  node_change_sender["Changed-event sender"]
  node_send_state[("Sent-event hashes")]
  node_direct_sender["Match sender"]
  node_check_sender["Match check sender"]
end

node_operator(("Operator"))
node_worldcup_api{{"World Cup API"}}
node_dynatrace{{"Dynatrace ingest"}}

node_operator -->|"runs"| node_collector
node_collector -->|"fetches"| node_worldcup_api
node_collector -->|"saves snapshots"| node_raw_data
node_operator -->|"runs"| node_match_normalizer
node_operator -->|"runs"| node_standing_normalizer
node_operator -->|"runs"| node_goal_normalizer
node_raw_data -->|"reads snapshots"| node_match_normalizer
node_raw_data -->|"reads snapshots"| node_standing_normalizer
node_match_normalizer -->|"writes events"| node_match_events
node_standing_normalizer -->|"writes events"| node_standing_events
node_match_events -->|"reads matches"| node_goal_normalizer
node_goal_normalizer -->|"writes events"| node_goal_events
node_operator -->|"runs"| node_change_sender
node_match_events -->|"loads events"| node_change_sender
node_standing_events -->|"loads events"| node_change_sender
node_goal_events -->|"loads events"| node_change_sender
node_change_sender -->|"reads and writes hashes"| node_send_state
node_change_sender -->|"posts changed events"| node_dynatrace
node_operator -->|"runs"| node_direct_sender
node_match_events -->|"loads events"| node_direct_sender
node_direct_sender -->|"posts events"| node_dynatrace
node_operator -->|"runs"| node_check_sender
node_match_events -->|"loads events"| node_check_sender
node_check_sender -->|"posts events"| node_dynatrace

click node_collector "https://github.com/abyshah/fifa-assignment/blob/main/collector.py"
click node_match_normalizer "https://github.com/abyshah/fifa-assignment/blob/main/normalize_games.py"
click node_standing_normalizer "https://github.com/abyshah/fifa-assignment/blob/main/normalize_group_standings.py"
click node_goal_normalizer "https://github.com/abyshah/fifa-assignment/blob/main/normalize_player_goals.py"
click node_match_events "https://github.com/abyshah/fifa-assignment/blob/main/events/match_events.json"
click node_standing_events "https://github.com/abyshah/fifa-assignment/blob/main/events/group_standings_events.json"
click node_goal_events "https://github.com/abyshah/fifa-assignment/blob/main/events/player_goal_events.json"
click node_change_sender "https://github.com/abyshah/fifa-assignment/blob/main/send_changed_events_to_dynatrace.py"
click node_send_state "https://github.com/abyshah/fifa-assignment/blob/main/state/sent_bizevent_hashes.json"
click node_direct_sender "https://github.com/abyshah/fifa-assignment/blob/main/send_to_dynatrace.py"
click node_check_sender "https://github.com/abyshah/fifa-assignment/blob/main/check_match_events.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_collector,node_raw_data toneBlue
class node_match_normalizer,node_standing_normalizer,node_goal_normalizer toneAmber
class node_match_events,node_standing_events,node_goal_events,node_worldcup_api toneMint
class node_change_sender,node_send_state,node_direct_sender,node_check_sender toneRose
class node_operator,node_dynatrace toneIndigo
```

## Components

### Data collection

- [API collector](https://github.com/abyshah/fifa-assignment/blob/main/collector.py): `collector.py`
- **Collected snapshots**

### Event normalization

- [Match normalizer](https://github.com/abyshah/fifa-assignment/blob/main/normalize_games.py): `normalize_games.py`
- [Standings normalizer](https://github.com/abyshah/fifa-assignment/blob/main/normalize_group_standings.py): `normalize_group_standings.py`
- [Goal normalizer](https://github.com/abyshah/fifa-assignment/blob/main/normalize_player_goals.py): `normalize_player_goals.py`

### Event artifacts

- [Match events](https://github.com/abyshah/fifa-assignment/blob/main/events/match_events.json): `events/match_events.json`
- [Standing events](https://github.com/abyshah/fifa-assignment/blob/main/events/group_standings_events.json): `events/group_standings_events.json`
- [Goal events](https://github.com/abyshah/fifa-assignment/blob/main/events/player_goal_events.json): `events/player_goal_events.json`

### Dynatrace delivery

- [Changed-event sender](https://github.com/abyshah/fifa-assignment/blob/main/send_changed_events_to_dynatrace.py): `send_changed_events_to_dynatrace.py`
- [Sent-event hashes](https://github.com/abyshah/fifa-assignment/blob/main/state/sent_bizevent_hashes.json): `state/sent_bizevent_hashes.json`
- [Match sender](https://github.com/abyshah/fifa-assignment/blob/main/send_to_dynatrace.py): `send_to_dynatrace.py`
- [Match check sender](https://github.com/abyshah/fifa-assignment/blob/main/check_match_events.py): `check_match_events.py`

### Other components

- **Operator**
- **World Cup API**
- **Dynatrace ingest**

## Connections

- Operator → API collector: runs (evidence: `collector.py`)
- API collector → World Cup API: fetches (evidence: `collector.py`)
- API collector → Collected snapshots: saves snapshots (evidence: `collector.py`)
- Operator → Match normalizer: runs (evidence: `normalize_games.py`)
- Operator → Standings normalizer: runs (evidence: `normalize_group_standings.py`)
- Operator → Goal normalizer: runs (evidence: `normalize_player_goals.py`)
- Collected snapshots → Match normalizer: reads snapshots (evidence: `normalize_games.py`)
- Collected snapshots → Standings normalizer: reads snapshots (evidence: `normalize_group_standings.py`)
- Match normalizer → Match events: writes events (evidence: `normalize_games.py`)
- Standings normalizer → Standing events: writes events (evidence: `normalize_group_standings.py`)
- Match events → Goal normalizer: reads matches (evidence: `normalize_player_goals.py`)
- Goal normalizer → Goal events: writes events (evidence: `normalize_player_goals.py`)
- Operator → Changed-event sender: runs (evidence: `send_changed_events_to_dynatrace.py`)
- Match events → Changed-event sender: loads events (evidence: `send_changed_events_to_dynatrace.py`)
- Standing events → Changed-event sender: loads events (evidence: `send_changed_events_to_dynatrace.py`)
- Goal events → Changed-event sender: loads events (evidence: `send_changed_events_to_dynatrace.py`)
- Changed-event sender → Sent-event hashes: reads and writes hashes (evidence: `send_changed_events_to_dynatrace.py`)
- Changed-event sender → Dynatrace ingest: posts changed events (evidence: `send_changed_events_to_dynatrace.py`)
- Operator → Match sender: runs (evidence: `send_to_dynatrace.py`)
- Match events → Match sender: loads events (evidence: `send_to_dynatrace.py`)
- Match sender → Dynatrace ingest: posts events (evidence: `send_to_dynatrace.py`)
- Operator → Match check sender: runs (evidence: `check_match_events.py`)
- Match events → Match check sender: loads events (evidence: `check_match_events.py`)
- Match check sender → Dynatrace ingest: posts events (evidence: `check_match_events.py`)
