Tasque - Serverless messaging and scheduling solution

Rahul GangotriRahul Gangotri
2 min read

Hi, Today i am launching an Open Source project TASQUE! An ultimate serverless messaging and scheduling solution. 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.

Its a very easy to setup, self hosted solution that you can deploy to your own cloudflare account and use it just by calling simple REST API.

Github Repository

Here is the link to the open source repository - https://github.com/hackerrahul/Tasque

So lets get started,

Requirements

  • Cloudflare Worker Paid Plan to access durable objects

Easy to setup

Its very easy to setup as everything is on cloudflare so no need to manage anything or spinning up any servers

Clone Repository

git clone https://github.com/hackerrahul/Tasque.git

Install Dependencies (use npm, yarn, pnpm, bun)

yarn install

Create D1 Database

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.

Make migrations

yarn run make:migration

Run migrations

Local
yarn run migration:local
Production DB
yarn run migration:remote

Deploy to production

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 :


Documentation

you can find the documentation here for all the API.

Read the documentation

You can set the environment variables for the postman collection and give your worker url with https and without tailing slash.

Example Below:

https://scheduler.YOUR_USERNAME.workers.dev

1
Subscribe to my newsletter

Read articles from Rahul Gangotri directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Rahul Gangotri
Rahul Gangotri