{"id":23467175,"url":"https://github.com/yujiosaka/cronyxserver","last_synced_at":"2026-04-08T20:47:30.398Z","repository":{"id":204122383,"uuid":"708072302","full_name":"yujiosaka/CronyxServer","owner":"yujiosaka","description":"HTTP server for Cronyx, enabling seamless job scheduling across services via RESTful endpoints.","archived":false,"fork":false,"pushed_at":"2023-11-05T22:01:31.000Z","size":294,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T17:58:19.313Z","etag":null,"topics":["bun","cron","cronjob","crontab","elysia","job-scheduler","mongodb","mysql","postgres","redis","scheduler","task-scheduler"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/yujiosaka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":"docs/FUNDING.yml","license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/SECURITY.md","support":null,"governance":null},"funding":{"github":["yujiosaka"]}},"created_at":"2023-10-21T12:49:12.000Z","updated_at":"2023-11-01T17:27:50.000Z","dependencies_parsed_at":"2023-11-05T23:19:11.552Z","dependency_job_id":null,"html_url":"https://github.com/yujiosaka/CronyxServer","commit_stats":null,"previous_names":["yujiosaka/cronyxserver"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujiosaka%2FCronyxServer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujiosaka%2FCronyxServer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujiosaka%2FCronyxServer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujiosaka%2FCronyxServer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yujiosaka","download_url":"https://codeload.github.com/yujiosaka/CronyxServer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248610387,"owners_count":21132920,"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":["bun","cron","cronjob","crontab","elysia","job-scheduler","mongodb","mysql","postgres","redis","scheduler","task-scheduler"],"created_at":"2024-12-24T12:16:51.114Z","updated_at":"2026-04-08T20:47:30.354Z","avatar_url":"https://github.com/yujiosaka.png","language":"TypeScript","funding_links":["https://github.com/sponsors/yujiosaka"],"categories":[],"sub_categories":[],"readme":"# CronyxServer [![npm version](https://badge.fury.io/js/cronyx-server.svg)](https://badge.fury.io/js/cronyx-server) [![CI/CD](https://github.com/yujiosaka/CronyxServer/actions/workflows/ci_cd.yml/badge.svg)](https://github.com/yujiosaka/CronyxServer/actions/workflows/ci_cd.yml)\n\n###### [Code of Conduct](https://github.com/yujiosaka/CronyxServer/blob/main/docs/CODE_OF_CONDUCT.md) | [Contributing](https://github.com/yujiosaka/CronyxServer/blob/main/docs/CONTRIBUTING.md) | [Changelog](https://github.com/yujiosaka/CronyxServer/blob/main/docs/CHANGELOG.md)\n\nHTTP server for [Cronyx](https://github.com/yujiosaka/Cronyx), enabling seamless job scheduling across services via RESTful endpoints.\n\n## 🧩 CronyxClient\n\nTo simplify integration with CronyxServer, we provide client libraries for both TypeScript and Python.\n\n- **[CronyxClient.js](https://github.com/yujiosaka/CronyxClient.js)**: Integrate CronyxServer seamlessly into your TypeScript projects.\n- **[CronyxClient.py](https://github.com/yujiosaka/CronyxClient.py)**: Python projects can also tap into the power of CronyxServer with ease.\n\nThese client libraries offer a seamless way to connect with CronyxServer, ensuring the feel of the [original Cronyx API](https://github.com/yujiosaka/Cronyx/blob/main/docs/API.md) is preserved.\n\n## 🌟 Features\n\n\u003cimg src=\"https://github.com/yujiosaka/CronyxServer/assets/2261067/e7fbfaa7-204f-400c-8850-31a483d14ffc\" alt=\"icon\" width=\"300\" align=\"right\"\u003e\n\nCronyxServer expands the capabilities of Cronyx, allowing its integration beyond the TypeScript ecosystem. Easily schedule tasks, monitor job life-cycles, and control job executions from any programming language.\n\n### Why CronyxServer?\n\n🌍 **Language Agnostic**: Built for Cronyx, a [TypeScript](https://www.typescriptlang.org/) project, CronyxServer paves the way for integration with any programming language including [Go](https://go.dev/), [Python](https://www.python.org/), [Rust](https://www.rust-lang.org/), and more.\n\n📡 **RESTful API**: An intuitive API set that mirrors Cronyx's functions, making transitions seamless and intuitive.\n\n🔒 **Scalable**: Start multiple servers under a load balancer and retain the exclusive lock feature, ensuring that only one instance of a job runs at any given time.\n\n🔗 **Diverse Persistence Options**: Fully supports all persistence options offered by Cronyx, including [MongoDB](https://www.mongodb.com/), [Redis](https://redis.io/), [MySQL](https://www.mysql.com/), and [PostgreSQL](https://www.postgresql.org/). This ensures flexibility in choice and scalability in operations.\n\n🐋 **Docker Support**: With an available image on [Docker Hub](https://hub.docker.com/r/yujiosaka/cronyx-server), setting up CronyxServer is a breeze.\n\n⛓ **Kubernetes Ready**: Easily deployable configurations for [Kubernetes](https://kubernetes.io/) ensure that scaling with CronyxServer is seamless and efficient.\n\n⚙️ **Bun-powered**: Developed on [Bun](https://bun.sh/), CronyxServer guarantees performant operations and an unparalleled developer experience.\n\n### Embracing The Future\n\nWhile Cronyx brought the world of script-based task scheduling to TypeScript users, CronyxServer opens the door for every developer, irrespective of their stack.\n\n## 🚀 Getting Started\n\nTo utilize CronyxServer, follow the steps below:\n\n### Installation\n\nSimply invoke the server using `bunx`:\n\n```sh\n$ bunx cronyx-server\n```\n\n### Configuration\n\nWhen using `bunx` or the provided [Docker image](https://hub.docker.com/r/yujiosaka/cronyx-server), configure your server using the following environment variables:\n\n```sh\n# Server's port\nSERVER_PORT=3000\n\n# Default timezone\nTIMEZONE=UTC\n\n# Job store's source (mongodb, redis, mysql, aurora-mysql, postgres or aurora-postgres)\nJOB_STORE_SOURCE=\n\n# Job store's URL (required for mongodb data store)\nJOB_STORE_URL=\n\n# Job store's options\nJOB_STORE_OPTIONS=\n\n# Basic authentication's user name\nBASIC_AUTH_USERNAME=\n\n# Basic authentication's password\nBASIC_AUTH_PASSWORD=\n```\n\n#### JOB_STORE_SOURCE\n\n`JOB_STORE_OPTIONS` allows for detailed configuration of your chosen persistence store. When specifying `JOB_STORE_OPTIONS`, ensure your input string is a valid JSON format.\n\n##### MongoDB\n\nWhen using MongoDB, `JOB_STORE_OPTIONS` expects options compatible with the [ConnectOptions](https://www.mongodb.com/docs/drivers/node/current/fundamentals/connection/connection-options/) parameter.\n\n**Example:**\n\n```sh\nJOB_STORE_OPTIONS='{\"useNewUrlParser\": true, \"useUnifiedTopology\": true}'\n```\n\n##### Redis\n\nFor Redis, the configuration is expected to align with [RedisClientOptions](https://github.com/redis/node-redis/blob/master/docs/client-configuration.md).\n\n**Example:**\n\n```sh\nJOB_STORE_OPTIONS='{\"host\": \"127.0.0.1\", \"port\": 6379}'\n```\n\n##### MySQL and Postgres\n\nCronyxServer utilizes [TypeORM](https://typeorm.io/) for MySQL and PostgreSQL. Accordingly, the configuration for these databases follows TypeORM's respective options:\n\n- For MySQL, use [MysqlConnectionOptions](https://typeorm.delightful.studio/interfaces/_driver_mysql_mysqlconnectionoptions_.mysqlconnectionoptions.html).\n- For Postgres, use [PostgresConnectionOptions](https://typeorm.delightful.studio/interfaces/_driver_postgres_postgresconnectionoptions_.postgresconnectionoptions).\n\n**Example for Postgres:**\n\n```sh\nJOB_STORE_OPTIONS='{\"type\": \"postgres\", \"username\": \"postgres\", \"password\": \"postgres\"}'\n```\n\n### Basic Usage\n\n**Schedule a Job**\n\nEquivalent to [requestJobStart](https://github.com/yujiosaka/Cronyx/blob/main/docs/API.md#requestjobstart):\n\n```sh\n$ curl -X POST http://localhost:3000/{{jobName}} \\\n    --header 'Content-Type: application/json' \\\n    --data-raw '{ \"jobInterval\": \"* * * * * *\" }'\n```\n\n**Finish a Job**\n\nEquivalent to [finish](https://github.com/yujiosaka/Cronyx/blob/main/docs/API.md#finish):\n\n```sh\n$ curl -X PUT http://localhost:3000/{{jobName}}/{{jobId}}/finish \\\n    --header 'Content-Type: application/json\n```\n\n**Interrupt a Job**\n\nEquivalent to [interrupt](https://github.com/yujiosaka/Cronyx/blob/main/docs/API.md#interrupt):\n\n```sh\n$ curl -X PUT http://localhost:3000/{{jobName}}/{{jobId}}/interrupt \\\n    --header 'Content-Type: application/json'\n```\n\n## 💻 Development\n\nOne of the advantages of CronyxServer is its support for various data persistence options, such as MongoDB, Redis, MySQL, and PostgreSQL. To streamline the local development setup for each data source, specific Docker Compose configurations are available.\n\nYou don't have to manage them directly, as simplified `make` commands have been provided for convenience. Here's how you can use them:\n\n```sh\n$ make start-mongodb\n```\n\nSimilarly, for other databases, replace `mongodb` with `redis`, `mysql`, or `postgres`.\n\nThis command runs the appropriate Docker Compose configuration for the chosen database, setting up the environment tailored to that specific database.\n\n## 🚢 Local Deployment\n\nTo deploy the services locally, follow the steps below:\n\n### Configuration\n\nCreate a `.env` file from the `.env.example` file for each data source. This can be achieved by running:\n\n```sh\nmake config\n```\n\nThis command will copy `.env.example` to `.env` for all supported databases, namely MongoDB, Redis, MySQL, and PostgreSQL.\n\n### Create Secrets\n\nUse the following command to create Kubernetes Secrets. For MongoDB:\n\n```sh\nmake create-secret-mongodb\n```\n\nReplace `mongodb` with `redis`, `mysql`, or `postgres` as needed.\n\n### Deploy to Kubernetes\n\nTo deploy the services to Kubernetes, use the following command. For MongoDB:\n\n```sh\nmake deploy-mongodb\n```\n\nAgain, replace `mongodb` with `redis`, `mysql`, or `postgres` as required.\n\nMake sure you have a compatible version of Kubernetes running. The project has been tested and verified with Kubernetes version `1.25.4`. You can check your Kubernetes version using the following command:\n\n```sh\nkubectl version\n```\n\n### Accessing Services\n\nTo access the deployed services, use the following command to get the list of services and their corresponding URLs:\n\n```sh\nkubectl get services\n```\n\nTo check the availability of the service, you can access the health check endpoint at http://localhost:3000/healthcheck.\n\n### Cleaning Up\n\nTo delete all the deployed resources, use the following command. For MongoDB:\n\n```sh\nmake delete-mongodb\n```\n\nReplace `mongodb` with `redis`, `mysql`, or `postgres` depending on which one you've deployed.\n\n### Docker Hub Repository\n\nDocker images for this project are available in the [Docker Hub repository](https://hub.docker.com/r/yujiosaka/cronyx-server). You can find suitable images for different versions or tags of the CronyxServer application.\n\n## 🐞 Debugging tips\n\n### Enable debug logging\n\nJob status changes are logged via the [debug](https://github.com/visionmedia/debug) module under the `cronyx:server` namespace.\n\n```sh\nenv DEBUG=\"cronyx:server\" bunx cronyx-server\n```\n\n## 💳 License\n\nThis project is licensed under the MIT License. See [LICENSE](https://github.com/yujiosaka/CronyxServer/blob/main/LICENSE) for details.\n\n## 🤔 FAQ\n\n### How is CronyxServer different from services like Airflow or Dagster?\n\nWhile [Airflow](https://airflow.apache.org/) and [Dagster](https://dagster.io/) are fantastic tools tailored primarily for the needs of data scientists and MLOps professionals, CronyxServer offer a different niche. These key differences set them apart:\n\n- **Audience \u0026 Language**: Airflow and Dagster are primarily built around Python users, especially suiting MLOps tasks. In contrast, Cronyx is language-agnostic, with its server variant opening the door for any language integration.\n\n- **Task Focus**: While Airflow and Dagster often cater to ML pipelines, Cronyx and CronyxServer are optimized for developer-centric tasks, such as aggregation pipelines.\n\n- **Developer Experience**: Cronyx emphasizes a seamless developer experience. There's no need to switch between a web UI and code. With Cronyx and CronyxServer, configurations are code-centric, which can enhance productivity by keeping everything in one place.\n\nRemember, the best tool always depends on the specific use-case. CronyxServer offers a developer-focused approach to task scheduling, while tools like Airflow and Dagster cater to a more data-driven audience.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyujiosaka%2Fcronyxserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyujiosaka%2Fcronyxserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyujiosaka%2Fcronyxserver/lists"}