Case Study

Discord Gambling Hub

A multi-repo virtual economy and casino platform for Discord communities: configurable games, gated ATM deposits, predictions, raffles, VIP rooms, quests, and a Next.js admin panel.

Built as three applications: Discord bot, admin dashboard, and a shared NPM package. Schemas, math, and configuration never drift between Discord and the web.

Status

Shipped for the current scope: multi-repo economy and casino, European roulette, interactive sessions, engagement systems, admin ops, presentation demo, workers, CI/VPS deploy, and Vitest coverage. Core platform is complete.

Discord Gambling Hub overview
Discord bot and admin dashboard overview.

How it grew

The project did not start as a three-repo platform. It grew in layers as the problem got harder:

Discord bot & casino commands
Next.js admin panel
Shared NPM package
Full multi-app ecosystem
  • Phase 1 - Discord bot: slash commands, virtual currency, and early casino games living in one Node process.
  • Phase 2 - Admin dashboard: guild managers needed tables, settings, and ATM approval without digging through Discord embeds.
  • Phase 3 - Shared package: duplicated schemas and payout math were a drift risk, so models, Zod forms, and RTP helpers moved into gambling-bot-shared.
  • Phase 4 - Ecosystem: interactive multi-bet games, quests, pay, workers for abandoned sessions, audits, and per-game ops controls.

Motivation & goals

The target was a persistent, auditable casino in Discord - deeper than one-off fun commands. Moderators tune the economy without redeploying; players get transparent rules, history, and fair odds.

  • Per-guild virtual currency with immutable transaction logs and admin-approved deposits/withdrawals (suited to RP servers).
  • Configurable casino games with computed RTP, not magic numbers - including multi-bet interactive sessions.
  • Engagement systems: daily bonuses, VIP rooms, predictions, raffles, and quests.
  • A web dashboard for managers to inspect users, cash flow, ATM queues, health, and settings.
  • One shared TypeScript package so bot and dashboard never disagree on schemas or math.

System at a glance

Each app deploys independently and talks to the same MongoDB. The bot owns gameplay and Discord side effects; the dashboard owns OAuth, forms, and ops views; the shared package owns the rules both must agree on.

Discord Bot

  • discord.js v14 + CommandKit
  • Casino, ATM, VIP, predictions, raffles, quests, mod tools
  • Background workers for sessions & economy hygiene
  • Vitest + mongodb-memory-server

Shared Package

  • Domain subpath exports (casino, vip, quests, …)
  • Mongoose models + Zod form schemas
  • RTP math, bet validators, defaults
  • Versioned independently; bot & admin pin together

Admin Dashboard

  • Next.js 16, React 19, Tailwind 4
  • Discord OAuth + guild-scoped access
  • Users, ATM queue, reports, health, audits
  • Live RTP while editing casino settings

Deep dives

Repositories & community