How pupariaa/cordium works
Cordium is a Discord.js bot framework combining bot commands and event handling with a REST API, a configuration dashboard, and selectable persistence/cache backends. The main runtime path starts in index.js, initializes the bot and framework managers, then dispatches Discord interactions to loaded commands while event handlers process Discord activity. The README documents additional dashboard and deployment capabilities not fully visible in the excerpts; those are represented at subsystem level. Arrows are limited to relationships visible in excerpts or explicitly documented in the README.
Main entry points: index.js Bot bootstrap · EventsManager.js Event lifecycle · CommandsManager.js Command lifecycle · EndpointsManager.js Endpoint routing
Components 20
Bot runtime
- Bot bootstrap
index.js - Slash commands
src/commands - Discord event handlers
src/events
Framework management
- Command lifecycle
internals/CommandsManager.js - Event lifecycle
internals/EventsManager.js - Endpoint routing
internals/EndpointsManager.js - Hot reload and file watching
internals/FilesManager.js - Configuration management
internals/configManager.js
Data services
- Event recording
internals/EventsDatabase.js - Message database
internals/MessagesDatabase.js - Message cache
internals/MessagesCache.js - Cache backend selection
internals/CacheManager.js - Redis backend
internals/RedisManager.js - Attachment indexing
internals/AttachmentsManager.js
HTTP and dashboard
- Public and private API
src/endpoints - Configuration dashboard
configurator/public/app.js - Dashboard API server
configurator/server.js
Developer extensions
- Discord.js extensions
internals/prototypes
Other components
- Discord users and platform
- Bot developer
Connections 27
- Discord users and platform → Bot bootstrap: connects bot
- Bot bootstrap → Command lifecycle: initializes
index.js - Bot bootstrap → Event lifecycle: initializes
index.js - Bot bootstrap → Discord users and platform: registers interactions
index.js - Bot bootstrap → Slash commands: dispatches interactions
index.js - Command lifecycle → Slash commands: loads commands
- Event lifecycle → Discord event handlers: registers handlers
internals/EventsManager.js - Event lifecycle → Message database: deletes message records
internals/EventsManager.js - Bot developer → Slash commands: creates commands
- Bot developer → Discord event handlers: creates handlers
- Bot developer → Public and private API: creates endpoints
- Bot bootstrap → Endpoint routing: starts API manager
- Endpoint routing → Public and private API: routes requests
internals/EndpointsManager.js - Discord users and platform → Public and private API: requests operations
- Bot developer → Configuration dashboard: configures bot
- Configuration dashboard → Dashboard API server: calls dashboard API
configurator/public/app.js - Dashboard API server → Configuration management: updates settings
configurator/server.js - Dashboard API server → Message cache: reads messages
configurator/server.js - Bot bootstrap → Configuration management: loads settings
- Event lifecycle → Event recording: records activity
- Message cache → Cache backend selection: uses cache backend
- Cache backend selection → Redis backend: selects Redis
- Event lifecycle → Attachment indexing: indexes attachments
- Bot bootstrap → Discord.js extensions: extends Discord.js
- Command lifecycle → Hot reload and file watching: inherits file lifecycle
- Event lifecycle → Hot reload and file watching: inherits file lifecycle
internals/EventsManager.js - Endpoint routing → Hot reload and file watching: inherits file lifecycle
internals/EndpointsManager.js