Skip to content

๐ŸŽค 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 for seamless voice interactions.

Notifications You must be signed in to change notification settings

tetratensor/Next.js-Cloudflare-Voice-AI-Assistant

Repository files navigation

๐ŸŽค Next.js Voice AI Assistant on Cloudflare

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.

โœจ Features

  • ๐ŸŽ™๏ธ 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

๐Ÿš€ Quick Start

  1. Generate types:

    cd worker && yarn cf-typegen
  2. Start the Durable Object Worker:

    yarn dev
  3. Set up environment:

    cp .env.example .env.local
  4. Start Next.js development server:

    yarn dev
  5. Open http://localhost:3000 and start talking!

Note: Both the Durable Object Worker and Next.js server must be running simultaneously.

๐Ÿš€ Deploy to Cloudflare

  1. Login to Cloudflare:

    npx wrangler login
  2. Deploy the Durable Object Worker:

    cd worker && yarn deploy
  3. 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
  4. Deploy Next.js app:

    yarn deploy

Alternative: Connect your repository for automatic deployments on every push.

๐Ÿ› ๏ธ Tech Stack

  • 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

๐Ÿ“š References

About

๐ŸŽค 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 for seamless voice interactions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages