A React application that uses Speechall's live transcription and Claude AI to generate and iteratively update HTML based on user descriptions. Features speech-to-text input powered by Speechall for hands-free HTML creation. Every time you say something, it will be used as instructions to update the HTML. What you say is transcribed live using WebSockets and passed to the LLM.
Please unmute the sound first:
Speechall-Typescript-Example.demo.mp4
- 🤖 AI-Powered HTML Generation: Describe what you want and Claude will generate HTML for you
- 🎤 Speech-to-Text Input: Use voice commands to describe HTML with Speechall integration
- 🔄 Iterative Updates: Update existing HTML with additional instructions via text or voice
- 👁️ Live Preview: See your generated HTML rendered in real-time
- 📋 Copy to Clipboard: Easily copy generated HTML code
- 🎨 Clean UI: Professional, responsive interface with real-time speech status
- 🔒 Secure: Safe HTML rendering with proper error handling
-
Install dependencies:
npm install
-
Set up your API keys:
- Copy
.env.example
to.env
- Add your Anthropic API key to the
VITE_ANTHROPIC_API_KEY
variable - Add your Speechall API key to the
VITE_SPEECHALL_API_KEY
variable
cp .env.example .env # Edit .env and add both API keys
- Copy
-
Start Speechall service (for speech input):
- Ensure Speechall is running on
ws://127.0.0.1:8080/transcribe
- Speech input will be disabled if Speechall service is not available
- Ensure Speechall is running on
-
Start the development server:
npm run dev
- Enter a description of the HTML you want to generate in the text field
- Click "Generate HTML" to create your HTML using Claude AI
- View the rendered result in the preview section
- To update the HTML, enter additional instructions in the same text field
- Claude will modify the existing HTML based on your new instructions
- Click the "🎤 Start Voice Input" button to begin speech recording
- Speak your HTML description naturally
- The transcribed text will automatically appear in the input field
- Click "🛑 Stop Recording" when finished speaking
- Review the transcription and click "Generate HTML"
- Use the "Copy HTML" button to copy the generated code
- Use "Clear" to start over with a new generation
- Mix text and voice input as needed for iterative updates
- React 19 - UI framework
- TypeScript - Type safety and better development experience
- Vite - Fast build tool and development server
- Claude API - AI-powered HTML generation via Anthropic's SDK
- Speechall API - Real-time speech-to-text transcription via WebSocket
- Web Audio API - Advanced audio processing with AudioWorklet
- CSS3 - Modern styling with responsive design
dangerouslyAllowBrowser: true
for Claude). This is for demonstration purposes only. In a production environment, you should:
- Use a backend server to make API calls
- Implement proper authentication and rate limiting
- Never expose API keys in client-side code
🎤 Speech Input Requirements:
- Requires microphone access permission
- Speechall service must be running locally on port 8080
- Uses Deepgram Nova-2 model for speech recognition
- Supports real-time streaming transcription
npm run dev
- Start development servernpm run build
- Build for productionnpm run preview
- Preview production buildnpm run lint
- Run ESLint
src/
├── components/
│ ├── TextInput.tsx # Input component with speech integration
│ ├── SpeechRecordingButton.tsx # Voice input component
│ ├── HTMLPreview.tsx # Preview component for generated HTML
│ └── LoadingSpinner.tsx # Loading indicator
├── services/
│ ├── claudeApi.ts # Claude API integration
│ └── speechRecording.ts # Speechall WebSocket integration
├── App.tsx # Main application component
├── App.css # Application styles
└── main.tsx # Application entry point