Neural Database.
A comprehensive glossary of the Apex engine and its operational subsystems.
📑 Table of Contents
01 // Core Architecture
The Nexus Protocol v11 is built on a distributed MERN-adjacent stack optimized for high-frequency Discord interactions. The Omega Core utilizes Node.js worker threads to isolate shard processes, preventing a failure in one sector from cascading across the entire neural matrix.
➔ Load Balancer: Internal Shard Manager (Worker Threads)
➔ Persistence: MongoDB Atlas cluster with global write concerns.
➔ Runtime: Node.js 18+ (LTS) on optimized Linux kernels.
➔ Framework: Discord.js v14 with full Intent coverage.
➔ Models: User, Warning, BlacklistEntry, GuildConfig.
02 // Infrastructure Requirements
Deploying a private Nexus node requires a high-availability environment to maintain the 99.9% uptime SLA.
- Minimal: 2 vCPU, 4GB RAM, 20GB NVMe SSD.
- Optimal: 4 vCPU, 8GB RAM, 50GB NVMe SSD (Recommended for >500 guilds).
- OS: Ubuntu 22.04 LTS or Debian 11+.
- Node.js: v18+ LTS required.
- MongoDB: Atlas M10+ cluster or self-hosted replica set.
03 // Economy Scaling Logic
The neural economy utilizes a per-guild asset ledger. Each userId+guildId pair maps to a unique document in the User collection, supporting wallet and bank balances, inventory, badges, XP, and streak tracking.
// Atomic balance update
const user = await User.findOneAndUpdate(
{ userId, guildId },
{ $inc: { balance: reward } },
{ upsert: true, new: true }
);
04 // Security Protocols
Founders maintain absolute dominion over the framework through OWNER_ID environment variable validation. The interactionCreate handler serves as the primary gatekeeper, rejecting unauthorized payloads before they reach the command execution layer. The global blacklist is persisted in MongoDB with TTL-based auto-expiration.
- Owner-only commands verified via
client.ownersarray - Global blacklist with automatic TTL expiration
- Per-command cooldown enforcement with owner bypass
- Error ID tracking for all execution failures
05 // Leveling & XP System
The v11 Apex Core features a comprehensive XP and leveling system. Members earn XP for each message sent (with cooldown-based rate limiting), and level up as XP accumulates. The leveling formula follows an exponential curve.
// Level-up threshold calculation
const xpNeeded = 5 * (level ** 2) + 50 * level + 100;
// XP per message: 15-25 random, 60s cooldown
const xpGain = Math.floor(Math.random() * 11) + 15;
- Toggle per-guild via
/config leveling on/off - Level-up announcements in configured channel
- View progress with
/profile - XP stored on User model, persisted across restarts
06 // Auto-Moderation Pipeline
The auto-moderation system runs in the messageCreate event, intercepting messages before they reach the community. Configurable via /automod, each guild can enable independent rules.
- Anti-Spam: Detects rapid message bursts (5+ msgs in 5s)
- Anti-Link: Blocks URLs/invite links with configurable whitelist
- Word Filter: Custom blacklisted word list per guild
- Settings persist in GuildConfig model
- Infractions auto-logged to the configured log channel
07 // Ticket System
The ticket system provides a zero-configuration support channel solution. Users invoke /ticket [reason] to create a private channel visible only to themselves and server administrators.
- Private channel created with restrictive permissions
- Close button embedded in the ticket channel
- Transcript generation on close (embedded in channel)
- No additional setup required — works out of the box
- Staff can manually close via button or delete channel