llm-battle.mp4
This demo shows off a variety of features of Trigger.dev Realtime streams and using our React hooks to trigger tasks from the frontend.
Copy the .env.local.example
file to .env.local
and fill in the values for the various services, including Trigger.dev.
If you haven't already, create a project on Trigger.dev and copy the project ref into the trigger.config.ts
file.
Then, run the Next.js development server and the Trigger.dev dev CLI command in a separate terminal.
npm install
npm run dev
npm run dev:trigger # Run this in a separate terminal
Open http://localhost:3000 with your browser to see the result.
- View the Trigger.dev task code in the src/trigger/ai.ts file.
- View the frontend code in the src/components/AppUI.tsx file.
To learn more about Trigger.dev Realtime, take a look at the following resources:
- Trigger.dev Documentation - learn about Trigger.dev and its features.
- Realtime docs - learn about the Realtime feature of Trigger.dev.
- React hooks - learn about the React hooks provided by Trigger.dev.