# rushikn/maths_bot architecture

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

- Interactive diagram: https://gitdiagram.com/rushikn/maths_bot
- Repository: https://github.com/rushikn/maths_bot

## Overview

maths_bot is a Streamlit maths-practice app. A user selects a practice mode and number range, starts a session, answers generated questions, and receives feedback before continuing; completion shows a score summary and answer review. The app also supports tables, squares, and cubes practice. The sole source file contains the UI, session state, question generation, answer handling, and summary rendering, so these are conceptual responsibilities rather than separate modules. Evidence is limited to the provided app.py excerpts; some intervening control flow is not shown.

Main entry points: [`app.py`](https://github.com/rushikn/maths_bot/blob/main/app.py) (Answer and feedback)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_practice["Practice session"]
  node_practice_ui["Practice controls<br/>[app.py]"]
  node_question_engine["Question generation<br/>[app.py]"]
end

subgraph group_interaction["Answer interaction"]
  node_answer_handler["Answer and feedback<br/>[app.py]"]
end

subgraph group_results["Session results"]
  node_summary["Score and review<br/>[app.py]"]
end

node_user(("Learner"))

node_user -->|"chooses mode"| node_practice_ui
node_practice_ui -->|"submits answer"| node_answer_handler
node_answer_handler -->|"advances question"| node_question_engine
node_user -->|"enters answer"| node_answer_handler
node_user -->|"reviews results"| node_summary

click node_practice_ui "https://github.com/rushikn/maths_bot/blob/main/app.py"
click node_question_engine "https://github.com/rushikn/maths_bot/blob/main/app.py"
click node_answer_handler "https://github.com/rushikn/maths_bot/blob/main/app.py"
click node_summary "https://github.com/rushikn/maths_bot/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_practice_ui,node_question_engine toneBlue
class node_answer_handler toneAmber
class node_summary toneMint
class node_user toneIndigo
```

## Components

### Practice session

- [Practice controls](https://github.com/rushikn/maths_bot/blob/main/app.py): `app.py`
- [Question generation](https://github.com/rushikn/maths_bot/blob/main/app.py): `app.py`

### Answer interaction

- [Answer and feedback](https://github.com/rushikn/maths_bot/blob/main/app.py): `app.py`

### Session results

- [Score and review](https://github.com/rushikn/maths_bot/blob/main/app.py): `app.py`

### Other components

- **Learner**

## Connections

- Learner → Practice controls: chooses mode (evidence: `app.py`)
- Practice controls → Answer and feedback: submits answer (evidence: `app.py`)
- Answer and feedback → Question generation: advances question (evidence: `app.py`)
- Learner → Answer and feedback: enters answer (evidence: `app.py`)
- Learner → Score and review: reviews results (evidence: `app.py`)
