# wasgto3/arklum architecture

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

- Interactive diagram: https://gitdiagram.com/wasgto3/arklum
- Repository: https://github.com/wasgto3/arklum

## Overview

Arklum is a self-hosted Discord bot dashboard: a browser uses the Node.js application to manage a bot and receive results through Socket.IO. The main workflow spans dashboard messaging and server-management requests, backend feature handlers, and Discord operations; separate branches cover direct messages, voice, bot settings, utilities, webhook and standalone-chat surfaces, and plugins. The README documents the overall browser/backend/Discord arrangement, while the source excerpts show specific module registration and calls. Some frontend wiring and unsampled feature internals are represented only at subsystem level.

Main entry points: [`bot.js`](https://github.com/wasgto3/arklum/blob/main/bot.js) (Node application), [`static/core/session.js`](https://github.com/wasgto3/arklum/blob/main/static/core/session.js) (Socket session), [`static/shell/shell.js`](https://github.com/wasgto3/arklum/blob/main/static/shell/shell.js) (Dashboard shell), [`modules/chat.js`](https://github.com/wasgto3/arklum/blob/main/modules/chat.js) (Messages and voice)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application Runtime"]
  node_application["Node application<br/>[bot.js]"]
end

subgraph group_dashboard["Browser Dashboard"]
  node_dashboard_shell["Dashboard shell<br/>[shell.js]"]
  node_socket_session["Socket session<br/>[session.js]"]
  node_dashboard_router["Page router<br/>[router.js]"]
  node_chat_page["Chat page<br/>[chat.js]"]
  node_dm_page["DM page<br/>[dms.js]"]
  node_management_page["Management pages<br/>[management.js]"]
  node_bot_page["Bot settings<br/>[bot.js]"]
  node_settings_page["User settings<br/>[settings.js]"]
  node_utility_page["Utility page<br/>[utility.js]"]
  node_plugins_page["Plugins page<br/>[plugins.js]"]
  node_voice_ui["Voice controls<br/>[voice.js]"]
end

subgraph group_discord_features["Discord Features"]
  node_chat_backend["Messages and voice<br/>[chat.js]"]
  node_dm_backend["Direct messages<br/>[dms.js]"]
  node_guild_commands["Guild operations<br/>[guild.js]"]
  node_channel_commands["Channel operations<br/>[channels.js]"]
  node_status["Bot presence<br/>[status.js]"]
  node_devportal["Developer settings<br/>[devportal.js]"]
  node_utility["Bot utilities<br/>[utility.js]"]
  node_memes["Meme tools<br/>[memes.js]"]
  node_updater["Update controls<br/>[updater.js]"]
end

subgraph group_extensions["Extensions and Sites"]
  node_plugin_loader["Plugin loader<br/>[loader.js]"]
  node_plugin_api["Plugin API v1<br/>[api.js]"]
  node_plugin_api_v2["Plugin API v2<br/>[api_v2.js]"]
  node_marketplace["Plugin marketplace<br/>[marketplace.js]"]
  node_standalone_chat["Standalone chat site<br/>[chatsite.js]"]
  node_webhook_studio["Webhook studio<br/>[webhooks_site.js]"]
end

node_operator(("Dashboard user"))
node_browser(("Browser"))
node_discord{{"Discord"}}
node_site_visitor(("Site visitor"))

node_operator -->|"uses"| node_browser
node_browser -->|"HTTP dashboard"| node_application
node_application -->|"Socket.IO"| node_browser
node_application -->|"bot integration"| node_discord
node_application -->|"loads"| node_chat_backend
node_application -->|"loads"| node_dm_backend
node_application -->|"loads"| node_guild_commands
node_application -->|"loads"| node_channel_commands
node_application -->|"loads"| node_status
node_application -->|"loads"| node_devportal
node_application -->|"loads"| node_utility
node_application -->|"loads"| node_memes
node_application -->|"loads"| node_updater
node_application -->|"loads"| node_plugin_api
node_application -->|"loads"| node_marketplace
node_application -->|"loads"| node_standalone_chat
node_application -->|"loads"| node_webhook_studio
node_browser -->|"renders"| node_dashboard_shell
node_dashboard_shell -->|"routes pages"| node_dashboard_router
node_dashboard_shell -->|"communicates"| node_socket_session
node_socket_session -->|"Socket.IO requests"| node_application
node_chat_page -.->|"requests data"| node_socket_session
node_dm_page -.->|"requests data"| node_socket_session
node_management_page -.->|"requests data"| node_socket_session
node_bot_page -.->|"requests data"| node_socket_session
node_settings_page -.->|"requests data"| node_socket_session
node_utility_page -.->|"requests data"| node_socket_session
node_plugins_page -.->|"requests data"| node_socket_session
node_voice_ui -.->|"voice controls"| node_socket_session
node_application -->|"handles commands"| node_chat_backend
node_application -->|"dispatches commands"| node_guild_commands
node_application -->|"dispatches commands"| node_channel_commands
node_chat_backend -->|"messages and voice"| node_discord
node_dm_backend -.->|"manages DMs"| node_discord
node_guild_commands -->|"manages guilds"| node_discord
node_channel_commands -->|"manages channels"| node_discord
node_devportal -->|"calls app API"| node_discord
node_utility -.->|"performs utilities"| node_discord
node_status -.->|"sets presence"| node_discord
node_memes -.->|"uses bot"| node_discord
node_updater -.->|"bot updates"| node_discord
node_marketplace -->|"loads installed plugins"| node_plugin_loader
node_plugin_loader -->|"uses API"| node_plugin_api
node_plugin_api_v2 -->|"bridges calls"| node_plugin_api
node_site_visitor -.->|"visits"| node_standalone_chat
node_site_visitor -.->|"visits"| node_webhook_studio
node_standalone_chat -->|"uses bot services"| node_application
node_webhook_studio -->|"uses bot services"| node_application

click node_application "https://github.com/wasgto3/arklum/blob/main/bot.js"
click node_dashboard_shell "https://github.com/wasgto3/arklum/blob/main/static/shell/shell.js"
click node_socket_session "https://github.com/wasgto3/arklum/blob/main/static/core/session.js"
click node_dashboard_router "https://github.com/wasgto3/arklum/blob/main/static/core/router.js"
click node_chat_page "https://github.com/wasgto3/arklum/blob/main/static/pages/chat.js"
click node_dm_page "https://github.com/wasgto3/arklum/blob/main/static/pages/dms.js"
click node_management_page "https://github.com/wasgto3/arklum/blob/main/static/pages/management.js"
click node_bot_page "https://github.com/wasgto3/arklum/blob/main/static/pages/bot.js"
click node_settings_page "https://github.com/wasgto3/arklum/blob/main/static/pages/settings.js"
click node_utility_page "https://github.com/wasgto3/arklum/blob/main/static/pages/utility.js"
click node_plugins_page "https://github.com/wasgto3/arklum/blob/main/static/pages/plugins.js"
click node_voice_ui "https://github.com/wasgto3/arklum/blob/main/static/shell/voice.js"
click node_chat_backend "https://github.com/wasgto3/arklum/blob/main/modules/chat.js"
click node_dm_backend "https://github.com/wasgto3/arklum/blob/main/modules/dms.js"
click node_guild_commands "https://github.com/wasgto3/arklum/blob/main/modules/commands/guild.js"
click node_channel_commands "https://github.com/wasgto3/arklum/blob/main/modules/commands/channels.js"
click node_status "https://github.com/wasgto3/arklum/blob/main/modules/status.js"
click node_devportal "https://github.com/wasgto3/arklum/blob/main/modules/devportal.js"
click node_utility "https://github.com/wasgto3/arklum/blob/main/modules/utility.js"
click node_memes "https://github.com/wasgto3/arklum/blob/main/modules/memes.js"
click node_updater "https://github.com/wasgto3/arklum/blob/main/modules/updater.js"
click node_plugin_loader "https://github.com/wasgto3/arklum/blob/main/plugins/loader.js"
click node_plugin_api "https://github.com/wasgto3/arklum/blob/main/plugins/api.js"
click node_plugin_api_v2 "https://github.com/wasgto3/arklum/blob/main/plugins/api_v2.js"
click node_marketplace "https://github.com/wasgto3/arklum/blob/main/plugins/marketplace.js"
click node_standalone_chat "https://github.com/wasgto3/arklum/blob/main/modules/chatsite.js"
click node_webhook_studio "https://github.com/wasgto3/arklum/blob/main/modules/webhooks_site.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_application,node_operator,node_browser toneBlue
class node_dashboard_shell,node_socket_session,node_dashboard_router,node_chat_page,node_dm_page,node_management_page,node_bot_page,node_settings_page,node_utility_page,node_plugins_page,node_voice_ui toneAmber
class node_chat_backend,node_dm_backend,node_guild_commands,node_channel_commands,node_status,node_devportal,node_utility,node_memes,node_updater toneMint
class node_plugin_loader,node_plugin_api,node_plugin_api_v2,node_marketplace,node_standalone_chat,node_webhook_studio toneRose
class node_discord,node_site_visitor toneIndigo
```

## Components

### Application Runtime

- [Node application](https://github.com/wasgto3/arklum/blob/main/bot.js): `bot.js`

### Browser Dashboard

- [Dashboard shell](https://github.com/wasgto3/arklum/blob/main/static/shell/shell.js): `static/shell/shell.js`
- [Socket session](https://github.com/wasgto3/arklum/blob/main/static/core/session.js): `static/core/session.js`
- [Page router](https://github.com/wasgto3/arklum/blob/main/static/core/router.js): `static/core/router.js`
- [Chat page](https://github.com/wasgto3/arklum/blob/main/static/pages/chat.js): `static/pages/chat.js`
- [DM page](https://github.com/wasgto3/arklum/blob/main/static/pages/dms.js): `static/pages/dms.js`
- [Management pages](https://github.com/wasgto3/arklum/blob/main/static/pages/management.js): `static/pages/management.js`
- [Bot settings](https://github.com/wasgto3/arklum/blob/main/static/pages/bot.js): `static/pages/bot.js`
- [User settings](https://github.com/wasgto3/arklum/blob/main/static/pages/settings.js): `static/pages/settings.js`
- [Utility page](https://github.com/wasgto3/arklum/blob/main/static/pages/utility.js): `static/pages/utility.js`
- [Plugins page](https://github.com/wasgto3/arklum/blob/main/static/pages/plugins.js): `static/pages/plugins.js`
- [Voice controls](https://github.com/wasgto3/arklum/blob/main/static/shell/voice.js): `static/shell/voice.js`

### Discord Features

- [Messages and voice](https://github.com/wasgto3/arklum/blob/main/modules/chat.js): `modules/chat.js`
- [Direct messages](https://github.com/wasgto3/arklum/blob/main/modules/dms.js): `modules/dms.js`
- [Guild operations](https://github.com/wasgto3/arklum/blob/main/modules/commands/guild.js): `modules/commands/guild.js`
- [Channel operations](https://github.com/wasgto3/arklum/blob/main/modules/commands/channels.js): `modules/commands/channels.js`
- [Bot presence](https://github.com/wasgto3/arklum/blob/main/modules/status.js): `modules/status.js`
- [Developer settings](https://github.com/wasgto3/arklum/blob/main/modules/devportal.js): `modules/devportal.js`
- [Bot utilities](https://github.com/wasgto3/arklum/blob/main/modules/utility.js): `modules/utility.js`
- [Meme tools](https://github.com/wasgto3/arklum/blob/main/modules/memes.js): `modules/memes.js`
- [Update controls](https://github.com/wasgto3/arklum/blob/main/modules/updater.js): `modules/updater.js`

### Extensions and Sites

- [Plugin loader](https://github.com/wasgto3/arklum/blob/main/plugins/loader.js): `plugins/loader.js`
- [Plugin API v1](https://github.com/wasgto3/arklum/blob/main/plugins/api.js): `plugins/api.js`
- [Plugin API v2](https://github.com/wasgto3/arklum/blob/main/plugins/api_v2.js): `plugins/api_v2.js`
- [Plugin marketplace](https://github.com/wasgto3/arklum/blob/main/plugins/marketplace.js): `plugins/marketplace.js`
- [Standalone chat site](https://github.com/wasgto3/arklum/blob/main/modules/chatsite.js): `modules/chatsite.js`
- [Webhook studio](https://github.com/wasgto3/arklum/blob/main/modules/webhooks_site.js): `modules/webhooks_site.js`

### Other components

- **Dashboard user**
- **Browser**
- **Discord**
- **Site visitor**

## Connections

- Dashboard user → Browser: uses
- Browser → Node application: HTTP dashboard
- Node application → Browser: Socket.IO
- Node application → Discord: bot integration
- Node application → Messages and voice: loads (evidence: `bot.js`)
- Node application → Direct messages: loads (evidence: `bot.js`)
- Node application → Guild operations: loads (evidence: `bot.js`)
- Node application → Channel operations: loads (evidence: `bot.js`)
- Node application → Bot presence: loads (evidence: `bot.js`)
- Node application → Developer settings: loads (evidence: `bot.js`)
- Node application → Bot utilities: loads (evidence: `bot.js`)
- Node application → Meme tools: loads (evidence: `bot.js`)
- Node application → Update controls: loads (evidence: `bot.js`)
- Node application → Plugin API v1: loads (evidence: `bot.js`)
- Node application → Plugin marketplace: loads (evidence: `bot.js`)
- Node application → Standalone chat site: loads (evidence: `bot.js`)
- Node application → Webhook studio: loads (evidence: `bot.js`)
- Browser → Dashboard shell: renders
- Dashboard shell → Page router: routes pages
- Dashboard shell → Socket session: communicates
- Socket session → Node application: Socket.IO requests
- Chat page → Socket session: requests data
- DM page → Socket session: requests data
- Management pages → Socket session: requests data
- Bot settings → Socket session: requests data
- User settings → Socket session: requests data
- Utility page → Socket session: requests data
- Plugins page → Socket session: requests data
- Voice controls → Socket session: voice controls
- Node application → Messages and voice: handles commands (evidence: `modules/chat.js`)
- Node application → Guild operations: dispatches commands (evidence: `modules/commands/guild.js`)
- Node application → Channel operations: dispatches commands (evidence: `modules/commands/channels.js`)
- Messages and voice → Discord: messages and voice (evidence: `modules/chat.js`)
- Direct messages → Discord: manages DMs
- Guild operations → Discord: manages guilds (evidence: `modules/commands/guild.js`)
- Channel operations → Discord: manages channels (evidence: `modules/commands/channels.js`)
- Developer settings → Discord: calls app API (evidence: `modules/devportal.js`)
- Bot utilities → Discord: performs utilities
- Bot presence → Discord: sets presence
- Meme tools → Discord: uses bot
- Update controls → Discord: bot updates
- Plugin marketplace → Plugin loader: loads installed plugins (evidence: `plugins/marketplace.js`)
- Plugin loader → Plugin API v1: uses API (evidence: `plugins/loader.js`)
- Plugin API v2 → Plugin API v1: bridges calls (evidence: `plugins/api_v2.js`)
- Site visitor → Standalone chat site: visits
- Site visitor → Webhook studio: visits
- Standalone chat site → Node application: uses bot services (evidence: `modules/chatsite.js`)
- Webhook studio → Node application: uses bot services (evidence: `modules/webhooks_site.js`)
