2 mins • Easy
Quick Start ⚡️
TurboQ is a NodeJS framework for building resilient background workflows easily. We also provide a cloud platform to run your workflows at scale.
We're all about snappy DX, so let's not waste more of your precious time. Here's how you can get started with TurboQ in 2 minutes.
Create a TurboQ account
If you haven't already, create a free account on TurboQ (opens in a new tab).
Create a new project
Generate a new TurboQ project using the following command:
npx @turboq/sdk@latest create
Navigate to the project directory and install the dependencies:
npm install
Run the local development setup
npm run start
This will run TurboQ locally and open the dashboard in your default browser. This is where you can create queues, jobs, and monitor the progress of your workflows.
Create a queue
Alright, hard part is over! You deserve a coffee break! 😮💨
Create a new file in the queues
directory with the following content:
import { queue, z } from "@turboq/sdk";
export default queue("makeCoffee")
.input(
z.object({
size: z.enum(["Small", "Medium", "Large"]),
})
)
.step("grind", async ({ input }) => {
console.log(`Grinding coffee for ${input.size} cup`);
return "Ground coffee";
})
.step("brew", async ({ input, grind }) => {
console.log(`Brewing ${input.size} cup of coffee from ${grind}`);
return "☕️";
});
Create a job
After you've defined a queue, you will see it showing up in the dashboard.
Let's create a job by clicking on the Create Job
button.
You can use both the Dashboard or the NodeJS Client to interact with your queues.
Deployment
This setup was all running locally on your computer so far. To host your queues in the cloud, and make it accessible from other applications, you need to deploy it.
But don't worry it's as easy... It's so simple, even your grandma could do it—no offense to tech-savvy grandmas out there.
Login via the CLI to your TurboQ account and run the deploy command:
npm run login
npm run deploy
Congrats 🎉
You've successfully deployed your first Turboq app! 🚀