# hirishav/spacex-discord-bot architecture

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

- Interactive diagram: https://gitdiagram.com/hirishav/spacex-discord-bot
- Repository: https://github.com/hirishav/spacex-discord-bot

## Overview

SpaceX is a Discord bot for server management and community features, accompanied by a React website with command information and server configuration pages. The likely user flow is Discord commands or website interaction leading to bot features and, where shown, persistent data changes. The tree and homepage identify moderation, tickets, fun, welcome, and premium capabilities; only some internal calls are visible in the excerpts, so other relationships are omitted or marked unverified.

Main entry points: [`website/src/pages/Home.jsx`](https://github.com/hirishav/spacex-discord-bot/blob/main/website/src/pages/Home.jsx) (Website home), [`cogs/moderation`](https://github.com/hirishav/spacex-discord-bot/tree/main/cogs/moderation) (Moderation commands), [`database.py`](https://github.com/hirishav/spacex-discord-bot/blob/main/database.py) (Bot database), [`cogs/moderation/mod_logs.py`](https://github.com/hirishav/spacex-discord-bot/blob/main/cogs/moderation/mod_logs.py) (Moderation event logs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bot["Bot runtime"]
  node_bot_runtime["Bot runtime<br/>[main.py]"]
  node_premium_features["Premium features<br/>[premium.py]"]
  node_database[("Bot database<br/>[database.py]")]
end

subgraph group_moderation["Server administration"]
  node_moderation_commands["Moderation commands"]
  node_channel_hiding["Channel hiding<br/>[mod_hide.py]"]
  node_mod_event_logs["Moderation event logs<br/>[mod_logs.py]"]
  node_ticket_system["Ticket system<br/>[ticket.py]"]
  node_welcome_system["Welcome setup<br/>[welcome.py]"]
end

subgraph group_community["Community features"]
  node_fun_commands["Fun commands"]
  node_clan_features["Clan system<br/>[fun_clan.py]"]
  node_gif_actions["GIF actions<br/>[gif_actions.py]"]
  node_utility_commands["Utility commands"]
  node_help_browser["Help browser<br/>[help.py]"]
end

subgraph group_web["Website"]
  node_web_home["Website home<br/>[Home.jsx]"]
  node_web_config["Website configuration<br/>[config.js]"]
  node_dashboard_pages["Dashboard pages"]
  node_web_commands["Command catalogue<br/>[commands.js]"]
  node_web_server["Web server<br/>[web_server.py]"]
end

node_discord_user(("Discord user"))
node_server_admin(("Server admin"))
node_search_services["Search services"]

node_discord_user -.->|"issues commands"| node_bot_runtime
node_server_admin -.->|"manages server"| node_moderation_commands
node_moderation_commands -.->|"includes"| node_channel_hiding
node_discord_user -.->|"opens tickets"| node_ticket_system
node_discord_user -.->|"uses commands"| node_fun_commands
node_clan_features -->|"reads and writes"| node_database
node_ticket_system -->|"reads and writes"| node_database
node_mod_event_logs -->|"reads configuration"| node_database
node_mod_event_logs -.->|"sends log events"| node_moderation_commands
node_channel_hiding -.->|"uses time helpers"| node_moderation_commands
node_discord_user -.->|"browses site"| node_web_home
node_web_home -->|"imports settings"| node_web_config
node_web_home -.->|"links to pages"| node_dashboard_pages
node_web_home -.->|"links commands"| node_web_commands
node_web_config -.->|"configures API"| node_web_server
node_utility_commands -->|"queries services"| node_search_services

click node_bot_runtime "https://github.com/hirishav/spacex-discord-bot/blob/main/main.py"
click node_moderation_commands "https://github.com/hirishav/spacex-discord-bot/tree/main/cogs/moderation"
click node_channel_hiding "https://github.com/hirishav/spacex-discord-bot/blob/main/cogs/moderation/mod_hide.py"
click node_mod_event_logs "https://github.com/hirishav/spacex-discord-bot/blob/main/cogs/moderation/mod_logs.py"
click node_ticket_system "https://github.com/hirishav/spacex-discord-bot/blob/main/cogs/ticket/ticket.py"
click node_welcome_system "https://github.com/hirishav/spacex-discord-bot/blob/main/cogs/welcome/welcome.py"
click node_premium_features "https://github.com/hirishav/spacex-discord-bot/blob/main/cogs/exclusive/premium.py"
click node_fun_commands "https://github.com/hirishav/spacex-discord-bot/tree/main/cogs/fun"
click node_clan_features "https://github.com/hirishav/spacex-discord-bot/blob/main/cogs/fun/fun_clan.py"
click node_gif_actions "https://github.com/hirishav/spacex-discord-bot/blob/main/cogs/gif/gif_actions.py"
click node_utility_commands "https://github.com/hirishav/spacex-discord-bot/tree/main/cogs/utility"
click node_help_browser "https://github.com/hirishav/spacex-discord-bot/blob/main/cogs/utility/help.py"
click node_database "https://github.com/hirishav/spacex-discord-bot/blob/main/database.py"
click node_web_home "https://github.com/hirishav/spacex-discord-bot/blob/main/website/src/pages/Home.jsx"
click node_web_config "https://github.com/hirishav/spacex-discord-bot/blob/main/website/src/config.js"
click node_dashboard_pages "https://github.com/hirishav/spacex-discord-bot/tree/main/website/src/pages"
click node_web_commands "https://github.com/hirishav/spacex-discord-bot/blob/main/website/src/data/commands.js"
click node_web_server "https://github.com/hirishav/spacex-discord-bot/blob/main/web_server.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_premium_features,node_database,node_discord_user toneBlue
class node_moderation_commands,node_channel_hiding,node_mod_event_logs,node_ticket_system,node_welcome_system toneAmber
class node_fun_commands,node_clan_features,node_gif_actions,node_utility_commands,node_help_browser,node_server_admin toneMint
class node_web_home,node_web_config,node_dashboard_pages,node_web_commands,node_web_server toneRose
class node_search_services toneIndigo
```

## Components

### Bot runtime

- [Bot runtime](https://github.com/hirishav/spacex-discord-bot/blob/main/main.py): `main.py`
- [Premium features](https://github.com/hirishav/spacex-discord-bot/blob/main/cogs/exclusive/premium.py): `cogs/exclusive/premium.py`
- [Bot database](https://github.com/hirishav/spacex-discord-bot/blob/main/database.py): `database.py`

### Server administration

- [Moderation commands](https://github.com/hirishav/spacex-discord-bot/tree/main/cogs/moderation): `cogs/moderation`
- [Channel hiding](https://github.com/hirishav/spacex-discord-bot/blob/main/cogs/moderation/mod_hide.py): `cogs/moderation/mod_hide.py`
- [Moderation event logs](https://github.com/hirishav/spacex-discord-bot/blob/main/cogs/moderation/mod_logs.py): `cogs/moderation/mod_logs.py`
- [Ticket system](https://github.com/hirishav/spacex-discord-bot/blob/main/cogs/ticket/ticket.py): `cogs/ticket/ticket.py`
- [Welcome setup](https://github.com/hirishav/spacex-discord-bot/blob/main/cogs/welcome/welcome.py): `cogs/welcome/welcome.py`

### Community features

- [Fun commands](https://github.com/hirishav/spacex-discord-bot/tree/main/cogs/fun): `cogs/fun`
- [Clan system](https://github.com/hirishav/spacex-discord-bot/blob/main/cogs/fun/fun_clan.py): `cogs/fun/fun_clan.py`
- [GIF actions](https://github.com/hirishav/spacex-discord-bot/blob/main/cogs/gif/gif_actions.py): `cogs/gif/gif_actions.py`
- [Utility commands](https://github.com/hirishav/spacex-discord-bot/tree/main/cogs/utility): `cogs/utility`
- [Help browser](https://github.com/hirishav/spacex-discord-bot/blob/main/cogs/utility/help.py): `cogs/utility/help.py`

### Website

- [Website home](https://github.com/hirishav/spacex-discord-bot/blob/main/website/src/pages/Home.jsx): `website/src/pages/Home.jsx`
- [Website configuration](https://github.com/hirishav/spacex-discord-bot/blob/main/website/src/config.js): `website/src/config.js`
- [Dashboard pages](https://github.com/hirishav/spacex-discord-bot/tree/main/website/src/pages): `website/src/pages`
- [Command catalogue](https://github.com/hirishav/spacex-discord-bot/blob/main/website/src/data/commands.js): `website/src/data/commands.js`
- [Web server](https://github.com/hirishav/spacex-discord-bot/blob/main/web_server.py): `web_server.py`

### Other components

- **Discord user**
- **Server admin**
- **Search services**

## Connections

- Discord user → Bot runtime: issues commands
- Server admin → Moderation commands: manages server
- Moderation commands → Channel hiding: includes
- Discord user → Ticket system: opens tickets
- Discord user → Fun commands: uses commands
- Clan system → Bot database: reads and writes (evidence: `cogs/fun/fun_clan.py`)
- Ticket system → Bot database: reads and writes (evidence: `cogs/ticket/ticket.py`)
- Moderation event logs → Bot database: reads configuration (evidence: `cogs/moderation/mod_logs.py`)
- Moderation event logs → Moderation commands: sends log events
- Channel hiding → Moderation commands: uses time helpers
- Discord user → Website home: browses site
- Website home → Website configuration: imports settings (evidence: `website/src/pages/Home.jsx`)
- Website home → Dashboard pages: links to pages (evidence: `website/src/pages/Home.jsx`)
- Website home → Command catalogue: links commands
- Website configuration → Web server: configures API
- Utility commands → Search services: queries services (evidence: `cogs/utility/util_search.py`)
