File Reference

File Reference

Quick reference for the purpose of each major file and directory in the project.

Backend Root Files

FilePurpose
config.example.ymlTemplate configuration - copy to config.yml
config.ymlActive bot configuration (DO NOT COMMIT)
package.jsonNode.js dependencies and npm scripts
tsconfig.jsonTypeScript compiler configuration
DockerfileDocker image build definition
.envEnvironment variable overrides (TOKEN, etc.)
.gitignoreGit ignore rules
mewwme.database.jsonJSON database file (when using JSON driver)
patreon_cache.jsonCached Patreon pledge data

Backend Source (src/)

Core

FilePurpose
index.tsEntry point - creates Manager and attaches global error handlers
manager.tsManager class - extends discord.js Client, orchestrates all services

Types (@types/)

FilePurpose
Config.tsTypeScript interface mapping config.yml structure
Button.tsPlayer button type definitions
Cluster.tsCluster/shard type definitions
Emoji.tsEmoji configuration types
Interaction.tsInteraction handling types
Lavalink.tsLavalink connection types

Guild Helpers (@guild-helpers/)

FilePurpose
AssistanceHandler.tsHelpdesk/ticket assistance automation
StatisticsHandler.tsUser and guild statistics tracking

Commands (commands/)

DirectoryCountPurpose
Filter/26Audio filter toggle commands
Games/12Interactive Discord games
Info/13Information and statistics commands
Music/25Music playback and queue management
Playlist/10Personal playlist CRUD
Settings/14Guild and bot configuration

Database (database/)

FilePurpose
index.tsDatabaseService - selects and initializes driver
@types.tsDatabaseTable type with all table references
handler.tsPost-connection handler (cleanup, migrations)
keyChecker.tsValidates database config keys at startup
driver/json.tsJSON file driver
driver/mongodb.tsMongoDB driver
driver/mysql.tsMySQL driver
driver/postgres.tsPostgreSQL driver
setup/table.tsRegisters all database tables
setup/setup.tsInitial setup routines
setup/premium.tsPremium expiry cleanup
setup/lavalink.tsLavalink node persistence

Handlers (handlers/)

FilePurpose
index.tsMaster handler - loads all sub-handlers
loadCheck.tsLavalink autofix checker
loadCommand.tsCommand and button loader
loadEvents.tsEvent listener loader
loadPlayer.tsPlayer event loader

Mewslink (mewslink/)

File/DirPurpose
Mewslink.tsMain Mewslink class - manages nodes and players
main.tsMewslinkPlayer class with custom data store
metadata.tsVersion metadata
Manager/Node registry and player allocation
Node/Node connection and communication
Player/Player state, queue, filters
Drivers/Lavalink v4 protocol drivers
Library/Discord.js adapter
Plugin/Plugin system
Utilities/Shared utilities

Services (services/)

FilePurpose
ConfigDataService.tsParses config.yml with env var interpolation
DeployService.tsRegisters slash commands globally
LoggerService.tsWinston logger with daily rotation
ManifestService.tsReads package.json metadata
PatreonService.tsPatreon pledge management
KofiService.tsKo-fi subscription management
TopggService.tsTop.gg vote tracking
MysqlBackup.tsScheduled MySQL database backups
TempVoiceService.tsTemporary voice channel management
FilterMenuService.tsAudio filter select menu builder
MusicTriviaService.tsMusic trivia game logic, scoring, badges
MusicTriviaSongBank.tsCurated song bank (600+ tracks, 12 genres)
SpotifyTopChartService.tsSpotify top chart data

Structures (structures/)

FilePurpose
Command.tsBase command class
CommandHandler.tsCommand execution router
Collection.tsExtended Collection
Localization.tsi18n wrapper
Mewslink.tsMewslink initializer
Page.tsEmbed pagination
PageQueue.tsQueue pagination
QuickDatabasePlus.tsEnhanced QuickDB wrapper with cache

Utilities (utilities/)

FilePurpose
ConvertTime.tsTime conversion helpers
FormatDuration.tsDuration formatting
ProgressBar.tsTrack progress bar renderer
RadioStations.tsRadio station list
ScrobbleToLastFM.tsLast.fm scrobble utility
SpotifygetAccessToken.tsSpotify token refresh
TopArtist.tsListening stats: top artists
TopTrack.tsListening stats: top tracks
BroadcastConfig.tsBroadcast tips configuration
NormalizeTrackMetadata.tsTrack metadata normalization and lyrics queries

Web Layer (web/)

FilePurpose
RestAPI.tsFastify REST API server (port 2555)
WebServer.tsExpress webhook server (port 2444)
player.tsPlayer REST routes
websocket.tsInternal WebSocket route

Dashboard (web/dashboard/)

FilePurpose
DashboardPlugin.tsFastify plugin - OAuth2, sessions, CORS, Socket.IO, all /api/* routes
DiscordOAuth.tsDiscord OAuth2 helper
SpotifyOAuthService.tsSpotify OAuth2 flow
UserProfileService.tsUser profile CRUD
LikedSongsService.tsLiked songs CRUD
BotWsService.tsBot-to-dashboard WebSocket bridge
SocketBridge.tsSocket.IO bridge for real-time events
AiChatService.tsGemini AI chat integration
AiChatHistoryDb.tsAI chat history database operations
SessionLoginService.tsSession persistence store

Route Handlers (web/route/)

FilePurpose
getCommands.tsList all bot commands
getTopServers.tsTop servers by member count
getGlobalStats.tsGlobal bot statistics
getUserStats.tsUser listening statistics
getGuildStats.tsGuild statistics
getUserPlaylists.tsUser's playlists
getUserPremium.tsUser premium status and feature access
guildSettings.tsGuild settings CRUD
externalServices.tsExternal service integrations
resolveDashboardAccess.tsDashboard access control resolution
adminLegacyPremium.tsAdmin premium management
adminBotProfile.tsAdmin bot profile management
adminHelpdesk.tsAdmin helpdesk/ticket management
premiumClaim.tsPremium claim/unclaim

Deployment Files

Scripts (scripts/)

FilePurpose
clearSlash.jsRemove all registered slash commands
copyData.jsPost-build data copy (languages, etc.)
ecosystem.config.jsPM2 process configuration
getCampignId.jsPatreon campaign ID fetcher

Additional Files (additional-file/)

FilePurpose
api-domain.shNginx setup script for API domain
ws-domain.shNginx setup script for WebServer domain
application.ymlReference Lavalink configuration

Pterodactyl Eggs (additional-file/Eggs Panel Pterodactyl/)

FilePurpose
egg-node-js-generic.jsonGeneric Node.js egg
egg-node-j-s--universal.jsonUniversal Node.js egg
egg-a-i-o.jsonAll-in-one egg
egg-lavalink.jsonLavalink server egg

Frontend Source (frontend/src/)

File/DirPurpose
App.tsxRoot component with routing and providers
main.tsxVite entry point
config/links.tsExternal link definitions
config/team.jsonTeam member data
hooks/useAuth.tsxAuthentication context
hooks/usePlayer.tsPlayer state management
hooks/useSocket.tsSocket.IO connection
hooks/useLikedSongs.tsLiked songs management
hooks/useTrackColor.tsAlbum art color extraction
pages/Page components (16 pages)
components/ui/Radix UI primitives
components/dashboard/Dashboard-specific components
lib/config.tsRuntime configuration