{"id":30138020,"url":"https://github.com/moda20/scheduler_backend","last_synced_at":"2025-08-11T01:02:59.407Z","repository":{"id":295062691,"uuid":"952157756","full_name":"moda20/scheduler_backend","owner":"moda20","description":"A nodeJs based scheduler for your own coded small tasks, create a typesafe task and set it to run periodically using a cron setting or manually using the API. This is the Bun Js backend","archived":false,"fork":false,"pushed_at":"2025-07-31T20:24:41.000Z","size":30044,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-31T23:19:17.743Z","etag":null,"topics":["bun","bunjs","cronjob","cronjob-scheduler","prisma","scheduler"],"latest_commit_sha":null,"homepage":"","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/moda20.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-20T20:31:40.000Z","updated_at":"2025-07-31T20:24:43.000Z","dependencies_parsed_at":"2025-07-31T22:32:50.660Z","dependency_job_id":null,"html_url":"https://github.com/moda20/scheduler_backend","commit_stats":null,"previous_names":["moda20/scheduler_backend"],"tags_count":0,"template":false,"template_full_name":"ImJustLucas/bun-elysia-boilerplate","purl":"pkg:github/moda20/scheduler_backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moda20%2Fscheduler_backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moda20%2Fscheduler_backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moda20%2Fscheduler_backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moda20%2Fscheduler_backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moda20","download_url":"https://codeload.github.com/moda20/scheduler_backend/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moda20%2Fscheduler_backend/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269814341,"owners_count":24479363,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bun","bunjs","cronjob","cronjob-scheduler","prisma","scheduler"],"created_at":"2025-08-11T01:01:48.239Z","updated_at":"2025-08-11T01:02:59.386Z","avatar_url":"https://github.com/moda20.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scheduler Backend\n\nThis is the repo for the Scheduler backend. This acts as a task manager and authentication server.\n\n### Wiki\n\n[The general wiki](scheduler-docs-9p4lb6fmr-moda20s-projects.vercel.app) is out now, and is a good place to start if you want to have a general idea about the project.\nThis repo is only focused on the backend component\n\n## 📦 Installation\n\nThe installation process is best done via a docker container, here is a compose example\n\n```yaml\n  scheduler_backend:\n    image: ghcr.io/moda20/scheduler_backend:latest\n    container_name: scheduler_backend\n    restart: always\n    env_file:\n      - .env\n    volumes:\n      - ./:/usr/src/app/src/jobs:ro\n      - ./logs:/usr/src/app/src/logs/\n      - ./outputs:/usr/src/app/src/outputs/\n      - ./plugins:/usr/src/app/src/external/userPlugins\n    ports:\n      - \"8080:8080\"\n```\n\nthe compose file above will expose port 8080 and can take 3 volumes:\n\n- the jobs directory, should map to your project root directory, if you are using extra packages this shoudl point\n  to where your `package.json` is located\n- The logs directory, will be split into sub directories for general logs and job specific logs (if enabled)\n- The outputs directory, will save output files from jobs if exporting functions are used\n\n## 🛠 Usage\n\nTo see the best way to using this scheduler backend is with the interface created for it (see starter example)\n\nThe backend exports an API that will be detailed using swagger (enabled by default) on the route `/api-docs`.\n\n## ⚙️ Configuration\n\nthe initial configuration is done via the **.env** file. The following variables are available:\n\n| Variable Name                | Description                                                                          | Default Value     |\n|------------------------------|--------------------------------------------------------------------------------------|-------------------|\n| NODE_ENV                     | The environment to use                                                               | development       |\n| ENABLE_SWAGGER_SERVER        | Whether to enable the swagger server or not                                          | true              |\n| APP_NAME                     | The Application name (will be used around the app)                                   | scheduler_backend |\n| MASTER_ENCRYPTION_KEY*       | The master encryption key, should be set as a base64 encoded secret key              |                   |\n| DB_HOST                      | The database host                                                                    | localhost         |\n| DB_PORT                      | The database port                                                                    | 3306              |\n| DB_USERNAME                  | The database username                                                                | root              |\n| DB_PASSWORD                  | The database password                                                                | root              |\n| SCHEDULER_DB_NAME            | The database name for the scheduler                                                  | scheduler_db      |\n| PORT                         | The port to run the server on                                                        | 8080              |\n| IP                           | The IP to run the server on                                                          | localhost         |\n| LOG_TO_CONSOLE               | A switch to enable or disable passing logs to console (useful for development)       | localhost         |\n| BASE_DB_HOST                 | The database host for the auth database                                              | localhost         |\n| BASE_DB_NAME                 | The database name for the auth database                                              | scheduler_base    |\n| BASE_DB_USERNAME             | The database username for the auth database                                          | root              |\n| BASE_DB_PASSWORD             | The database password for the auth database                                          | root              |\n| BASE_DB_PORT                 | The database port for the auth database                                              | 3306              |\n| BASE_DB_PASSWORD_SALT_ROUNDS | The number of salt rounds used when hashing passwords                                | 12                |\n| GRAFANA_LOKI_URL             | The URL of the Grafana Loki server (used for logging, and log retrieval)             |                   |\n| GRAFANA_LOKI_USERNAME        | The username of the Grafana Loki server                                              |                   |\n| GRAFANA_LOKI_PASSWORD        | The password of the Grafana Loki server                                              |                   |\n| BROWSERLESS_URL              | The URL of the Browserless server (used as a request alternative, i.e axios)         |                   |\n| BROWSERLESS_TOKEN            | The token for the Browserless server                                                 |                   |\n| GOTIFY_URL                   | The URL of the Gotify server (used as default notification server)                   |                   |\n| GOTIFY_TOKEN                 | The token for the Gotify server                                                      |                   |\n| GOTIFY_APP_TOKEN             | The app token for the Gotify server (used for regular notifications)                 |                   |\n| GOTIFY_ERROR_APP_TOKEN       | The error app token for the Gotify server (used for error and crashes notifications) |                   |\n| JOBS_SUB_DIRECTORY           | The target directory for the job files inside your structure                         |                   |\n| JOBS_FILES_EXTENSIONS        | The extension files to search for as jobs                                            | js,ts             |\n| EXPORT_OUTPUT_FILE           | Whether to export output files or not                                                | false             |\n| EXPORT_CACHE_FILE            | Whether to export cache files or not                                                 | false             |\n| EXPORT_JOB_LOGS_TO_FILES     | Whether to export job logs as files (in addition to loki if configured)              | false             |\n| CACHE_FILES_ROOT_PATH        | The directory inside the output folder that houses cache files                       | caches            |\n| OUTPUT_FILES_ROOT_PATH       | The directory inside the output folder that houses exported files                    | exported          |\n\n## Development\n\nThe Scheduler_backend is built using [Bun](https://bun.sh/) for the runtime and [Elysia](https://elysiajs.com/) for the\nserver/API framework.\nThe following are the most pertinent packages used in tandem with the above :\n\n*- [Prisma](https://www.prisma.io/) for the ORM and migr*ations\n- [Pino](https://github.com/pinojs/pino) for logging\n- [Scheduler Manager](https://github.com/moda20/node-schedule-manager) for the CRON based scheduling\n\n### Running backend locally\n\nTo run the backend app locally :\n\n- Have bun installed : installation instructions [Bun.sh](https://bun.sh/docs/installation)\n- Clone the repo : `git clone https://github.com/moda20/scheduler_backend.git`\n- Install the dependencies : `bun install`\n- Run the app : `bun dev`\n- to build the app run : `bun build`\n\nA .env file is necessary for the app to run, the .env.example file is provided as a template and check the table above\n\n## 📝 License\n\nTBD\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to open an issue or submit a pull request.\nPlease take the time to debug your issues and test your pull request changes if they need to, adding runnable tests\nwould be much appreciated. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoda20%2Fscheduler_backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoda20%2Fscheduler_backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoda20%2Fscheduler_backend/lists"}