# namantenguria/mini-supercell-platform architecture

> Architecture diagram of the GitHub repository namantenguria/mini-supercell-platform, 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/namantenguria/mini-supercell-platform
- Repository: https://github.com/namantenguria/mini-supercell-platform

## Overview

Mini Supercell Platform generates mobile-game telemetry, streams it through a processor, stores raw events, validates their quality, transforms them into analytics marts, and presents them in Metabase. The graph preserves the documented DAU, session, experiment, and retention capabilities, as well as MinIO archival and fraud checks. Several implementation files were not sampled; relationships based only on README descriptions are cited there, and uncertain model-to-model flow is marked dashed.

Main entry points: [`dbt/game_dbt/models/staging/stg_events.sql`](https://github.com/namantenguria/mini-supercell-platform/blob/master/dbt/game_dbt/models/staging/stg_events.sql) (Event staging), [`services/processor/processor.py`](https://github.com/namantenguria/mini-supercell-platform/blob/master/services/processor/processor.py) (Stream processor), [`docker/docker-compose.yml`](https://github.com/namantenguria/mini-supercell-platform/blob/master/docker/docker-compose.yml) (Metabase dashboards), [`warehouse/schema.sql`](https://github.com/namantenguria/mini-supercell-platform/blob/master/warehouse/schema.sql) (PostgreSQL raw events)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Event ingestion"]
  node_generator["Event generator<br/>[generate.py]"]
  node_redpanda["Redpanda / Kafka<br/>[docker-compose.yml]"]
  node_processor["Stream processor<br/>[processor.py]"]
  node_fraud["Fraud checks<br/>[processor.py]"]
end

subgraph group_storage["Raw storage"]
  node_minio[("MinIO event archive<br/>[docker-compose.yml]")]
  node_postgres[("PostgreSQL raw events<br/>[schema.sql]")]
end

subgraph group_analytics["Quality and analytics"]
  node_quality["Event quality gate"]
  node_staging["Event staging<br/>[stg_events.sql]"]
  node_dau["DAU metrics"]
  node_sessions["Session metrics<br/>[sessions.sql]"]
  node_experiments["Experiment metrics"]
  node_retention["Retention cohorts"]
end

subgraph group_presentation["Business insights"]
  node_metabase["Metabase dashboards<br/>[docker-compose.yml]"]
end

node_player(("Simulated players"))

node_player -->|"simulates actions"| node_generator
node_generator -->|"publishes events"| node_redpanda
node_redpanda -->|"streams events"| node_processor
node_processor -->|"checks purchases"| node_fraud
node_processor -->|"archives payloads"| node_minio
node_processor -->|"writes events"| node_postgres
node_quality -->|"validates events"| node_postgres
node_postgres -->|"transforms raw data"| node_staging
node_staging -.->|"feeds metrics"| node_dau
node_staging -.->|"feeds metrics"| node_sessions
node_staging -.->|"feeds metrics"| node_experiments
node_staging -.->|"feeds cohorts"| node_retention
node_quality -->|"gates dbt runs"| node_staging
node_dau -->|"supplies dashboards"| node_metabase
node_sessions -->|"supplies dashboards"| node_metabase
node_experiments -->|"supplies dashboards"| node_metabase
node_retention -->|"supplies dashboards"| node_metabase

click node_generator "https://github.com/namantenguria/mini-supercell-platform/blob/master/services/event_generator/generate.py"
click node_redpanda "https://github.com/namantenguria/mini-supercell-platform/blob/master/docker/docker-compose.yml"
click node_processor "https://github.com/namantenguria/mini-supercell-platform/blob/master/services/processor/processor.py"
click node_fraud "https://github.com/namantenguria/mini-supercell-platform/blob/master/services/processor/processor.py"
click node_minio "https://github.com/namantenguria/mini-supercell-platform/blob/master/docker/docker-compose.yml"
click node_postgres "https://github.com/namantenguria/mini-supercell-platform/blob/master/warehouse/schema.sql"
click node_quality "https://github.com/namantenguria/mini-supercell-platform/blob/master/quality/run_quality_checks.py"
click node_staging "https://github.com/namantenguria/mini-supercell-platform/blob/master/dbt/game_dbt/models/staging/stg_events.sql"
click node_dau "https://github.com/namantenguria/mini-supercell-platform/blob/master/dbt/game_dbt/models/marts/daily_active_users.sql"
click node_sessions "https://github.com/namantenguria/mini-supercell-platform/blob/master/dbt/game_dbt/models/marts/sessions.sql"
click node_experiments "https://github.com/namantenguria/mini-supercell-platform/blob/master/dbt/game_dbt/models/marts/experiment_metrics.sql"
click node_retention "https://github.com/namantenguria/mini-supercell-platform/blob/master/dbt/game_dbt/models/marts/retention_cohorts.sql"
click node_metabase "https://github.com/namantenguria/mini-supercell-platform/blob/master/docker/docker-compose.yml"

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,node_redpanda,node_processor,node_fraud toneBlue
class node_minio,node_postgres toneAmber
class node_quality,node_staging,node_dau,node_sessions,node_experiments,node_retention toneMint
class node_metabase toneRose
class node_player toneIndigo
```

## Components

### Event ingestion

- [Event generator](https://github.com/namantenguria/mini-supercell-platform/blob/master/services/event_generator/generate.py): `services/event_generator/generate.py`
- [Redpanda / Kafka](https://github.com/namantenguria/mini-supercell-platform/blob/master/docker/docker-compose.yml): `docker/docker-compose.yml`
- [Stream processor](https://github.com/namantenguria/mini-supercell-platform/blob/master/services/processor/processor.py): `services/processor/processor.py`
- [Fraud checks](https://github.com/namantenguria/mini-supercell-platform/blob/master/services/processor/processor.py): `services/processor/processor.py`

### Raw storage

- [MinIO event archive](https://github.com/namantenguria/mini-supercell-platform/blob/master/docker/docker-compose.yml): `docker/docker-compose.yml`
- [PostgreSQL raw events](https://github.com/namantenguria/mini-supercell-platform/blob/master/warehouse/schema.sql): `warehouse/schema.sql`

### Quality and analytics

- [Event quality gate](https://github.com/namantenguria/mini-supercell-platform/blob/master/quality/run_quality_checks.py): `quality/run_quality_checks.py`
- [Event staging](https://github.com/namantenguria/mini-supercell-platform/blob/master/dbt/game_dbt/models/staging/stg_events.sql): `dbt/game_dbt/models/staging/stg_events.sql`
- [DAU metrics](https://github.com/namantenguria/mini-supercell-platform/blob/master/dbt/game_dbt/models/marts/daily_active_users.sql): `dbt/game_dbt/models/marts/daily_active_users.sql`
- [Session metrics](https://github.com/namantenguria/mini-supercell-platform/blob/master/dbt/game_dbt/models/marts/sessions.sql): `dbt/game_dbt/models/marts/sessions.sql`
- [Experiment metrics](https://github.com/namantenguria/mini-supercell-platform/blob/master/dbt/game_dbt/models/marts/experiment_metrics.sql): `dbt/game_dbt/models/marts/experiment_metrics.sql`
- [Retention cohorts](https://github.com/namantenguria/mini-supercell-platform/blob/master/dbt/game_dbt/models/marts/retention_cohorts.sql): `dbt/game_dbt/models/marts/retention_cohorts.sql`

### Business insights

- [Metabase dashboards](https://github.com/namantenguria/mini-supercell-platform/blob/master/docker/docker-compose.yml): `docker/docker-compose.yml`

### Other components

- **Simulated players**

## Connections

- Simulated players → Event generator: simulates actions (evidence: `README.md`)
- Event generator → Redpanda / Kafka: publishes events (evidence: `services/event_generator/generate.py`)
- Redpanda / Kafka → Stream processor: streams events (evidence: `README.md`)
- Stream processor → Fraud checks: checks purchases (evidence: `README.md`)
- Stream processor → MinIO event archive: archives payloads (evidence: `README.md`)
- Stream processor → PostgreSQL raw events: writes events (evidence: `README.md`)
- Event quality gate → PostgreSQL raw events: validates events (evidence: `quality/run_quality_checks.py`)
- PostgreSQL raw events → Event staging: transforms raw data (evidence: `README.md`)
- Event staging → DAU metrics: feeds metrics
- Event staging → Session metrics: feeds metrics
- Event staging → Experiment metrics: feeds metrics
- Event staging → Retention cohorts: feeds cohorts
- Event quality gate → Event staging: gates dbt runs (evidence: `README.md`)
- DAU metrics → Metabase dashboards: supplies dashboards (evidence: `README.md`)
- Session metrics → Metabase dashboards: supplies dashboards (evidence: `README.md`)
- Experiment metrics → Metabase dashboards: supplies dashboards (evidence: `README.md`)
- Retention cohorts → Metabase dashboards: supplies dashboards (evidence: `README.md`)
