# rashid-shocho/nexted_ielts_speaking architecture

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

- Interactive diagram: https://gitdiagram.com/rashid-shocho/nexted_ielts_speaking
- Repository: https://github.com/rashid-shocho/nexted_ielts_speaking

## Overview

This is a FastAPI IELTS speaking-evaluation service called by a Next.js server. Its main workflow accepts session audio, stores session and segment records, optionally archives clips, then evaluates each segment for speech presence, transcription, pronunciation, and fluency. The worker aggregates segment results, requests IELTS band scoring, and persists a report and training-sample records. The graph captures documented integrations and calls; several source modules were not excerpted, so uncertain connections are omitted.

Main entry points: [`app/graph/nodes.py`](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/graph/nodes.py) (Evaluation nodes), [`app/api/sessions.py`](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/api/sessions.py) (Session endpoints), [`app/workers/evaluate.py`](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/workers/evaluate.py) (Evaluation worker), [`app/core/database.py`](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/core/database.py) (PostgreSQL)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and sessions"]
  node_fastapi["FastAPI app<br/>[main.py]"]
  node_session_api["Session endpoints<br/>[sessions.py]"]
  node_data_schemas["Data schemas<br/>[schemas.py]"]
end

subgraph group_evaluation["Audio evaluation"]
  node_evaluation_worker["Evaluation worker<br/>[evaluate.py]"]
  node_part_workflow["Part workflow<br/>[workflow.py]"]
  node_workflow_nodes["Evaluation nodes<br/>[nodes.py]"]
  node_vad["Speech detection<br/>[vad.py]"]
  node_asr["Transcription<br/>[asr.py]"]
  node_pronunciation["Pronunciation analysis<br/>[pronunciation.py]"]
  node_pron_parser["GOP result parsing"]
  node_fluency["Fluency features<br/>[nodes.py]"]
end

subgraph group_scoring["Scoring and evidence"]
  node_scorer["Session scorer<br/>[llm_scorer.py]"]
  node_band_descriptors["Band descriptors"]
end

subgraph group_infrastructure["Persistence and integrations"]
  node_database[("PostgreSQL<br/>[database.py]")]
  node_audio_storage["Audio archive<br/>[storage.py]"]
  node_settings["Service settings<br/>[config.py]"]
end

node_next_server(("Next.js server"))
node_groq["Groq LLM API"]
node_runpod["RunPod pronunciation"]
node_r2[("Cloudflare R2")]

node_next_server -->|"calls API"| node_fastapi
node_fastapi -->|"mounts routes"| node_session_api
node_session_api -->|"uses models"| node_data_schemas
node_session_api -->|"reads and writes"| node_database
node_session_api -->|"archives uploads"| node_audio_storage
node_session_api -->|"schedules evaluation"| node_evaluation_worker
node_evaluation_worker -->|"invokes per segment"| node_part_workflow
node_part_workflow -->|"wires nodes"| node_workflow_nodes
node_workflow_nodes -->|"detects speech"| node_vad
node_workflow_nodes -->|"transcribes audio"| node_asr
node_workflow_nodes -->|"analyzes pronunciation"| node_pronunciation
node_workflow_nodes -->|"computes features"| node_fluency
node_workflow_nodes -->|"persists segment"| node_database
node_pronunciation -->|"submits audio"| node_runpod
node_pronunciation -->|"parses GOP results"| node_pron_parser
node_evaluation_worker -->|"loads and saves results"| node_database
node_evaluation_worker -->|"scores session"| node_scorer
node_scorer -->|"formats descriptors"| node_band_descriptors
node_scorer -->|"requests scoring"| node_groq
node_evaluation_worker -->|"stores training samples"| node_database
node_audio_storage -->|"uploads clips"| node_r2

