# alexandru-sacasanu/callflow architecture

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

- Interactive diagram: https://gitdiagram.com/alexandru-sacasanu/callflow
- Repository: https://github.com/alexandru-sacasanu/callflow

## Overview

Anti is a call-center QA application: users upload recordings, which are transcribed, anonymized, speaker-role classified, and scored before results are presented in the web UI. The API orchestrates processing and persists call metadata, segments, PII mappings, and QA results in Supabase. The README documents the analysis stages; API and helper excerpts show key calls and storage writes. Frontend source was not sampled, so UI-to-API connections are shown as unverified rather than asserted.

Main entry points: [`api.py`](https://github.com/alexandru-sacasanu/callflow/blob/main/api.py) (CallFlow API), [`callflow-ui/index.html`](https://github.com/alexandru-sacasanu/callflow/blob/main/callflow-ui/index.html) (Web application), [`callflow-ui/assets/js/api.js`](https://github.com/alexandru-sacasanu/callflow/blob/main/callflow-ui/assets/js/api.js) (API client), [`helpers.py`](https://github.com/alexandru-sacasanu/callflow/blob/main/helpers.py) (Role classification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_ui["Web application<br/>[index.html]"]
  node_auth_ui["Login and auth<br/>[login.js]"]
  node_upload_ui["Call upload<br/>[upload.js]"]
  node_call_views["Dashboard and calls<br/>[dashboard.js]"]
  node_detail_view["Call detail<br/>[call-detail.js]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_service["API and orchestration"]
  node_api["CallFlow API<br/>[api.py]"]
  node_pipeline["Pipeline orchestration<br/>[api.py]"]
end

subgraph group_analysis["Transcript analysis"]
  node_stt["Speech transcription<br/>[soniox_client.py]"]
  node_anonymize["PII anonymization<br/>[helpers.py]"]
  node_names["Romanian name data<br/>[romanian_names.py]"]
  node_classification["Role classification<br/>[helpers.py]"]
  node_qa["QA scoring<br/>[helpers.py]"]
  node_claude_client["Claude client setup"]
end

subgraph group_persistence["Call data"]
  node_calls_store[("Call records<br/>[api.py]")]
  node_segments_store[("Transcript segments<br/>[api.py]")]
  node_pii_store[("PII mappings<br/>[api.py]")]
  node_qa_store[("QA results<br/>[api.py]")]
  node_audio_store[("Audio storage<br/>[api.py]")]
end

subgraph group_external["External services"]
  node_soniox_service{{"Soniox STT"}}
  node_anthropic_service{{"Anthropic Haiku"}}
  node_supabase[("Supabase")]
end

node_user(("Call-center user"))

node_user -.->|"uses"| node_ui
node_ui -.->|"routes to"| node_auth_ui
node_ui -.->|"routes to"| node_upload_ui
node_ui -.->|"routes to"| node_call_views
node_ui -.->|"routes to"| node_detail_view
node_auth_ui -.->|"uses"| node_api_client
node_upload_ui -.->|"uses"| node_api_client
node_call_views -.->|"uses"| node_api_client
node_detail_view -.->|"uses"| node_api_client
node_api_client -.->|"requests"| node_api
node_api -->|"starts"| node_pipeline
node_pipeline -->|"transcribes"| node_stt
node_pipeline -->|"anonymizes"| node_anonymize
node_pipeline -->|"classifies"| node_classification
node_pipeline -->|"analyzes"| node_qa
node_stt -->|"uploads audio"| node_soniox_service
node_classification -->|"classifies with"| node_anthropic_service
node_qa -->|"scores with"| node_anthropic_service
node_classification -->|"uses names"| node_names
node_classification -->|"creates client"| node_claude_client
node_qa -->|"creates client"| node_claude_client
node_api -->|"authenticates"| node_supabase
node_api -->|"reads and writes"| node_calls_store
node_api -->|"writes segments"| node_segments_store
node_api -->|"writes mappings"| node_pii_store
node_api -->|"writes results"| node_qa_store
node_api -->|"uploads audio"| node_audio_store

click node_ui "https://github.com/alexandru-sacasanu/callflow/blob/main/callflow-ui/index.html"
click node_auth_ui "https://github.com/alexandru-sacasanu/callflow/blob/main/callflow-ui/assets/js/pages/login.js"
click node_upload_ui "https://github.com/alexandru-sacasanu/callflow/blob/main/callflow-ui/assets/js/components/upload.js"
click node_call_views "https://github.com/alexandru-sacasanu/callflow/blob/main/callflow-ui/assets/js/pages/dashboard.js"
click node_detail_view "https://github.com/alexandru-sacasanu/callflow/blob/main/callflow-ui/assets/js/pages/call-detail.js"
click node_api_client "https://github.com/alexandru-sacasanu/callflow/blob/main/callflow-ui/assets/js/api.js"
click node_api "https://github.com/alexandru-sacasanu/callflow/blob/main/api.py"
click node_pipeline "https://github.com/alexandru-sacasanu/callflow/blob/main/api.py"
click node_stt "https://github.com/alexandru-sacasanu/callflow/blob/main/soniox_client.py"
click node_anonymize "https://github.com/alexandru-sacasanu/callflow/blob/main/helpers.py"
click node_names "https://github.com/alexandru-sacasanu/callflow/blob/main/data/romanian_names.py"
click node_classification "https://github.com/alexandru-sacasanu/callflow/blob/main/helpers.py"
click node_qa "https://github.com/alexandru-sacasanu/callflow/blob/main/helpers.py"
click node_claude_client "https://github.com/alexandru-sacasanu/callflow/blob/main/claude_controler.py"
click node_calls_store "https://github.com/alexandru-sacasanu/callflow/blob/main/api.py"
click node_segments_store "https://github.com/alexandru-sacasanu/callflow/blob/main/api.py"
click node_pii_store "https://github.com/alexandru-sacasanu/callflow/blob/main/api.py"
click node_qa_store "https://github.com/alexandru-sacasanu/callflow/blob/main/api.py"
click node_audio_store "https://github.com/alexandru-sacasanu/callflow/blob/main/api.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_ui,node_auth_ui,node_upload_ui,node_call_views,node_detail_view,node_api_client,node_user toneBlue
class node_api,node_pipeline toneAmber
class node_stt,node_anonymize,node_names,node_classification,node_qa,node_claude_client toneMint
class node_calls_store,node_segments_store,node_pii_store,node_qa_store,node_audio_store toneRose
class node_soniox_service,node_anthropic_service,node_supabase toneIndigo
```

## Components

### Web experience

- [Web application](https://github.com/alexandru-sacasanu/callflow/blob/main/callflow-ui/index.html): `callflow-ui/index.html`
- [Login and auth](https://github.com/alexandru-sacasanu/callflow/blob/main/callflow-ui/assets/js/pages/login.js): `callflow-ui/assets/js/pages/login.js`
- [Call upload](https://github.com/alexandru-sacasanu/callflow/blob/main/callflow-ui/assets/js/components/upload.js): `callflow-ui/assets/js/components/upload.js`
- [Dashboard and calls](https://github.com/alexandru-sacasanu/callflow/blob/main/callflow-ui/assets/js/pages/dashboard.js): `callflow-ui/assets/js/pages/dashboard.js`
- [Call detail](https://github.com/alexandru-sacasanu/callflow/blob/main/callflow-ui/assets/js/pages/call-detail.js): `callflow-ui/assets/js/pages/call-detail.js`
- [API client](https://github.com/alexandru-sacasanu/callflow/blob/main/callflow-ui/assets/js/api.js): `callflow-ui/assets/js/api.js`

### API and orchestration

- [CallFlow API](https://github.com/alexandru-sacasanu/callflow/blob/main/api.py): `api.py`
- [Pipeline orchestration](https://github.com/alexandru-sacasanu/callflow/blob/main/api.py): `api.py`

### Transcript analysis

- [Speech transcription](https://github.com/alexandru-sacasanu/callflow/blob/main/soniox_client.py): `soniox_client.py`
- [PII anonymization](https://github.com/alexandru-sacasanu/callflow/blob/main/helpers.py): `helpers.py`
- [Romanian name data](https://github.com/alexandru-sacasanu/callflow/blob/main/data/romanian_names.py): `data/romanian_names.py`
- [Role classification](https://github.com/alexandru-sacasanu/callflow/blob/main/helpers.py): `helpers.py`
- [QA scoring](https://github.com/alexandru-sacasanu/callflow/blob/main/helpers.py): `helpers.py`
- [Claude client setup](https://github.com/alexandru-sacasanu/callflow/blob/main/claude_controler.py): `claude_controler.py`

### Call data

- [Call records](https://github.com/alexandru-sacasanu/callflow/blob/main/api.py): `api.py`
- [Transcript segments](https://github.com/alexandru-sacasanu/callflow/blob/main/api.py): `api.py`
- [PII mappings](https://github.com/alexandru-sacasanu/callflow/blob/main/api.py): `api.py`
- [QA results](https://github.com/alexandru-sacasanu/callflow/blob/main/api.py): `api.py`
- [Audio storage](https://github.com/alexandru-sacasanu/callflow/blob/main/api.py): `api.py`

### External services

- **Soniox STT**
- **Anthropic Haiku**
- **Supabase**

### Other components

- **Call-center user**

## Connections

- Call-center user → Web application: uses
- Web application → Login and auth: routes to
- Web application → Call upload: routes to
- Web application → Dashboard and calls: routes to
- Web application → Call detail: routes to
- Login and auth → API client: uses
- Call upload → API client: uses
- Dashboard and calls → API client: uses
- Call detail → API client: uses
- API client → CallFlow API: requests
- CallFlow API → Pipeline orchestration: starts (evidence: `api.py`)
- Pipeline orchestration → Speech transcription: transcribes (evidence: `api.py`)
- Pipeline orchestration → PII anonymization: anonymizes (evidence: `api.py`)
- Pipeline orchestration → Role classification: classifies (evidence: `api.py`)
- Pipeline orchestration → QA scoring: analyzes (evidence: `api.py`)
- Speech transcription → Soniox STT: uploads audio (evidence: `soniox_client.py`)
- Role classification → Anthropic Haiku: classifies with (evidence: `helpers.py`)
- QA scoring → Anthropic Haiku: scores with (evidence: `helpers.py`)
- Role classification → Romanian name data: uses names (evidence: `helpers.py`)
- Role classification → Claude client setup: creates client (evidence: `helpers.py`)
- QA scoring → Claude client setup: creates client (evidence: `helpers.py`)
- CallFlow API → Supabase: authenticates (evidence: `api.py`)
- CallFlow API → Call records: reads and writes (evidence: `api.py`)
- CallFlow API → Transcript segments: writes segments (evidence: `api.py`)
- CallFlow API → PII mappings: writes mappings (evidence: `api.py`)
- CallFlow API → QA results: writes results (evidence: `api.py`)
- CallFlow API → Audio storage: uploads audio (evidence: `api.py`)
