# bada-dev/brainbrawl architecture

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

- Interactive diagram: https://gitdiagram.com/bada-dev/brainbrawl
- Repository: https://github.com/bada-dev/brainbrawl

## Overview

BrainBrawl is a Flask-based quiz application. The visible code covers scheduled question generation, storage, answer submission, and Discord/Minecraft integrations. The main source excerpt is partial and the README documents no capabilities, so links between the HTML frontend and backend, and some runtime flows, cannot be confirmed.

Main entry points: [`main.py`](https://github.com/bada-dev/brainbrawl/blob/main/main.py) (Question generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_quiz["Quiz runtime"]
  node_submit["Answer submission<br/>[main.py]"]
  node_generation["Question generation<br/>[main.py]"]
  node_database[("Question database<br/>[main.py]")]
  node_frontend["Web page<br/>[index.html]"]
end

subgraph group_ops["Scheduling and integrations"]
  node_scheduler["Scheduler<br/>[main.py]"]
  node_discord["Discord services"]
  node_minecraft["Minecraft RCON"]
  node_groq["Groq API"]
end

node_player(("Player"))

node_player -.->|"submits answer"| node_submit
node_scheduler -->|"schedules"| node_generation
node_generation -->|"uses API"| node_groq
node_generation -->|"checks duplicates"| node_database
node_generation -->|"saves question"| node_database

click node_submit "https://github.com/bada-dev/brainbrawl/blob/main/main.py"
click node_generation "https://github.com/bada-dev/brainbrawl/blob/main/main.py"
click node_database "https://github.com/bada-dev/brainbrawl/blob/main/main.py"
click node_scheduler "https://github.com/bada-dev/brainbrawl/blob/main/main.py"
click node_frontend "https://github.com/bada-dev/brainbrawl/blob/main/templates/index.html"

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_submit,node_generation,node_database,node_frontend toneBlue
class node_scheduler,node_discord,node_minecraft,node_groq toneAmber
class node_player toneIndigo
```

## Components

### Quiz runtime

- [Answer submission](https://github.com/bada-dev/brainbrawl/blob/main/main.py): `main.py`
- [Question generation](https://github.com/bada-dev/brainbrawl/blob/main/main.py): `main.py`
- [Question database](https://github.com/bada-dev/brainbrawl/blob/main/main.py): `main.py`
- [Web page](https://github.com/bada-dev/brainbrawl/blob/main/templates/index.html): `templates/index.html`

### Scheduling and integrations

- [Scheduler](https://github.com/bada-dev/brainbrawl/blob/main/main.py): `main.py`
- **Discord services**
- **Minecraft RCON**
- **Groq API**

### Other components

- **Player**

## Connections

- Player → Answer submission: submits answer
- Scheduler → Question generation: schedules (evidence: `main.py`)
- Question generation → Groq API: uses API (evidence: `main.py`)
- Question generation → Question database: checks duplicates (evidence: `main.py`)
- Question generation → Question database: saves question (evidence: `main.py`)
