# tada-data/english_tutor architecture

> Architecture diagram of the GitHub repository tada-data/english_tutor, 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/tada-data/english_tutor
- Repository: https://github.com/tada-data/english_tutor

## Overview

This is a Streamlit AI language-tutoring app. Learners enter through an invite-code login, then practice conversation, review vocabulary with quizzes, and revisit chat history. The main internal layer is the single Streamlit app, which coordinates learner settings and learning records with Supabase and uses generative AI for language analysis and audio transcription; speech playback uses Edge TTS. The excerpt is partial, so some feature wiring—especially the full chat-generation path—is not shown, and the graph omits uncertain connections.

Main entry points: [`app.py`](https://github.com/tada-data/english_tutor/blob/main/app.py) (Streamlit app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Learner experience"]
  node_app["Streamlit app<br/>[app.py]"]
  node_login["Invite login<br/>[app.py]"]
end

subgraph group_learning["Learning features"]
  node_conversation["Conversation practice<br/>[app.py]"]
  node_voice_input["Voice input<br/>[app.py]"]
  node_speech_analysis["Speech analysis<br/>[app.py]"]
  node_speech_playback["Speech playback<br/>[app.py]"]
  node_vocabulary["Vocabulary review<br/>[app.py]"]
  node_quiz["Vocabulary quiz<br/>[app.py]"]
  node_history["Conversation history<br/>[app.py]"]
end

subgraph group_services["External services"]
  node_gemini["Google Gemini"]
  node_edge_tts["Edge TTS"]
end

subgraph group_state["Learning data"]
  node_supabase[("Supabase")]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_app
node_app -->|"presents"| node_login
node_app -->|"presents"| node_conversation
node_app -->|"presents"| node_vocabulary
node_app -->|"presents"| node_quiz
node_app -->|"presents"| node_history
node_conversation -->|"captures audio"| node_voice_input
node_voice_input -->|"submits audio"| node_speech_analysis
node_speech_analysis -->|"transcribes with"| node_gemini
node_conversation -->|"requests audio"| node_speech_playback
node_speech_playback -->|"generates audio"| node_edge_tts
node_conversation -->|"analyzes language"| node_gemini
node_login -.->|"loads user data"| node_supabase
node_app -->|"reads settings and records"| node_supabase
node_conversation -->|"writes chat and vocabulary"| node_supabase
node_quiz -->|"updates results"| node_supabase
node_vocabulary -->|"deletes entries"| node_supabase
node_history -->|"reads chat logs"| node_supabase

click node_app "https://github.com/tada-data/english_tutor/blob/main/app.py"
click node_login "https://github.com/tada-data/english_tutor/blob/main/app.py"
click node_conversation "https://github.com/tada-data/english_tutor/blob/main/app.py"
click node_voice_input "https://github.com/tada-data/english_tutor/blob/main/app.py"
click node_speech_analysis "https://github.com/tada-data/english_tutor/blob/main/app.py"
click node_speech_playback "https://github.com/tada-data/english_tutor/blob/main/app.py"
click node_vocabulary "https://github.com/tada-data/english_tutor/blob/main/app.py"
click node_quiz "https://github.com/tada-data/english_tutor/blob/main/app.py"
click node_history "https://github.com/tada-data/english_tutor/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_login toneBlue
class node_conversation,node_voice_input,node_speech_analysis,node_speech_playback,node_vocabulary,node_quiz,node_history toneAmber
class node_gemini,node_edge_tts toneMint
class node_supabase toneRose
class node_learner toneIndigo
```

## Components

### Learner experience

- [Streamlit app](https://github.com/tada-data/english_tutor/blob/main/app.py): `app.py`
- [Invite login](https://github.com/tada-data/english_tutor/blob/main/app.py): `app.py`

### Learning features

- [Conversation practice](https://github.com/tada-data/english_tutor/blob/main/app.py): `app.py`
- [Voice input](https://github.com/tada-data/english_tutor/blob/main/app.py): `app.py`
- [Speech analysis](https://github.com/tada-data/english_tutor/blob/main/app.py): `app.py`
- [Speech playback](https://github.com/tada-data/english_tutor/blob/main/app.py): `app.py`
- [Vocabulary review](https://github.com/tada-data/english_tutor/blob/main/app.py): `app.py`
- [Vocabulary quiz](https://github.com/tada-data/english_tutor/blob/main/app.py): `app.py`
- [Conversation history](https://github.com/tada-data/english_tutor/blob/main/app.py): `app.py`

### External services

- **Google Gemini**
- **Edge TTS**

### Learning data

- **Supabase**

### Other components

- **Learner**

## Connections

- Learner → Streamlit app: uses (evidence: `app.py`)
- Streamlit app → Invite login: presents (evidence: `app.py`)
- Streamlit app → Conversation practice: presents (evidence: `app.py`)
- Streamlit app → Vocabulary review: presents (evidence: `app.py`)
- Streamlit app → Vocabulary quiz: presents (evidence: `app.py`)
- Streamlit app → Conversation history: presents (evidence: `app.py`)
- Conversation practice → Voice input: captures audio (evidence: `app.py`)
- Voice input → Speech analysis: submits audio (evidence: `app.py`)
- Speech analysis → Google Gemini: transcribes with (evidence: `app.py`)
- Conversation practice → Speech playback: requests audio (evidence: `app.py`)
- Speech playback → Edge TTS: generates audio (evidence: `app.py`)
- Conversation practice → Google Gemini: analyzes language (evidence: `app.py`)
- Invite login → Supabase: loads user data
- Streamlit app → Supabase: reads settings and records (evidence: `app.py`)
- Conversation practice → Supabase: writes chat and vocabulary (evidence: `app.py`)
- Vocabulary quiz → Supabase: updates results (evidence: `app.py`)
- Vocabulary review → Supabase: deletes entries (evidence: `app.py`)
- Conversation history → Supabase: reads chat logs (evidence: `app.py`)
