Skip to content

Master-Bot Maintenance & Fix Roadmap #828

Description

@PhantomNimbi

Note

  • Primary Open Pull Request: All changes tracked in this issue are consolidated in Pull Request #829.
  • Repository Fork: Developed and maintained at PhantomNimbi/Master-Bot.
  • Lifecycle Policy: This master tracking issue details all architectural, infrastructural, and feature differences between upstream galnir/Master-Bot and the PhantomNimbi/Master-Bot modernization fork.

📊 High-Level Comparison Matrix

Component / Dimension Upstream (galnir/Master-Bot) Modernization Fork (PhantomNimbi/Master-Bot)
Runtime Architecture Multi-process: Bot (3000) & Dashboard (3001) run separately Single Node.js Process: Bot gateway & Dashboard unified on single PORT (3000)
Database Layer External PostgreSQL server (postgresql://...) Zero-Ops SQLite: Embedded packages/db/prisma/db.sqlite auto-created & migrated
Cache / State Store Standalone Redis server process (redis://...) In-Memory ioredis-mock: Zero external binaries or memory-hungry processes
Audio Engine Lavalink v3 (broken YouTube scraping, no plugins) Lavalink v4: Pre-configured YouTube (remote cipher, OAuth) & LavaSrc (Spotify)
External Audio Node No turnkey external server 1-Click external deployment via HELIX-Origin/Lavalink-Server
Web Dashboard Next.js 13/14 Pages Router Next.js 15 (App Router): React 18, tRPC v11, NextAuth v5 beta, 9 Studios
Cloud Deployment No 1-click cloud free tier support 1-Click Blueprints: Render (render.yaml), Railway, Heroku, Fly.io
Keep-Alive & Uptime None (sleeps on free tiers after 15 mins) Built-in Keep-Alive pinger (/health auto-pinged every 10 mins)
Command Suite Legacy slash commands 74 Slash Commands: Music, Moderation, Tickets, Reminders, Games, GIFs
Documentation Minimal README and docs 14-Page Comprehensive Wiki + complete architecture diagrams

🚀 Complete Breakdown of Differences

1. 🏗️ Consolidated Single-Process Architecture

  • Unified Port & Process: Merged the Discord Bot Gateway (Sapphire framework) and the Next.js 15 Web Dashboard (/dashboard) into a single Node.js process listening on PORT (default 3000).
  • Internal Web Server (apps/bot/src/lib/server/webServer.ts):
    • Serves landing root (/) and handles dashboard SSR routing.
    • Exposes /health endpoint for container health checks.
    • Houses a background keepAlive service pinging /health every 10 minutes to prevent free-tier cloud containers (e.g. Render) from spinning down due to inactivity.
  • Unified Dev & Start: Replaced separate multi-terminal launcher scripts with streamlined root pnpm dev and pnpm start commands.

2. 🗄️ Zero-Ops Database Migration (PostgreSQL ➔ SQLite)

  • Eliminated External DB Server: Removed all PostgreSQL daemon, container, and connection string requirements.
  • Embedded SQLite (packages/db/prisma/db.sqlite): Auto-created and migrated on initial setup.
  • SQLite Compatibility Schema:
    • Scalar String JSON arrays with helper serialization for Guild.notifyList, Guild.disabledCommands, and Guild.logEvents.
    • Enforced guildId on Reminder records for proper multi-tenant guild scoping.

3. ⚡ Zero-Process In-Memory State Store (Redis ➔ ioredis-mock)

  • Eliminated External Redis Server: Eradicated the need to install or run redis-server.
  • Integrated ioredis-mock: State caching, rate limiting, and session sharing operate entirely in-process with zero network overhead.

4. 🎵 Next-Gen Audio Architecture (Lavalink v4)

  • Lavalink v4 Migration: Upgraded audio infrastructure to Lavalink v4.
  • YouTube Plugin (dev.lavalink.youtube:youtube-plugin):
    • Remote signature cipher deciphering (YOUTUBE_CIPHER_URL).
    • Multi-client rotation (TV, MUSIC, ANDROID_VR, IOS, WEB).
    • Interactive /youtube-auth device flow storing OAuth2 refresh tokens to eliminate 429/IP blocks.
  • LavaSrc Plugin (com.github.topi314.lavasrc:lavasrc-plugin):
    • Native metadata resolution for Spotify tracks, albums, and playlists.
  • Player Interface:
    • Live ASCII progress bars and animated now-playing embeds with interactive button controls (apps/bot/src/lib/music).
  • Cloud Safe Audio Routing:
    • LAVA_EXTERNAL=true and LAVA_ENABLED=false configured on cloud blueprints to protect 512 MB containers from JVM Out-Of-Memory errors.
    • Direct integration with HELIX-Origin/Lavalink-Server for 1-click external Lavalink hosting.

5. 💻 Next.js 15 Web Dashboard Rewrite

  • Complete rewrite using Next.js 15 App Router, React 18, Tailwind CSS, and NextAuth.js v5 beta.
  • Backend powered by tRPC v11 (apps/dashboard/src/server).
  • 9 Comprehensive Feature Studios:
    1. Guild Studio: Responsive card grid with live Discord server icons and management routing.
    2. Music Studio: Real-time Lavalink player controls, live track queue, and audio filters.
    3. WYSIWYG Broadcaster: Visual embed composer with direct channel dispatcher.
    4. Granular Audit Logging: Per-server channel assignments for 20 discrete event triggers.
    5. Support Ticket Hub: Interactive thread-based ticket panel generator with manager roles and .txt transcript archiving.
    6. Reminders & Alerts: Centralized scheduled reminder manager and Twitch stream notification setup.
    7. Command Controls: Categorized enable/disable toggles for all 74 commands.
    8. Welcome Greetings: Rich embed and text template builder with live preview.
    9. Telemetry & System: Gateway latency, shard metrics, memory gauges, and audio node health.

6. ☁️ 1-Click Cloud Deployment Blueprints

  • Render (render.yaml): Free-tier Docker/Node web service blueprint with automated keep-alive.
  • Railway (railway.json): Nixpacks build specification with volume mount path for SQLite persistence (/packages/db/prisma).
  • Heroku (app.json & Procfile): Single-dyno Eco container manifest with environment variable defaults.
  • Fly.io (fly.toml): MicroVM deployment targeting port 3000 with NVMe volume support.
  • Docker (Dockerfile & docker-compose.yml): Production multi-stage single-container build.

7. 🧹 Environment Schema & Monorepo Hardening

  • Corrected Typo: Fixed INTERNA_URL to INTERNAL_URL monorepo-wide across all schemas and configs.
  • Pruned Dead Variables: Stripped all obsolete PostgreSQL and Redis variables (POSTGRES_*, REDIS_*).
  • Clean Compiler Options: Removed obsolete "ignoreDeprecations" flags and made apps/bot/tsconfig.json self-contained.
  • Compiled Declarations: Configured @master-bot/db to emit compiled JS and .d.ts declaration files via tsc for clean workspace imports.

8. 📚 Comprehensive Documentation Wiki

  • Authored a complete 14-page Wiki:
    Home.md, Architecture.md, Getting-Started.md, Configuration.md, Deployment.md, Commands.md, Music.md, Dashboard.md, Moderation.md, Tickets.md, Reminders-and-Twitch.md, Welcome-and-Temp-Channels.md, FAQ.md, and _Sidebar.md.

📊 Verification Matrix

✓ pnpm test           — 15 / 15 unit tests passing (100% pass rate)
✓ pnpm run type-check — 0 TypeScript errors across all 3 packages
✓ pnpm run build      — Production build succeeded for bot and dashboard

This master tracking issue remains OPEN until Pull Request #829 is accepted and merged into main.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions