GithubHelp home page GithubHelp logo

isabella232 / bull-board Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bonniernews/bull-board

0.0 0.0 0.0 9.07 MB

๐ŸŽฏ Queue background jobs inspector

License: MIT License

JavaScript 9.97% TypeScript 70.28% CSS 19.02% Dockerfile 0.18% EJS 0.55%

bull-board's Introduction

bull-board ๐ŸŽฏ

Bull Dashboard is a UI built on top of Bull to help you visualize your queues and their jobs. With this library you get a beautiful UI for visualizing what's happening with each job in your queues, their status and some actions that will enable you to get the jobs done.

npm downloads licence snyk

UI Fails

Notes

As this library provides only the visualization for your queues, keep in mind that:

  • You must have either Bull or BullMQ installed in your projects;
  • Aside the options to retry and clean jobs, this library is not responsible for processing the jobs, reporting progress or any other thing. This must be done in your application with your own logic;
  • If you want to understand the possibilities you have with the queues please refer to Bull's docs;
  • This library doesn't hijack Bull's way of working.

If you want to learn more about queues and Redis: https://redis.io/.

Starting

To add it to your project start by adding the library to your dependencies list:

yarn add bull-board

Or

npm i bull-board

Hello World

The first step is to let bull-board know the queues you have already set up, to do so we use the setQueues method.

const Queue = require('bull')
const QueueMQ = require('bullmq')
const { setQueues, BullMQAdapter, BullAdapter } = require('bull-board')

const someQueue = new Queue()
const someOtherQueue = new Queue()
const queueMQ = new QueueMQ()

setQueues([
  new BullAdapter(someQueue),
  new BullAdapter(someOtherQueue),
  new BullMQAdapter(queueMQ),
]);

You can then add UI to your middlewares (this can be set up using an admin endpoint with some authentication method):

const app = require('express')()
const { router } = require('bull-board')

app.use('/admin/queues', router)

// other configurations for your server

That's it! Now you can access the /admin/queues route and you will be able to monitor everything that is happening in your queues ๐Ÿ˜

Queue options

  1. readOnlyMode (default: false) Makes the UI as read only, hides all queue & job related actions
     const Queue = require('bull')
     const QueueMQ = require('bullmq')
     const { setQueues, BullMQAdapter, BullAdapter } = require('bull-board')
     
     const someQueue = new Queue()
     const someOtherQueue = new Queue()
     const queueMQ = new QueueMQ()
     
     setQueues([
       new BullAdapter(someQueue, { readOnlyMode: true }), // only this queue will be in read only mode
       new BullAdapter(someOtherQueue),
       new BullMQAdapter(queueMQ, { readOnlyMode: true }),
     ]);

Hosting router on a sub path

If you host your express service on a different path than root (/) ie. https://<server_name>/<sub_path>/, then you can add the following code to provide the configuration to the bull-board router. In this example the sub path will be my-base-path.

const { router } = require('bull-board');

// ... express server configuration

let basePath = 'my-base-path';

app.use(
  '/queues',
  (req, res, next) => {
    req.proxyUrl = basePath + '/queues';
    next();
  },
  router);

You will then find the bull-board UI at the following address https://<server_name>/my-base-path/queues.

Contributing

First of all, thank you for being interested in helping out, your time is always appreciated in every way. ๐Ÿ’ฏ

Remember to read the Code of Conduct so you also help maintaining a good Open source community around this project!

Here's some tips:

  • Check the issues page for already opened issues (or maybe even closed ones) that might already address your question/bug/feature request.
  • When opening a bug report provide as much information as you can, some things might be useful for helping debugging and understading the problem
    • Node, Redis, Bull, bull-board versions
    • Sample code that reproduces the problem
    • Some of your environment details
    • Framework you're using (Express, Koa, Hapi, etc).
  • Feature requests are welcomed! Provide some details on why it would be helpful for you and others, explain how you're using bull-board and if possible even some screenshots if you are willing to mock something!

Developing

If you want to help us solving the issues, be it a bug, a feature or a question, you might need to fork and clone this project.

To fork a project means you're going to have your own version of it under your own GitHub profile, you do it by clicking the "Fork" button on the top of any project's page on GitHub.

Cloning a project means downloading it to your local machine, you do it in the command line:

git clone [email protected]:YOUR_GITHUB_USERNAME/bull-board.git

That will create a bull-board folder inside the directory you executed the command, so you need to navigate inside it:

cd bull-board

This project requires that you have yarn installed

Also make sure you are running Redis for this project (bull-board's example connects to Redis' default port 6379).

Now, to try it out locally you can run:

yarn && yarn start:dev

Acknowledgements โค๏ธ

  • Juan for building the first version of this library

License

This project is licensed under the MIT License, so it means it's completely free to use and copy, but if you do fork this project with nice additions that we could have here, remember to send a PR ๐Ÿ‘

bull-board's People

Contributors

vcapretz avatar felixmosh avatar yurickh avatar erikengervall avatar dependabot[bot] avatar ex7r3me avatar aliceclv avatar daric002 avatar embraser01 avatar snyk-bot avatar katsanva avatar kody-abe avatar sousandrei avatar arthurdenner avatar hans-lizihan avatar jonaskirch avatar josmas avatar kyleculp avatar sestolk avatar softbrix avatar eywek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.