/PROJECT 13 · DISCORD-CONTROLLED AUTOMATION SERVICE (PERSONAL SYSTEMS-DESIGN PROJECT)

NitroBot and Manager

A single-process Node.js service that runs long-lived, resource-heavy browser automation jobs for a private, role-gated Discord community. Members start sessions through slash commands, watch progress live in DMs, and review stats and history; admins get a monitoring and control console. Behind the chat interface is a service with the concerns of any backend: queuing, concurrency, session lifecycle, retries, a swappable persistence layer, observability and graceful shutdown. This is a personal systems-design project, not client work.

BUILT BY TAIWO EMMANUEL · FULL-STACK DEVELOPER

Nitro Type Bot Player — screenshot 1

/GOAL

Run long-lived, resource-heavy browser jobs behind a chat interface — with the queue, lifecycle and observability of a real service.

/STACK

Technologies used

  • Node.js 20+
  • discord.js 14
  • Puppeteer (puppeteer-core + stealth plugin)
  • Prisma 6
  • PostgreSQL
  • MongoDB
  • Winston
  • node:test
  • Docker
  • Node.js
  • Discord.js
  • Puppeteer
  • Automation
  • Prisma
  • Architecture
  • Testing
  • Personal project

/ARCHITECTURE

How it is built

  1. Commands and modals — Discord control planeSlash commands, buttons and private modals for linking an account, starting sessions, monitoring progress and reading stats. A single router applies guild whitelist, role checks, cooldowns and an error boundary with reference IDs.
  2. Queue and lifecycle — Session orchestrationA FIFO queue with a concurrency cap, one active session per user (in memory and in the database), plan quotas that count requested races of queued sessions, timeouts, and cooperative cancellation through a single AbortController.
  3. Swappable persistence — Repository contractPostgreSQL, MongoDB and in-memory drivers implement the same shape, verified by one shared contract test. Selecting a driver is an environment variable.
  4. Game runner — Automation boundaryThe only automation API the services touch. It can be replaced wholesale, and it is what makes the rest of the system testable without a browser.
  5. Operations — Observability and recoveryReference-ID error reporting, structured logs synced to the database, an audit trail, health and readiness probes, a scheduled upstream integrity check, graceful shutdown, and recovery of interrupted sessions.

/SCOPE

What was delivered

  • Gate access by Discord guild and role, with optional per-plan quotas
  • Automate GamePlay
  • Link an account for unattended sessions, or run once with credentials that are never stored
  • Queue, run and cancel sessions with concurrency limits, timeouts and guaranteed final status
  • Stream a live progress card to DMs and expose /status, /stats, /history and /notify
  • Persist through one repository contract with PostgreSQL, MongoDB and in-memory drivers
  • Log to the database with reference IDs, an audit trail and health endpoints
  • Recover interrupted sessions and offer a resume flow
  • Run 105 tests with no token, browser, network or database

/NOTES

Scope boundaries

NitroBot automates interactions with a third-party game and is subject to that service's terms. It is a systems-design project: the engineering focus is the session engine, repository contract, error taxonomy and testability, not the automation itself.

/GALLERY

/MORE_WORK