/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.

/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
/ARCHITECTURE
How it is built
- 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.
- 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.
- 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.
- 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.
- 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
Screens





/MORE_WORK