# muad-sul/dadabase architecture

> Architecture diagram of the GitHub repository muad-sul/dadabase, 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/muad-sul/dadabase
- Repository: https://github.com/muad-sul/dadabase

## Overview

Dadabase is a small Pygame joke generator: a user opens the interface or clicks its button, the interface requests a joke, and the returned text is drawn on screen. The app also creates a category dropdown, which the README describes as nonfunctional. The shown code supports the joke-fetch and widget relationships; no separate category-filtering workflow is evidenced.

Main entry points: [`DadJokeUI.py`](https://github.com/muad-sul/dadabase/blob/main/DadJokeUI.py) (Pygame interface), [`dropdownmenu.py`](https://github.com/muad-sul/dadabase/blob/main/dropdownmenu.py) (Category dropdown), [`DadJoke.py`](https://github.com/muad-sul/dadabase/blob/main/DadJoke.py) (Joke fetcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["App interface"]
  node_ui["Pygame interface<br/>[DadJokeUI.py]"]
end

subgraph group_jokes["Joke retrieval"]
  node_fetcher["Joke fetcher<br/>[DadJoke.py]"]
  node_api["icanhazdadjoke API"]
end

subgraph group_widgets["Dropdown widget"]
  node_menu["Category dropdown<br/>[dropdownmenu.py]"]
end

node_user(("User"))
node_pygame["Pygame runtime"]
node_pygame_widgets["pygame-widgets"]

node_user -->|"uses"| node_ui
node_ui -->|"requests joke"| node_fetcher
node_fetcher -->|"GETs joke"| node_api
node_ui -->|"creates dropdown"| node_menu
node_menu -->|"constructs dropdown"| node_pygame_widgets
node_ui -->|"updates events"| node_pygame_widgets
node_ui -->|"draws interface"| node_pygame
node_menu -->|"creates display"| node_pygame

click node_ui "https://github.com/muad-sul/dadabase/blob/main/DadJokeUI.py"
click node_fetcher "https://github.com/muad-sul/dadabase/blob/main/DadJoke.py"
click node_menu "https://github.com/muad-sul/dadabase/blob/main/dropdownmenu.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_ui,node_user toneBlue
class node_fetcher,node_api toneAmber
class node_menu toneMint
class node_pygame,node_pygame_widgets toneIndigo
```

## Components

### App interface

- [Pygame interface](https://github.com/muad-sul/dadabase/blob/main/DadJokeUI.py): `DadJokeUI.py`

### Joke retrieval

- [Joke fetcher](https://github.com/muad-sul/dadabase/blob/main/DadJoke.py): `DadJoke.py`
- **icanhazdadjoke API**

### Dropdown widget

- [Category dropdown](https://github.com/muad-sul/dadabase/blob/main/dropdownmenu.py): `dropdownmenu.py`

### Other components

- **User**
- **Pygame runtime**
- **pygame-widgets**

## Connections

- User → Pygame interface: uses (evidence: `README.md`)
- Pygame interface → Joke fetcher: requests joke (evidence: `DadJokeUI.py`)
- Joke fetcher → icanhazdadjoke API: GETs joke (evidence: `DadJoke.py`)
- Pygame interface → Category dropdown: creates dropdown (evidence: `DadJokeUI.py`)
- Category dropdown → pygame-widgets: constructs dropdown (evidence: `dropdownmenu.py`)
- Pygame interface → pygame-widgets: updates events (evidence: `DadJokeUI.py`)
- Pygame interface → Pygame runtime: draws interface (evidence: `DadJokeUI.py`)
- Category dropdown → Pygame runtime: creates display (evidence: `dropdownmenu.py`)
