Skip to content

feat(queue): implement add BullMQ queue monitoring dashboard#111

Open
Neziahtech wants to merge 3 commits into
amina69:mainfrom
Neziahtech:feat/queue-dashboard
Open

feat(queue): implement add BullMQ queue monitoring dashboard#111
Neziahtech wants to merge 3 commits into
amina69:mainfrom
Neziahtech:feat/queue-dashboard

Conversation

@Neziahtech
Copy link
Copy Markdown

Closes #36
Depends on #30

Summary
This PR sets up a Bull Board dashboard to provide visibility into BullMQ queue activity. Without it, investigating failed jobs, monitoring processing throughput, or manually retrying stuck jobs requires dropping into Redis directly. The dashboard exposes active, completed, and failed job states through a web UI and supports job inspection and retry from the browser, scoped behind an admin auth guard so it is not publicly accessible.

Changes
src/queue/queue-dashboard.module.ts (new file)

Registers the Bull Board UI using @bull-board/express as a NestJS middleware module
Adds a BullMQAdapter for each registered queue so all queues are visible in a single dashboard view
Mounts the dashboard at /admin/queues

src/queue/queue-dashboard.guard.ts (new file)

Implements an AdminAuthGuard that checks for a valid admin session or API key header before serving dashboard routes
Returns 401 for unauthenticated requests so the dashboard is not publicly accessible

src/app.module.ts

Imports QueueDashboardModule
Applies AdminAuthGuard to the /admin/queues route prefix

src/queue/queue.module.ts

Exports queue instances so QueueDashboardModule can register BullMQAdapters against them

.env.example

Adds BULL_BOARD_USERNAME and BULL_BOARD_PASSWORD for basic auth configuration
Adds QUEUE_DASHBOARD_PATH (default: /admin/queues) for configurable mount path

src/queue/queue-dashboard.module.spec.ts (new file)

Verifies the dashboard module registers without error
Asserts that unauthenticated requests to /admin/queues return 401
Confirms authenticated requests return 200 with queue data

Dashboard capabilities
Active jobs — displays jobs currently being processed, with worker ID and processing duration
Completed jobs — shows recently completed jobs with return values and processing time
Failed jobs — surfaces failed jobs with full error stack traces for inspection
Job retry — failed jobs can be retried individually from the UI without redeployment
Job detail — each job is inspectable: payload, attempts, logs, timestamps, and queue name

Access
The dashboard is mounted at /admin/queues (configurable via QUEUE_DASHBOARD_PATH). Requests must include a valid admin credential. In development this is satisfied by the BULL_BOARD_USERNAME and BULL_BOARD_PASSWORD values in .env. In production, the AdminAuthGuard should be wired to the application's existing admin authentication mechanism.

Dependencies
This PR depends on the BullMQ queue setup introduced in #30. The queues registered there are the ones surfaced in the dashboard. If #30 is not yet merged, this branch should be rebased on top of it before review.

Testing
npm run test -- queue-dashboard
Manual verification:

Start the application with a running Redis instance
Navigate to http://localhost:3000/admin/queues
Enqueue a test job and confirm it appears under Active
Allow it to complete and confirm it moves to Completed
Trigger a deliberate failure and confirm it appears under Failed with the stack trace
Use the Retry button and confirm the job re-enters the Active state

Checklist

Dashboard accessible at /admin/queues
Active, completed, and failed jobs displayed
Individual jobs inspectable with full payload and error detail
Failed jobs retryable from the UI
Dashboard protected behind AdminAuthGuard
All registered BullMQ queues surfaced via BullMQAdapter
Environment variables documented in .env.example

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@Neziahtech Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@amina69
Copy link
Copy Markdown
Owner

amina69 commented Jun 2, 2026

@Neziahtech pipeline failing

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Queue Dashboard

2 participants