# d3vex/7speaking-bot architecture

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

- Interactive diagram: https://gitdiagram.com/d3vex/7speaking-bot
- Repository: https://github.com/d3vex/7speaking-bot

## Overview

7Speaking Bot is a set of alternative Tampermonkey userscripts that automate exercises on the 7Speaking site; the scripts are versions to choose between, not stages in a shared pipeline. The main workflow is to run a selected script on the site, identify an exercise, obtain or derive answers, and interact with the exercise or platform API. The activity version additionally discovers and completes activities and returns to the home flow. README capabilities include quiz support, configurable response and navigation behavior, and anti-detection measures. Excerpts are partial, so unsampled internal calls are not mapped.

Main entry points: [`bot v2 - stable.js`](https://github.com/d3vex/7speaking-bot/blob/main/bot%20v2%20-%20stable.js) (V2 stable), [`activity bot - v1 stable.js`](https://github.com/d3vex/7speaking-bot/blob/main/activity%20bot%20-%20v1%20stable.js) (Activity bot), [`bot v2 - dev.js`](https://github.com/d3vex/7speaking-bot/blob/main/bot%20v2%20-%20dev.js) (V2 development), [`oldv1.js`](https://github.com/d3vex/7speaking-bot/blob/main/oldv1.js) (Legacy bot)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scripts["Bot versions"]
  node_old["Legacy bot<br/>[oldv1.js]"]
  node_v2stable["V2 stable<br/>[bot v2 - stable.js]"]
  node_v2dev["V2 development<br/>[bot v2 - dev.js]"]
  node_activity["Activity bot"]
end

subgraph group_workflow["Exercise automation"]
  node_exam["Exam answering<br/>[bot v2 - stable.js]"]
  node_quiz["Quiz answering"]
  node_discovery["Activity discovery"]
end

subgraph group_services["External services"]
  node_site["7Speaking site"]
  node_api["7Speaking APIs"]
end

node_user(("User"))

node_user -->|"chooses script"| node_old
node_user -->|"chooses script"| node_v2stable
node_user -->|"chooses script"| node_v2dev
node_user -->|"chooses script"| node_activity
node_old -->|"automates exercises"| node_site
node_v2stable -->|"automates exercises"| node_site
node_v2dev -->|"automates exercises"| node_site
node_activity -->|"runs activity loop"| node_site
node_v2stable -->|"answers exams"| node_exam
node_v2stable -->|"supports quizzes"| node_quiz
node_v2dev -->|"supports quizzes"| node_quiz
node_activity -->|"completes quizzes"| node_quiz
node_activity -->|"finds activities"| node_discovery
node_exam -->|"requests answers"| node_api
node_quiz -->|"requests quiz data"| node_api
node_discovery -->|"loads activity data"| node_api

click node_old "https://github.com/d3vex/7speaking-bot/blob/main/oldv1.js"
click node_v2stable "https://github.com/d3vex/7speaking-bot/blob/main/bot%20v2%20-%20stable.js"
click node_v2dev "https://github.com/d3vex/7speaking-bot/blob/main/bot%20v2%20-%20dev.js"
click node_activity "https://github.com/d3vex/7speaking-bot/blob/main/activity%20bot%20-%20v1%20stable.js"
click node_exam "https://github.com/d3vex/7speaking-bot/blob/main/bot%20v2%20-%20stable.js"
click node_quiz "https://github.com/d3vex/7speaking-bot/blob/main/activity%20bot%20-%20v1%20stable.js"
click node_discovery "https://github.com/d3vex/7speaking-bot/blob/main/activity%20bot%20-%20v1%20stable.js"

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_old,node_v2stable,node_v2dev,node_activity,node_user toneBlue
class node_exam,node_quiz,node_discovery toneAmber
class node_site,node_api toneMint
```

## Components

### Bot versions

- [Legacy bot](https://github.com/d3vex/7speaking-bot/blob/main/oldv1.js): `oldv1.js`
- [V2 stable](https://github.com/d3vex/7speaking-bot/blob/main/bot%20v2%20-%20stable.js): `bot v2 - stable.js`
- [V2 development](https://github.com/d3vex/7speaking-bot/blob/main/bot%20v2%20-%20dev.js): `bot v2 - dev.js`
- [Activity bot](https://github.com/d3vex/7speaking-bot/blob/main/activity%20bot%20-%20v1%20stable.js): `activity bot - v1 stable.js`

### Exercise automation

- [Exam answering](https://github.com/d3vex/7speaking-bot/blob/main/bot%20v2%20-%20stable.js): `bot v2 - stable.js`
- [Quiz answering](https://github.com/d3vex/7speaking-bot/blob/main/activity%20bot%20-%20v1%20stable.js): `activity bot - v1 stable.js`
- [Activity discovery](https://github.com/d3vex/7speaking-bot/blob/main/activity%20bot%20-%20v1%20stable.js): `activity bot - v1 stable.js`

### External services

- **7Speaking site**
- **7Speaking APIs**

### Other components

- **User**

## Connections

- User → Legacy bot: chooses script (evidence: `README.md`)
- User → V2 stable: chooses script (evidence: `README.md`)
- User → V2 development: chooses script (evidence: `README.md`)
- User → Activity bot: chooses script (evidence: `README.md`)
- Legacy bot → 7Speaking site: automates exercises (evidence: `oldv1.js`)
- V2 stable → 7Speaking site: automates exercises (evidence: `bot v2 - stable.js`)
- V2 development → 7Speaking site: automates exercises (evidence: `bot v2 - dev.js`)
- Activity bot → 7Speaking site: runs activity loop (evidence: `activity bot - v1 stable.js`)
- V2 stable → Exam answering: answers exams (evidence: `bot v2 - stable.js`)
- V2 stable → Quiz answering: supports quizzes (evidence: `README.md`)
- V2 development → Quiz answering: supports quizzes (evidence: `README.md`)
- Activity bot → Quiz answering: completes quizzes (evidence: `activity bot - v1 stable.js`)
- Activity bot → Activity discovery: finds activities (evidence: `activity bot - v1 stable.js`)
- Exam answering → 7Speaking APIs: requests answers (evidence: `bot v2 - stable.js`)
- Quiz answering → 7Speaking APIs: requests quiz data (evidence: `activity bot - v1 stable.js`)
- Activity discovery → 7Speaking APIs: loads activity data (evidence: `activity bot - v1 stable.js`)
