{"id":13549967,"url":"https://github.com/hazim-j/zeroqueue","last_synced_at":"2025-04-02T23:31:27.693Z","repository":{"id":47784356,"uuid":"269250656","full_name":"hazim-j/zeroqueue","owner":"hazim-j","description":"⏰ A low-code queue management system ⏰","archived":true,"fork":false,"pushed_at":"2021-08-13T02:53:33.000Z","size":1739,"stargazers_count":95,"open_issues_count":10,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-31T23:51:58.397Z","etag":null,"topics":["developer-tools","jobs","nodejs","queue","redis","scheduler"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hazim-j.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-04T03:22:50.000Z","updated_at":"2024-09-14T21:32:40.000Z","dependencies_parsed_at":"2022-08-31T01:01:25.215Z","dependency_job_id":null,"html_url":"https://github.com/hazim-j/zeroqueue","commit_stats":null,"previous_names":["thezeroqueue/zeroqueue"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazim-j%2Fzeroqueue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazim-j%2Fzeroqueue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazim-j%2Fzeroqueue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazim-j%2Fzeroqueue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hazim-j","download_url":"https://codeload.github.com/hazim-j/zeroqueue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246910971,"owners_count":20853652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["developer-tools","jobs","nodejs","queue","redis","scheduler"],"created_at":"2024-08-01T12:01:27.546Z","updated_at":"2025-04-02T23:31:26.148Z","avatar_url":"https://github.com/hazim-j.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/zeroqueue"],"categories":["JavaScript"],"sub_categories":[],"readme":"# ZeroQueue\n\n⏰ A low-code queue management system ⏰\n\nPowered by [BullMQ](https://github.com/optimalbits/bull) - _the fastest, most reliable, Redis-based queue for Node._\n\n![](https://i.imgur.com/Lva6crv.png)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e •\n  \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e •\n  \u003ca href=\"#contribute\"\u003eContribute\u003c/a\u003e •\n  \u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\n\u003c/p\u003e\n\n## Installation\n\nA containerised version of ZeroQueue can be easily setup using docker with the following environment variables:\n\n| Env Var        | Description                                                 |\n| -------------- | ----------------------------------------------------------- |\n| DATABASE_URL   | Connection string for a sequelize supported database.       |\n| REDIS_URL      | Connection string for a Redis database.                     |\n| SESSION_SECRET | A string of atleast 32 characters to encrypt user sessions. |\n\nA built image of ZeroQueue is currently hosted on [Docker Hub](https://hub.docker.com/r/zeroqueue/zeroqueue). This will allow you to run the app in most environments and platforms such as docker-compose, Heroku, or Kubernetes.\n\n### Running using the Docker CLI\n\n1. First pull the image down from the registry.\n\n```bash\ndocker pull zeroqueue/zeroqueue:latest\n```\n\n2. You will then need to run migrations on your database. ZeroQueue uses [sequelize](https://github.com/sequelize/sequelize) ORM. **This will assume you have a supported database already created with the connection string assinged to the envinronment variable `DATABASE_URL`.**\n\n```bash\ndocker run --rm -e DATABASE_URL zeroqueue/zeroqueue:latest npm run db:sync\n```\n\nIf the database is running on `localhost` you will also need to set the `--network=\"host\"` argument.\n\n```bash\ndocker run --rm -e DATABASE_URL --network=\"host\" zeroqueue/zeroqueue:latest npm run db:sync\n```\n\n3. Once the above step finishes successfully, you can start ZeroQueue using the followng command. **This will assume you have correctly assigned the environment variables for `DATABASE_URL`, `REDIS_URL`, and `SESSION_SECRET`.** See the above table for details.\n\n```bash\ndocker run --rm -d -e DATABASE_URL -e REDIS_URL -e SESSION_SECRET -p 9376:9376 --name zeroqueue zeroqueue/zeroqueue:latest\n```\n\nNote that the above command will map port `9376` to the ZeroQueue app. If running locally this will be available on http://localhost:9376.\n\nIf you are running the database and redis on localhost too, you will need to make sure the ZeroQueue container has access to the host network. On mac and windows this can be achieved by replacing `localhost` or `127.0.0.1` with `host.docker.internal`.\n\n### Environment specific examples\n\n_Feel free to open an issue if you would like to see instructions for setting up ZeroQueue in certain environments or platforms._\n\n## Usage\n\nEach zeroqueue instance has many `queues` and each queue has many `jobs` with a different `status`.\n\n### Credentials\n\nWhen you first login to ZeroQueue the credentials will be set to the following default values:\n\n- username: `admin`\n- password: `password`\n\nIt is recommended that you change this immediately via the settings, especially if running in production.\n\n### Queues\n\nNew queues can be spun up by providing a name and an optional schedule. Schedules are currently set using a crontab (you can use [crontab.guru](https://crontab.guru/) as a reference).\n\nIf no schedule is specified, then jobs will be processed as soon as they enter the queue.\n\n### Jobs\n\nJobs can be bulk added to the queue using a JSON file. The system expects the JSON file to be an `array` of `objects` with each object representing a single job.\n\nEach job in the array has the following fields.\n\n| Field | Description                                                                                                                                                              |\n| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| name  | A string to identify the job. This will default to a random id if left blank.                                                                                            |\n| data  | This is the data that will be made available to workers.                                                                                                                 |\n| opts  | These are custom job options and will have the same interface as specified by the [BullMQ docs](https://github.com/OptimalBits/bull/blob/develop/REFERENCE.md#queueadd). |\n\nThe schema to validate a JSON file is:\n\n```json\n{\n  \"type\": \"array\",\n  \"items\": {\n    \"$ref\": \"#/definitions/jobs\"\n  },\n  \"definitions\": {\n    \"jobs\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"name\": {\n          \"type\": \"string\"\n        },\n        \"data\": {\n          \"type\": \"object\"\n        },\n        \"opts\": {\n          \"type\": \"object\"\n        }\n      }\n    }\n  }\n}\n```\n\n### Workers\n\nThe worker is the only piece of code you'll need to worry about in this system.\n\nStart by installing BullMQ:\n\n```bash\nnpm install bull\n```\n\nTo spin up a worker you can either follow the [BullMQ quick start guide](https://github.com/OptimalBits/bull#quick-guide) or use the following template:\n\n```javascript\nconst Queue = require('bull');\n\nconst queue = new Queue('YOUR QUEUE NAME', process.env.REDIS_URL);\n\nqueue.process('*', async (job) =\u003e {\n  const { data } = job;\n\n  // worker code here...\n  job.log(JSON.stringify(data));\n\n  // capture job progress...\n  job.progress(100);\n\n  // returns a promise...\n  return data;\n});\n```\n\n## Contribute\n\nPull requests on this project are welcome, or feel free to open an issue if you would like to see a feature added or bug fixed. You can also support this project by donating.\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.buymeacoffee.com/zeroqueue\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n### Running from source in development mode\n\nZeroQueue is built using [NextJS](https://nextjs.org/) so this will assume you have node.js and npm installed locally. You will also need docker for any backing services.\n\n1. Install dependencies\n\n```bash\nnpm install\n```\n\n2. Setup backing services (i.e. postgreSQL and Redis)\n\n```bash\nnpm run dev:services:up\nnpm run db:sync\n```\n\n3. Start the dev server\n\n```bash\nnpm run dev\n```\n\nWhen you are done you can stop the server and tear down the backing services using:\n\n```bash\nnpm run dev:services:down\n```\n\n### Running tests\n\n_TBA_\n\n### Running Lint\n\nZeroQueue uses both [ESLint](https://eslint.org/) and [Prettier](https://prettier.io/) for code linting and formatting.\n\n```bash\nnpm run lint\n```\n\n## License\n\n\u003e This project is licensed under the GNU GPLv3 License - see the LICENSE.md file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazim-j%2Fzeroqueue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhazim-j%2Fzeroqueue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazim-j%2Fzeroqueue/lists"}