A real-time voice AI assistant built with Next.js and deployed on Cloudflare Workers. Features voice activity detection, speech-to-text, AI conversation, and text-to-speech with WebSocket communication and Durable Objects.
- ๐๏ธ Real-time voice conversation with AI
- ๐ Voice Activity Detection (VAD) for automatic speech detection
- ๐ฃ๏ธ Speech-to-Text and Text-to-Speech integration
- โก WebSocket communication for real-time audio streaming
- ๐ Cloudflare Durable Objects for stateful voice sessions
- ๐ Edge deployment for global performance
-
Generate types:
cd worker && yarn cf-typegen
-
Start the Durable Object Worker:
yarn dev
-
Set up environment:
cp .env.example .env.local
-
Start Next.js development server:
yarn dev
-
Open http://localhost:3000 and start talking!
Note: Both the Durable Object Worker and Next.js server must be running simultaneously.
-
Login to Cloudflare:
npx wrangler login
-
Deploy the Durable Object Worker:
cd worker && yarn deploy
-
Update environment variables:
- Copy the Worker URL host (e.g.,
worker-unique-identifier.workers.dev
) - Set
NEXT_PUBLIC_WS_HOST
in.env.local
to this value
- Copy the Worker URL host (e.g.,
-
Deploy Next.js app:
yarn deploy
Alternative: Connect your repository for automatic deployments on every push.
- Frontend: Next.js 15, React 19, TypeScript, Tailwind CSS
- Backend: Cloudflare Workers, Durable Objects
- Voice: Voice Activity Detection (VAD), WebSocket streaming
- AI: Cloudflare AI, Speech-to-Text, Text-to-Speech
- Deployment: OpenNext.js for Cloudflare