# goldengr/mccapescapecord architecture

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

- Interactive diagram: https://gitdiagram.com/goldengr/mccapescapecord
- Repository: https://github.com/goldengr/mccapescapecord

## Overview

The repository combines a Discord community bot with a Flask staff dashboard. The main bot workflow handles vouch submission, review, approval/deletion, and browsing; the dashboard authenticates staff and serves dynamic pages. The graph preserves the documented Microsoft-to-Minecraft login flow and other visible capabilities. Some bot command implementations and dashboard data modules were not excerpted, so their relationships are included only where the source index or excerpts support them.

Main entry points: [`bot/main.py`](https://github.com/goldengr/mccapescapecord/blob/main/bot/main.py) (Bot runtime), [`bot/api/vouchStaffButtonsView.py`](https://github.com/goldengr/mccapescapecord/blob/main/bot/api/vouchStaffButtonsView.py) (Staff review buttons), [`bot/cogs/vouch/vouch.py`](https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/vouch/vouch.py) (Vouch commands), [`bot/cogs/vouch/vouches.py`](https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/vouch/vouches.py) (Browse vouches)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bot["Discord bot"]
  node_bot_runtime["Bot runtime<br/>[main.py]"]
  node_cape_roles["Cape roles<br/>[capeRoles.py]"]
  node_code_check["Code checking<br/>[checkCode.py]"]
  node_ticket_management["Manual ticket sending"]
end

subgraph group_vouches["Vouch features"]
  node_vouch_commands["Vouch commands<br/>[vouch.py]"]
  node_vouches_command["Browse vouches<br/>[vouches.py]"]
  node_add_vouch["Add vouch<br/>[addVouch.py]"]
  node_approve_command["Approve command<br/>[aprooveVouch.py]"]
  node_delete_command["Delete command<br/>[deleteVouch.py]"]
  node_get_vouch_command["Get vouch<br/>[getVouch.py]"]
  node_cooldown_command["Remove cooldown"]
  node_vouch_buttons["Staff review buttons"]
  node_vouch_paginator["Vouch pagination"]
  node_vouch_menu["Vouch menu<br/>[vouchMenu.py]"]
  node_vouch_embed["Vouch embed"]
  node_vouch_selector["Page selector embed"]
  node_vouch_submit["Submit vouch<br/>[vouch.py]"]
  node_vouch_approve["Approve vouch<br/>[approveVouch.py]"]
  node_vouch_delete["Delete vouch<br/>[deleteVouch.py]"]
  node_vouch_get["Fetch vouch<br/>[getVouch.py]"]
  node_vouch_list["List vouches<br/>[getVouches.py]"]
  node_vouch_misc["Vouch utilities<br/>[mitelanius.py]"]
end

subgraph group_dashboard["Staff dashboard"]
  node_dashboard_runtime["Dashboard app<br/>[main.py]"]
  node_login_routes["Login routes<br/>[login.py]"]
  node_page_routes["Staff page routes<br/>[pages.py]"]
  node_dynamic_pages["Dynamic page data<br/>[dynamicPages.py]"]
end

subgraph group_identity["Identity and data"]
  node_supabase[("Supabase")]
  node_microsoft_auth["Microsoft Minecraft auth"]
  node_user_data["User and session data<br/>[user.py]"]
end

node_discord_user(("Discord user"))
node_discord_platform(("Discord platform"))
node_microsoft(("Microsoft identity"))
node_xbox(("Xbox Live and XSTS"))
node_minecraft(("Minecraft services"))

node_bot_runtime -->|"connects to"| node_discord_platform
node_bot_runtime -->|"creates client"| node_supabase
node_bot_runtime -->|"registers views"| node_vouch_buttons
node_bot_runtime -->|"loads extension"| node_vouch_commands
node_bot_runtime -->|"loads extension"| node_vouches_command
node_bot_runtime -->|"loads extension"| node_get_vouch_command
node_bot_runtime -->|"loads extension"| node_approve_command
node_bot_runtime -->|"loads extension"| node_delete_command
node_bot_runtime -->|"loads extension"| node_add_vouch
node_bot_runtime -->|"loads extension"| node_cooldown_command
node_bot_runtime -->|"loads extension"| node_code_check
node_bot_runtime -->|"loads extension"| node_ticket_management
node_vouch_commands -->|"uses controls"| node_vouch_buttons
node_vouch_commands -->|"submits vouch"| node_vouch_submit
node_vouch_commands -->|"uses utilities"| node_vouch_misc
node_add_vouch -->|"submits vouch"| node_vouch_submit
node_add_vouch -->|"renders embed"| node_vouch_embed
node_approve_command -->|"approves vouch"| node_vouch_approve
node_delete_command -->|"deletes vouch"| node_vouch_delete
node_get_vouch_command -->|"fetches vouch"| node_vouch_get
node_get_vouch_command -->|"renders embed"| node_vouch_embed
node_vouches_command -->|"lists vouches"| node_vouch_list
node_vouches_command -->|"paginates results"| node_vouch_paginator
node_vouches_command -->|"uses utilities"| node_vouch_misc
node_cooldown_command -->|"uses deletion"| node_vouch_delete
node_cooldown_command -->|"uses submission"| node_vouch_submit
node_vouch_buttons -->|"approves vouch"| node_vouch_approve
node_vouch_buttons -->|"deletes vouch"| node_vouch_delete
node_vouch_buttons -->|"fetches vouch"| node_vouch_get
node_vouch_paginator -->|"renders selector"| node_vouch_selector
node_vouch_paginator -->|"shows page"| node_vouch_menu
node_vouch_menu -->|"renders vouch"| node_vouch_embed
node_dashboard_runtime -->|"registers blueprint"| node_login_routes
node_dashboard_runtime -->|"registers blueprint"| node_page_routes
node_login_routes -->|"starts auth"| node_microsoft_auth
node_login_routes -->|"reads and writes"| node_user_data
node_login_routes -->|"requests identity"| node_discord_platform
node_microsoft_auth -->|"exchanges tokens"| node_microsoft
node_microsoft_auth -->|"authenticates"| node_xbox
node_microsoft_auth -->|"gets profile"| node_minecraft
node_page_routes -->|"checks session"| node_user_data
node_page_routes -->|"loads page data"| node_dynamic_pages
node_dynamic_pages -->|"queries"| node_supabase
node_user_data -->|"queries"| node_supabase
node_cape_roles -.->|"manages roles"| node_discord_platform

click node_bot_runtime "https://github.com/goldengr/mccapescapecord/blob/main/bot/main.py"
click node_vouch_commands "https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/vouch/vouch.py"
click node_vouches_command "https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/vouch/vouches.py"
click node_add_vouch "https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/vouch/addVouch.py"
click node_approve_command "https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/vouch/aprooveVouch.py"
click node_delete_command "https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/vouch/deleteVouch.py"
click node_get_vouch_command "https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/vouch/getVouch.py"
click node_cooldown_command "https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/vouch/removeVouchCooldown.py"
click node_vouch_buttons "https://github.com/goldengr/mccapescapecord/blob/main/bot/api/vouchStaffButtonsView.py"
click node_vouch_paginator "https://github.com/goldengr/mccapescapecord/blob/main/bot/api/vouchPageinatorMenu.py"
click node_vouch_menu "https://github.com/goldengr/mccapescapecord/blob/main/bot/api/vouchMenu.py"
click node_vouch_embed "https://github.com/goldengr/mccapescapecord/blob/main/bot/api/createVouchEmbed.py"
click node_vouch_selector "https://github.com/goldengr/mccapescapecord/blob/main/bot/api/createVouchSelectorEmbed.py"
click node_vouch_submit "https://github.com/goldengr/mccapescapecord/blob/main/bot/api/vouch.py"
click node_vouch_approve "https://github.com/goldengr/mccapescapecord/blob/main/bot/api/approveVouch.py"
click node_vouch_delete "https://github.com/goldengr/mccapescapecord/blob/main/bot/api/deleteVouch.py"
click node_vouch_get "https://github.com/goldengr/mccapescapecord/blob/main/bot/api/getVouch.py"
click node_vouch_list "https://github.com/goldengr/mccapescapecord/blob/main/bot/api/getVouches.py"
click node_vouch_misc "https://github.com/goldengr/mccapescapecord/blob/main/bot/api/mitelanius.py"
click node_dashboard_runtime "https://github.com/goldengr/mccapescapecord/blob/main/dash/main.py"
click node_login_routes "https://github.com/goldengr/mccapescapecord/blob/main/dash/api/login.py"
click node_microsoft_auth "https://github.com/goldengr/mccapescapecord/blob/main/dash/api/loginWithMicrosoft.py"
click node_page_routes "https://github.com/goldengr/mccapescapecord/blob/main/dash/api/pages.py"
click node_dynamic_pages "https://github.com/goldengr/mccapescapecord/blob/main/dash/database/dynamicPages.py"
click node_user_data "https://github.com/goldengr/mccapescapecord/blob/main/dash/database/user.py"
click node_cape_roles "https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/miscellaneous/capeRoles.py"
click node_code_check "https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/miscellaneous/checkCode.py"
click node_ticket_management "https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/ticketManagement/sendTicketManuall.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_bot_runtime,node_cape_roles,node_code_check,node_ticket_management,node_discord_user toneBlue
class node_vouch_commands,node_vouches_command,node_add_vouch,node_approve_command,node_delete_command,node_get_vouch_command,node_cooldown_command,node_vouch_buttons,node_vouch_paginator,node_vouch_menu,node_vouch_embed,node_vouch_selector,node_vouch_submit,node_vouch_approve,node_vouch_delete,node_vouch_get,node_vouch_list,node_vouch_misc toneAmber
class node_dashboard_runtime,node_login_routes,node_page_routes,node_dynamic_pages toneMint
class node_supabase,node_microsoft_auth,node_user_data toneRose
class node_discord_platform,node_microsoft,node_xbox,node_minecraft toneIndigo
```

## Components

### Discord bot

- [Bot runtime](https://github.com/goldengr/mccapescapecord/blob/main/bot/main.py): `bot/main.py`
- [Cape roles](https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/miscellaneous/capeRoles.py): `bot/cogs/miscellaneous/capeRoles.py`
- [Code checking](https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/miscellaneous/checkCode.py): `bot/cogs/miscellaneous/checkCode.py`
- [Manual ticket sending](https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/ticketManagement/sendTicketManuall.py): `bot/cogs/ticketManagement/sendTicketManuall.py`

### Vouch features

- [Vouch commands](https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/vouch/vouch.py): `bot/cogs/vouch/vouch.py`
- [Browse vouches](https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/vouch/vouches.py): `bot/cogs/vouch/vouches.py`
- [Add vouch](https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/vouch/addVouch.py): `bot/cogs/vouch/addVouch.py`
- [Approve command](https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/vouch/aprooveVouch.py): `bot/cogs/vouch/aprooveVouch.py`
- [Delete command](https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/vouch/deleteVouch.py): `bot/cogs/vouch/deleteVouch.py`
- [Get vouch](https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/vouch/getVouch.py): `bot/cogs/vouch/getVouch.py`
- [Remove cooldown](https://github.com/goldengr/mccapescapecord/blob/main/bot/cogs/vouch/removeVouchCooldown.py): `bot/cogs/vouch/removeVouchCooldown.py`
- [Staff review buttons](https://github.com/goldengr/mccapescapecord/blob/main/bot/api/vouchStaffButtonsView.py): `bot/api/vouchStaffButtonsView.py`
- [Vouch pagination](https://github.com/goldengr/mccapescapecord/blob/main/bot/api/vouchPageinatorMenu.py): `bot/api/vouchPageinatorMenu.py`
- [Vouch menu](https://github.com/goldengr/mccapescapecord/blob/main/bot/api/vouchMenu.py): `bot/api/vouchMenu.py`
- [Vouch embed](https://github.com/goldengr/mccapescapecord/blob/main/bot/api/createVouchEmbed.py): `bot/api/createVouchEmbed.py`
- [Page selector embed](https://github.com/goldengr/mccapescapecord/blob/main/bot/api/createVouchSelectorEmbed.py): `bot/api/createVouchSelectorEmbed.py`
- [Submit vouch](https://github.com/goldengr/mccapescapecord/blob/main/bot/api/vouch.py): `bot/api/vouch.py`
- [Approve vouch](https://github.com/goldengr/mccapescapecord/blob/main/bot/api/approveVouch.py): `bot/api/approveVouch.py`
- [Delete vouch](https://github.com/goldengr/mccapescapecord/blob/main/bot/api/deleteVouch.py): `bot/api/deleteVouch.py`
- [Fetch vouch](https://github.com/goldengr/mccapescapecord/blob/main/bot/api/getVouch.py): `bot/api/getVouch.py`
- [List vouches](https://github.com/goldengr/mccapescapecord/blob/main/bot/api/getVouches.py): `bot/api/getVouches.py`
- [Vouch utilities](https://github.com/goldengr/mccapescapecord/blob/main/bot/api/mitelanius.py): `bot/api/mitelanius.py`

### Staff dashboard

- [Dashboard app](https://github.com/goldengr/mccapescapecord/blob/main/dash/main.py): `dash/main.py`
- [Login routes](https://github.com/goldengr/mccapescapecord/blob/main/dash/api/login.py): `dash/api/login.py`
- [Staff page routes](https://github.com/goldengr/mccapescapecord/blob/main/dash/api/pages.py): `dash/api/pages.py`
- [Dynamic page data](https://github.com/goldengr/mccapescapecord/blob/main/dash/database/dynamicPages.py): `dash/database/dynamicPages.py`

### Identity and data

- **Supabase**
- [Microsoft Minecraft auth](https://github.com/goldengr/mccapescapecord/blob/main/dash/api/loginWithMicrosoft.py): `dash/api/loginWithMicrosoft.py`
- [User and session data](https://github.com/goldengr/mccapescapecord/blob/main/dash/database/user.py): `dash/database/user.py`

### Other components

- **Discord user**
- **Discord platform**
- **Microsoft identity**
- **Xbox Live and XSTS**
- **Minecraft services**

## Connections

- Bot runtime → Discord platform: connects to (evidence: `bot/main.py`)
- Bot runtime → Supabase: creates client (evidence: `bot/main.py`)
- Bot runtime → Staff review buttons: registers views (evidence: `bot/main.py`)
- Bot runtime → Vouch commands: loads extension (evidence: `bot/main.py`)
- Bot runtime → Browse vouches: loads extension (evidence: `bot/main.py`)
- Bot runtime → Get vouch: loads extension (evidence: `bot/main.py`)
- Bot runtime → Approve command: loads extension (evidence: `bot/main.py`)
- Bot runtime → Delete command: loads extension (evidence: `bot/main.py`)
- Bot runtime → Add vouch: loads extension (evidence: `bot/main.py`)
- Bot runtime → Remove cooldown: loads extension (evidence: `bot/main.py`)
- Bot runtime → Code checking: loads extension (evidence: `bot/main.py`)
- Bot runtime → Manual ticket sending: loads extension (evidence: `bot/main.py`)
- Vouch commands → Staff review buttons: uses controls (evidence: `bot/cogs/vouch/vouch.py`)
- Vouch commands → Submit vouch: submits vouch (evidence: `bot/cogs/vouch/vouch.py`)
- Vouch commands → Vouch utilities: uses utilities (evidence: `bot/cogs/vouch/vouch.py`)
- Add vouch → Submit vouch: submits vouch (evidence: `bot/cogs/vouch/addVouch.py`)
- Add vouch → Vouch embed: renders embed (evidence: `bot/cogs/vouch/addVouch.py`)
- Approve command → Approve vouch: approves vouch (evidence: `bot/cogs/vouch/aprooveVouch.py`)
- Delete command → Delete vouch: deletes vouch (evidence: `bot/cogs/vouch/deleteVouch.py`)
- Get vouch → Fetch vouch: fetches vouch (evidence: `bot/cogs/vouch/getVouch.py`)
- Get vouch → Vouch embed: renders embed (evidence: `bot/cogs/vouch/getVouch.py`)
- Browse vouches → List vouches: lists vouches (evidence: `bot/cogs/vouch/vouches.py`)
- Browse vouches → Vouch pagination: paginates results (evidence: `bot/cogs/vouch/vouches.py`)
- Browse vouches → Vouch utilities: uses utilities (evidence: `bot/cogs/vouch/vouches.py`)
- Remove cooldown → Delete vouch: uses deletion (evidence: `bot/cogs/vouch/removeVouchCooldown.py`)
- Remove cooldown → Submit vouch: uses submission (evidence: `bot/cogs/vouch/removeVouchCooldown.py`)
- Staff review buttons → Approve vouch: approves vouch (evidence: `bot/api/vouchStaffButtonsView.py`)
- Staff review buttons → Delete vouch: deletes vouch (evidence: `bot/api/vouchStaffButtonsView.py`)
- Staff review buttons → Fetch vouch: fetches vouch (evidence: `bot/api/vouchStaffButtonsView.py`)
- Vouch pagination → Page selector embed: renders selector (evidence: `bot/api/vouchPageinatorMenu.py`)
- Vouch pagination → Vouch menu: shows page (evidence: `bot/api/vouchPageinatorMenu.py`)
- Vouch menu → Vouch embed: renders vouch (evidence: `bot/api/vouchMenu.py`)
- Dashboard app → Login routes: registers blueprint (evidence: `dash/main.py`)
- Dashboard app → Staff page routes: registers blueprint (evidence: `dash/main.py`)
- Login routes → Microsoft Minecraft auth: starts auth (evidence: `dash/api/login.py`)
- Login routes → User and session data: reads and writes (evidence: `dash/api/login.py`)
- Login routes → Discord platform: requests identity (evidence: `dash/api/login.py`)
- Microsoft Minecraft auth → Microsoft identity: exchanges tokens (evidence: `dash/api/loginWithMicrosoft.py`)
- Microsoft Minecraft auth → Xbox Live and XSTS: authenticates (evidence: `dash/api/loginWithMicrosoft.py`)
- Microsoft Minecraft auth → Minecraft services: gets profile (evidence: `dash/api/loginWithMicrosoft.py`)
- Staff page routes → User and session data: checks session (evidence: `dash/api/pages.py`)
- Staff page routes → Dynamic page data: loads page data (evidence: `dash/api/pages.py`)
- Dynamic page data → Supabase: queries (evidence: `dash/database/dynamicPages.py`)
- User and session data → Supabase: queries (evidence: `dash/database/user.py`)
- Cape roles → Discord platform: manages roles