click node_fastapi "https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/main.py"
click node_session_api "https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/api/sessions.py"
click node_data_schemas "https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/models/schemas.py"
click node_evaluation_worker "https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/workers/evaluate.py"
click node_part_workflow "https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/graph/workflow.py"
click node_workflow_nodes "https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/graph/nodes.py"
click node_vad "https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/services/vad.py"
click node_asr "https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/services/asr.py"
click node_pronunciation "https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/services/pronunciation.py"
click node_pron_parser "https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/services/pronunciation_parser.py"
click node_fluency "https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/graph/nodes.py"
click node_scorer "https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/services/llm_scorer.py"
click node_band_descriptors "https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/services/band_descriptors.py"
click node_database "https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/core/database.py"
click node_audio_storage "https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/services/storage.py"
click node_settings "https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/core/config.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_fastapi,node_session_api,node_data_schemas toneBlue
class node_evaluation_worker,node_part_workflow,node_workflow_nodes,node_vad,node_asr,node_pronunciation,node_pron_parser,node_fluency,node_r2 toneAmber
class node_scorer,node_band_descriptors,node_next_server,node_groq toneMint
class node_database,node_audio_storage,node_settings toneRose
class node_runpod toneIndigo
```

## Components

### API and sessions

- [FastAPI app](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/main.py): `app/main.py`
- [Session endpoints](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/api/sessions.py): `app/api/sessions.py`
- [Data schemas](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/models/schemas.py): `app/models/schemas.py`

### Audio evaluation

- [Evaluation worker](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/workers/evaluate.py): `app/workers/evaluate.py`
- [Part workflow](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/graph/workflow.py): `app/graph/workflow.py`
- [Evaluation nodes](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/graph/nodes.py): `app/graph/nodes.py`
- [Speech detection](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/services/vad.py): `app/services/vad.py`
- [Transcription](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/services/asr.py): `app/services/asr.py`
- [Pronunciation analysis](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/services/pronunciation.py): `app/services/pronunciation.py`
- [GOP result parsing](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/services/pronunciation_parser.py): `app/services/pronunciation_parser.py`
- [Fluency features](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/graph/nodes.py): `app/graph/nodes.py`

### Scoring and evidence

- [Session scorer](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/services/llm_scorer.py): `app/services/llm_scorer.py`
- [Band descriptors](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/services/band_descriptors.py): `app/services/band_descriptors.py`

### Persistence and integrations

- [PostgreSQL](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/core/database.py): `app/core/database.py`
- [Audio archive](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/services/storage.py): `app/services/storage.py`
- [Service settings](https://github.com/rashid-shocho/nexted_ielts_speaking/blob/main/app/core/config.py): `app/core/config.py`

### Other components

- **Next.js server**
- **Groq LLM API**
- **RunPod pronunciation**
- **Cloudflare R2**

## Connections

- Next.js server → FastAPI app: calls API (evidence: `app/main.py`)
- FastAPI app → Session endpoints: mounts routes (evidence: `app/main.py`)
- Session endpoints → Data schemas: uses models (evidence: `app/api/sessions.py`)
- Session endpoints → PostgreSQL: reads and writes (evidence: `app/api/sessions.py`)
- Session endpoints → Audio archive: archives uploads (evidence: `app/api/sessions.py`)
- Session endpoints → Evaluation worker: schedules evaluation (evidence: `app/api/sessions.py`)
- Evaluation worker → Part workflow: invokes per segment (evidence: `app/workers/evaluate.py`)
- Part workflow → Evaluation nodes: wires nodes (evidence: `app/graph/workflow.py`)
- Evaluation nodes → Speech detection: detects speech (evidence: `app/graph/nodes.py`)
- Evaluation nodes → Transcription: transcribes audio (evidence: `app/graph/nodes.py`)
- Evaluation nodes → Pronunciation analysis: analyzes pronunciation (evidence: `app/graph/nodes.py`)
- Evaluation nodes → Fluency features: computes features (evidence: `app/graph/nodes.py`)
- Evaluation nodes → PostgreSQL: persists segment (evidence: `app/graph/nodes.py`)
- Pronunciation analysis → RunPod pronunciation: submits audio (evidence: `app/services/pronunciation.py`)
- Pronunciation analysis → GOP result parsing: parses GOP results (evidence: `app/services/pronunciation.py`)
- Evaluation worker → PostgreSQL: loads and saves results (evidence: `app/workers/evaluate.py`)
- Evaluation worker → Session scorer: scores session (evidence: `app/workers/evaluate.py`)
- Session scorer → Band descriptors: formats descriptors (evidence: `app/services/llm_scorer.py`)
- Session scorer → Groq LLM API: requests scoring (evidence: `app/services/llm_scorer.py`)
- Evaluation worker → PostgreSQL: stores training samples (evidence: `app/workers/evaluate.py`)
- Audio archive → Cloudflare R2: uploads clips (evidence: `app/services/storage.py`)
