{"id":13426389,"url":"https://github.com/agenda/agendash","last_synced_at":"2025-04-14T20:44:48.878Z","repository":{"id":4231903,"uuid":"52418027","full_name":"agenda/agendash","owner":"agenda","description":"Agenda Dashboard","archived":false,"fork":false,"pushed_at":"2024-09-05T18:43:13.000Z","size":2433,"stargazers_count":799,"open_issues_count":47,"forks_count":218,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-07T18:05:19.325Z","etag":null,"topics":["agendash","cron","cronjob","crontab","dashboard","job-scheduler","middleware"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agenda.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-24T05:52:34.000Z","updated_at":"2025-04-06T13:03:39.000Z","dependencies_parsed_at":"2024-06-18T12:27:51.996Z","dependency_job_id":"7e1e40b3-46f6-4388-a958-ba4aead7da18","html_url":"https://github.com/agenda/agendash","commit_stats":{"total_commits":190,"total_committers":37,"mean_commits":5.135135135135135,"dds":0.8526315789473684,"last_synced_commit":"e86e7f7d3e411c1d61f2975dd2876a17b7205b38"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agenda%2Fagendash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agenda%2Fagendash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agenda%2Fagendash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agenda%2Fagendash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agenda","download_url":"https://codeload.github.com/agenda/agendash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248960349,"owners_count":21189982,"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":["agendash","cron","cronjob","crontab","dashboard","job-scheduler","middleware"],"created_at":"2024-07-31T00:01:33.343Z","updated_at":"2025-04-14T20:44:48.830Z","avatar_url":"https://github.com/agenda.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","others","Job Scheduling and Queues"],"sub_categories":["React Components"],"readme":"# Agendash\n\nA Dashboard for [Agenda](https://github.com/agenda/agenda).\n\n---\n\n### Features\n\n- Job status auto-refreshes: 60-second polling by default.\n- Schedule a new job from the UI.\n- Dive in to see more details about the job, like the json data.\n- Requeue a job. Clone the data and run immediately.\n- Delete jobs. Useful for cleaning up old completed jobs.\n- Search jobs by name and metadata. Supports querying by Mongo Object Id.\n- Pagination\n- Responsive UI\n\n---\n\n### Screenshots\n\n#### Dashboard\n\n![Auto-refresh list of jobs](all-jobs.png)\n\n---\n\n#### Create jobs\n\n![See job details, requeue or delete jobs](create-job.png)\n\n---\n\n#### Search by name, metadata, job status\n\n![Search for a job by name or metadata ](search.png)\n\n---\n\n#### Responsive UI\n\n![Mobile UI small devices](mobile-ui-sm.png)\n\n![Mobile UI extra small devices](mobile-ui-xs.png)\n\n---\n\n# Troubleshooting\n\n### Index for sorting\n\nIt may be required to create the following index for faster sorting (see [#24](https://github.com/agenda/agendash/issues/24))\n\n```\ndb.agendaJobs.ensureIndex({\n    \"nextRunAt\" : -1,\n    \"lastRunAt\" : -1,\n    \"lastFinishedAt\" : -1\n}, \"agendash\")\n```\n\n---\n\n# Roadmap\n\n- [ ] Get more test coverage\n- [ ] Add middlewares for fastify, and other express-like libraries\n- [ ] You decide! Submit a feature request\n\n### Install\n\n```\nnpm install --save agendash\n```\n\n_Note_: `Agendash` requires mongodb version \u003e2.6.0 to perform the needed aggregate queries. This is your mongo database version, not your node package version! To check your database version, connect to mongo and run `db.version()`.\n\n### Middleware usage\n\n#### Express\n\nAgendash provides Express middleware you can use at a specified path, for example this will\nmake Agendash available on your site at the `/dash` path. Note: Do not try to mount Agendash\nat the root level like `app.use('/', Agendash(agenda))`.\n\n```js\nvar express = require(\"express\");\nvar app = express();\n\n// ... your other express middleware like body-parser\n\nvar Agenda = require(\"agenda\");\nvar Agendash = require(\"agendash\");\n\nvar agenda = new Agenda({ db: { address: \"mongodb://127.0.0.1/agendaDb\" } });\n// or provide your own mongo client:\n// var agenda = new Agenda({mongo: myMongoClient})\n\napp.use(\"/dash\", Agendash(agenda));\n\n// ... your other routes\n\n// ... start your server\n```\n\nBy mounting Agendash as middleware on a specific path, you may provide your\nown authentication for that path. For example if you have an authenticated\nsession using passport, you can protect the dashboard path like this:\n\n```js\napp.use(\n  \"/dash\",\n  function (req, res, next) {\n    if (!req.user || !req.user.is_admin) {\n      res.send(401);\n    } else {\n      next();\n    }\n  },\n  Agendash(agenda)\n);\n```\n\nOther middlewares will come soon in the folder `/lib/middlewares/`.\nYou'll just have to update the last line to require the middleware you need:\n\n```js\napp.use(\n  \"/agendash\",\n  Agendash(agenda, {\n    middleware: \"connect\",\n  })\n);\n```\n\nNote that if you use a CSRF protection middleware like [`csurf`](https://www.npmjs.com/package/csurf), you might need to [configure it off](https://github.com/agenda/agendash/issues/23#issuecomment-270917949) for Agendash-routes.\n\n#### Hapi\n\nA minimum Node.js version 12 is required for `@hapi/hapi` dependency.\n\n```shell\nnpm i @hapi/inert @hapi/hapi\n```\n\n```js\nconst agenda = new Agenda().database(\n  \"mongodb://127.0.0.1/agendaDb\",\n  \"agendaJobs\"\n);\n\nconst server = require(\"@hapi/hapi\").server({\n  port: 3002,\n  host: \"localhost\",\n});\nawait server.register(require(\"@hapi/inert\"));\nawait server.register(\n  Agendash(agenda, {\n    middleware: \"hapi\",\n  })\n);\n\nawait server.start();\n```\n\nThen browse to `http://localhost:3002/`.\n\n#### Koa\n\n```shell\nnpm i koa koa-bodyparser koa-router koa-static\n```\n\n```js\nconst agenda = new Agenda().database(\n  \"mongodb://127.0.0.1/agendaDb\",\n  \"agendaJobs\"\n);\n\nconst Koa = require(\"koa\");\nconst app = new Koa();\nconst middlewares = Agendash(agenda, {\n  middleware: \"koa\",\n});\nfor (const middleware of middlewares) {\n  app.use(middleware);\n}\n\nawait app.listen(3002);\n```\n\nThen browse to `http://localhost:3002/`.\n\n#### Fastify\n\n```shell\nnpm i fastify\n```\n\n```js\nconst agenda = new Agenda().database(\n  \"mongodb://127.0.0.1/agendaDb\",\n  \"agendaJobs\"\n);\n\nconst Fastify = require(\"fastify\");\nconst fastify = new Fastify();\n\nfastify.register(\n  Agendash(\n    agenda, \n    { middleware: \"fastify\" }\n  );\n);\n\nawait fastify.listen(3002);\n```\n\nThen browse to `http://localhost:3002/`.\n\n### Standalone usage\n\nAgendash comes with a standalone Express app which you can use like this:\n\n```bash\n./node_modules/.bin/agendash --db=mongodb://localhost/agendaDb --collection=agendaCollection --port=3002\n```\n\nor like this, for default collection `agendaJobs` and default port `3000`:\n\n```bash\n./node_modules/.bin/agendash --db=mongodb://localhost/agendaDb\n```\n\nIf you are using npm \u003e= 5.2, then you can use [npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b):\n\n```bash\nnpx agendash --db=mongodb://localhost/agendaDb --collection=agendaCollection --port=3002\n```\n\nThen browse to `http://localhost:3002/`.\n\n### Docker usage\n\nAgendash can also be run within a Docker container like this:\n\n```bash\ndocker run -p 3000:3000 \\\n  --env MONGODB_URI=mongo://myUser:myPass@myHost/myDb \\\n  --env COLLECTION=myAgendaCollection agenda/agendash\n```\n\nThen browse to `http://localhost:3000/`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagenda%2Fagendash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagenda%2Fagendash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagenda%2Fagendash/lists"}