A Serverless Scheduler and Queue system built on top of cloudflare workers, D1 and Durable Objects to handle scale and schedule/queue millions of job without any hard limit.
- Cloudflare Worker Paid Plan to access durable objects
Its very easy to srtup as everything is on cloudflare so no need to manage anything or spinning up any servers
git clone https://github.com/hackerrahul/Serverless-Scheduler-and-Queue.git
yarn install
you can follow the steps here as well - Create D1 Database
you can name database anything but make sure to remove the db from package.json and wrangler.toml file.
npx wrangler d1 create scheduler_db
This will output database ID, that you have to replace in your wrangler.toml file.
yarn run make:migration
yarn run migration:local
yarn run migration:remote
yarn run deploy
Well Done, your scheduler is now live 👍, you can easily view the scheduled tasks and queued jobs in drizzle studio.
To run Drizzle Studio and connect it to live account, you need to generate these things-
- To get accountId go to Workers & Pages -> Overview -> copy Account ID from the right sidebar.
- To get databaseId open D1 database you want to connect to and copy Database ID.
- To get token go to My profile -> API Tokens and create token with D1 edit permissions.
Now Remove your .env.example file to .env and paste these details and paste the value for each key.
Now to start the studio you can run this command from your terminal
yarn run studio
This will give you a url to open the studio in your terminal, or you can open from here :
you can find the documentation here for all the API.
You can set the environment variables for the postman collection and give your worker url with https and without tailing slash.
Example Below:
you can follow Contribution guidelines for this project
Star ⭐️ the project if you like it!