# faidzabdl/koordinator architecture

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

- Interactive diagram: https://gitdiagram.com/faidzabdl/koordinator
- Repository: https://github.com/faidzabdl/koordinator

## Overview

Coordinated Behavior Investigator is a Streamlit tool for analysts to investigate possible coordinated social-media activity. The workflow is: choose demo or uploaded data, set detection parameters, run the analysis, review cluster summaries and evidence, inspect the interaction graph, and export a PDF or account list. The engine’s documented stages clean and normalize records, find similar posts from different accounts close in time, then cluster accounts and score the results. Sampled source supports the main wiring; some dashboard details and engine internals are documented in the README rather than fully shown in excerpts.

Main entry points: [`app.py`](https://github.com/faidzabdl/koordinator/blob/main/app.py) (Streamlit app), [`viz.py`](https://github.com/faidzabdl/koordinator/blob/main/viz.py) (Build network graph), [`engine.py`](https://github.com/faidzabdl/koordinator/blob/main/engine.py) (Prepare records), [`generate_demo_data.py`](https://github.com/faidzabdl/koordinator/blob/main/generate_demo_data.py) (Generate simulation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Analyst interface"]
  node_app["Streamlit app<br/>[app.py]"]
  node_source["Data selection<br/>[app.py]"]
  node_controls["Detection controls<br/>[app.py]"]
  node_dashboard["Results dashboard<br/>[app.py]"]
end

subgraph group_engine["Detection engine"]
  node_clean["Prepare records<br/>[engine.py]"]
  node_pairs["Find similar pairs<br/>[engine.py]"]
  node_clusters["Cluster and score<br/>[engine.py]"]
end

subgraph group_outputs["Review and export"]
  node_network["Build network graph<br/>[viz.py]"]
  node_interactive["Interactive graph<br/>[viz.py]"]
  node_static["Static graph fallback<br/>[viz.py]"]
  node_pdf["PDF report<br/>[report.py]"]
  node_account_export["Account CSV export<br/>[app.py]"]
end

subgraph group_demo["Demo data"]
  node_demo_gen["Generate simulation"]
  node_demo_csv["Demo dataset<br/>[tagar_simulasi.csv]"]
end

node_analyst(("Analyst"))

node_analyst -->|"uses"| node_app
node_app -->|"selects data"| node_source
node_app -->|"sets parameters"| node_controls
node_source -->|"loads demo"| node_demo_csv
node_analyst -->|"uploads data"| node_source
node_app -->|"generates if missing"| node_demo_gen
node_demo_gen -->|"writes dataset"| node_demo_csv
node_app -->|"runs analysis"| node_clean
node_clean -->|"prepares for"| node_pairs
node_pairs -->|"feeds detection"| node_clusters
node_clusters -->|"returns results"| node_dashboard
node_app -->|"presents findings"| node_dashboard
node_app -->|"builds graph"| node_network
node_network -->|"renders with PyVis"| node_interactive
node_network -->|"falls back to"| node_static
node_app -->|"exports report"| node_pdf
node_app -->|"exports accounts"| node_account_export

click node_app "https://github.com/faidzabdl/koordinator/blob/main/app.py"
click node_source "https://github.com/faidzabdl/koordinator/blob/main/app.py"
click node_controls "https://github.com/faidzabdl/koordinator/blob/main/app.py"
click node_dashboard "https://github.com/faidzabdl/koordinator/blob/main/app.py"
click node_clean "https://github.com/faidzabdl/koordinator/blob/main/engine.py"
click node_pairs "https://github.com/faidzabdl/koordinator/blob/main/engine.py"
click node_clusters "https://github.com/faidzabdl/koordinator/blob/main/engine.py"
click node_demo_gen "https://github.com/faidzabdl/koordinator/blob/main/generate_demo_data.py"
click node_demo_csv "https://github.com/faidzabdl/koordinator/blob/main/demo_data/tagar_simulasi.csv"
click node_network "https://github.com/faidzabdl/koordinator/blob/main/viz.py"
click node_interactive "https://github.com/faidzabdl/koordinator/blob/main/viz.py"
click node_static "https://github.com/faidzabdl/koordinator/blob/main/viz.py"
click node_pdf "https://github.com/faidzabdl/koordinator/blob/main/report.py"
click node_account_export "https://github.com/faidzabdl/koordinator/blob/main/app.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_app,node_source,node_controls,node_dashboard toneBlue
class node_clean,node_pairs,node_clusters toneAmber
class node_network,node_interactive,node_static,node_pdf,node_account_export toneMint
class node_demo_gen,node_demo_csv toneRose
class node_analyst toneIndigo
```

## Components

### Analyst interface

- [Streamlit app](https://github.com/faidzabdl/koordinator/blob/main/app.py): `app.py`
- [Data selection](https://github.com/faidzabdl/koordinator/blob/main/app.py): `app.py`
- [Detection controls](https://github.com/faidzabdl/koordinator/blob/main/app.py): `app.py`
- [Results dashboard](https://github.com/faidzabdl/koordinator/blob/main/app.py): `app.py`

### Detection engine

- [Prepare records](https://github.com/faidzabdl/koordinator/blob/main/engine.py): `engine.py`
- [Find similar pairs](https://github.com/faidzabdl/koordinator/blob/main/engine.py): `engine.py`
- [Cluster and score](https://github.com/faidzabdl/koordinator/blob/main/engine.py): `engine.py`

### Review and export

- [Build network graph](https://github.com/faidzabdl/koordinator/blob/main/viz.py): `viz.py`
- [Interactive graph](https://github.com/faidzabdl/koordinator/blob/main/viz.py): `viz.py`
- [Static graph fallback](https://github.com/faidzabdl/koordinator/blob/main/viz.py): `viz.py`
- [PDF report](https://github.com/faidzabdl/koordinator/blob/main/report.py): `report.py`
- [Account CSV export](https://github.com/faidzabdl/koordinator/blob/main/app.py): `app.py`

### Demo data

- [Generate simulation](https://github.com/faidzabdl/koordinator/blob/main/generate_demo_data.py): `generate_demo_data.py`
- [Demo dataset](https://github.com/faidzabdl/koordinator/blob/main/demo_data/tagar_simulasi.csv): `demo_data/tagar_simulasi.csv`

### Other components

- **Analyst**

## Connections

- Analyst → Streamlit app: uses (evidence: `README.md`)
- Streamlit app → Data selection: selects data (evidence: `app.py`)
- Streamlit app → Detection controls: sets parameters (evidence: `app.py`)
- Data selection → Demo dataset: loads demo (evidence: `app.py`)
- Analyst → Data selection: uploads data (evidence: `README.md`)
- Streamlit app → Generate simulation: generates if missing (evidence: `app.py`)
- Generate simulation → Demo dataset: writes dataset (evidence: `generate_demo_data.py`)
- Streamlit app → Prepare records: runs analysis (evidence: `app.py`)
- Prepare records → Find similar pairs: prepares for (evidence: `README.md`)
- Find similar pairs → Cluster and score: feeds detection (evidence: `README.md`)
- Cluster and score → Results dashboard: returns results (evidence: `engine.py`)
- Streamlit app → Results dashboard: presents findings (evidence: `app.py`)
- Streamlit app → Build network graph: builds graph (evidence: `app.py`)
- Build network graph → Interactive graph: renders with PyVis (evidence: `viz.py`)
- Build network graph → Static graph fallback: falls back to (evidence: `app.py`)
- Streamlit app → PDF report: exports report (evidence: `app.py`)
- Streamlit app → Account CSV export: exports accounts (evidence: `app.py`)
