# srinivasskc/toddler-quiz-app architecture

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

- Interactive diagram: https://gitdiagram.com/srinivasskc/toddler-quiz-app
- Repository: https://github.com/srinivasskc/toddler-quiz-app

## Overview

Toddler Learning Buddy is a single-file Streamlit quiz app. A child chooses a topic, requests a question, then views picture clues, listens to spoken quiz text, selects an answer, and receives feedback; session state tracks progress. The app generates and validates most questions through local Ollama/Gemma, while counting questions have a visual-generation path. gTTS provides optional audio. The excerpt does not show the complete topic list or all rendering details, so the graph stays at documented and evidenced component boundaries.

Main entry points: [`app.py`](https://github.com/srinivasskc/toddler-quiz-app/blob/main/app.py) (Streamlit interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_quiz["Quiz experience"]
  node_streamlit_ui["Streamlit interface<br/>[app.py]"]
  node_quiz_state["Quiz session state<br/>[app.py]"]
  node_answer_feedback["Answer and feedback<br/>[app.py]"]
end

subgraph group_content["Question and clues"]
  node_question_generation["Question generation<br/>[app.py]"]
  node_counting_questions["Counting questions<br/>[app.py]"]
  node_question_validation["Question validation<br/>[app.py]"]
  node_picture_clues["Picture clues<br/>[app.py]"]
  node_ollama["Ollama Gemma"]
end

subgraph group_speech["Spoken questions"]
  node_spoken_text["Spoken quiz text<br/>[app.py]"]
  node_tts["gTTS"]
  node_audio_playback["Audio playback<br/>[app.py]"]
end

node_child(("Child"))

node_child -->|"uses"| node_streamlit_ui
node_streamlit_ui -->|"requests question"| node_question_generation
node_question_generation -->|"generates counting"| node_counting_questions
node_question_generation -->|"requests quiz"| node_ollama
node_question_generation -->|"validates response"| node_question_validation
node_question_generation -->|"returns quiz"| node_streamlit_ui
node_streamlit_ui -->|"stores quiz"| node_quiz_state
node_streamlit_ui -->|"formats quiz"| node_spoken_text
node_spoken_text -->|"generates speech"| node_tts
node_streamlit_ui -->|"plays audio"| node_audio_playback
node_streamlit_ui -->|"renders clues"| node_picture_clues
node_streamlit_ui -->|"checks answer"| node_answer_feedback
node_answer_feedback -->|"updates score"| node_quiz_state
node_child -->|"submits choice"| node_answer_feedback

click node_streamlit_ui "https://github.com/srinivasskc/toddler-quiz-app/blob/main/app.py"
click node_quiz_state "https://github.com/srinivasskc/toddler-quiz-app/blob/main/app.py"
click node_answer_feedback "https://github.com/srinivasskc/toddler-quiz-app/blob/main/app.py"
click node_question_generation "https://github.com/srinivasskc/toddler-quiz-app/blob/main/app.py"
click node_counting_questions "https://github.com/srinivasskc/toddler-quiz-app/blob/main/app.py"
click node_question_validation "https://github.com/srinivasskc/toddler-quiz-app/blob/main/app.py"
click node_picture_clues "https://github.com/srinivasskc/toddler-quiz-app/blob/main/app.py"
click node_spoken_text "https://github.com/srinivasskc/toddler-quiz-app/blob/main/app.py"
click node_audio_playback "https://github.com/srinivasskc/toddler-quiz-app/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_streamlit_ui,node_quiz_state,node_answer_feedback toneBlue
class node_question_generation,node_counting_questions,node_question_validation,node_picture_clues,node_ollama toneAmber
class node_spoken_text,node_tts,node_audio_playback toneMint
class node_child toneIndigo
```

## Components

### Quiz experience

- [Streamlit interface](https://github.com/srinivasskc/toddler-quiz-app/blob/main/app.py): `app.py`
- [Quiz session state](https://github.com/srinivasskc/toddler-quiz-app/blob/main/app.py): `app.py`
- [Answer and feedback](https://github.com/srinivasskc/toddler-quiz-app/blob/main/app.py): `app.py`

### Question and clues

- [Question generation](https://github.com/srinivasskc/toddler-quiz-app/blob/main/app.py): `app.py`
- [Counting questions](https://github.com/srinivasskc/toddler-quiz-app/blob/main/app.py): `app.py`
- [Question validation](https://github.com/srinivasskc/toddler-quiz-app/blob/main/app.py): `app.py`
- [Picture clues](https://github.com/srinivasskc/toddler-quiz-app/blob/main/app.py): `app.py`
- **Ollama Gemma**

### Spoken questions

- [Spoken quiz text](https://github.com/srinivasskc/toddler-quiz-app/blob/main/app.py): `app.py`
- **gTTS**
- [Audio playback](https://github.com/srinivasskc/toddler-quiz-app/blob/main/app.py): `app.py`

### Other components

- **Child**

## Connections

- Child → Streamlit interface: uses (evidence: `app.py`)
- Streamlit interface → Question generation: requests question (evidence: `app.py`)
- Question generation → Counting questions: generates counting (evidence: `app.py`)
- Question generation → Ollama Gemma: requests quiz (evidence: `app.py`)
- Question generation → Question validation: validates response (evidence: `app.py`)
- Question generation → Streamlit interface: returns quiz (evidence: `app.py`)
- Streamlit interface → Quiz session state: stores quiz (evidence: `app.py`)
- Streamlit interface → Spoken quiz text: formats quiz (evidence: `app.py`)
- Spoken quiz text → gTTS: generates speech (evidence: `app.py`)
- Streamlit interface → Audio playback: plays audio (evidence: `app.py`)
- Streamlit interface → Picture clues: renders clues (evidence: `app.py`)
- Streamlit interface → Answer and feedback: checks answer (evidence: `app.py`)
- Answer and feedback → Quiz session state: updates score (evidence: `app.py`)
- Child → Answer and feedback: submits choice (evidence: `app.py`)
