lukerocks78/coaching-v-4
0
Cursor Coaching App
A voice assistant web app using OpenAI's Realtime API. This app allows real-time voice interaction with an AI assistant.
Features
- Real-time voice input processing
- OpenAI-powered responses
- Clean web interface
- Express.js backend
Usage
- Allow microphone access when prompted
- Start speaking to interact with the AI assistant
- View responses in real-time
Prerequisites
- Node.js installed on your system
- An OpenAI API key with access to the Realtime API
- A modern web browser that supports WebRTC
Setup
- Clone this repository
- Install dependencies:
npm install- Create a
.envfile in the root directory with your OpenAI API key:
OPENAI_API_KEY=your_api_key_hereRunning the App
- Start the server:
npm start- Open your web browser and navigate to
http://localhost:3000 - Click the microphone button to start a conversation
- Speak naturally - the voice assistant will respond both with voice and text
Usage
- Click the microphone button once to connect and start recording
- Click again to stop recording
- The conversation history will be displayed in the chat window
- The status indicator will show the current state (connecting, listening, processing, etc.)
Technical Details
- Uses WebRTC for real-time audio streaming
- Implements voice activity detection for natural conversation flow
- Uses ephemeral tokens for secure client-side connections
- Built with Express.js for the backend server
- Pure JavaScript frontend with no additional frameworks
Security Notes
- The app uses ephemeral tokens for client-side API access
- Your OpenAI API key is only used server-side
- All communication with OpenAI is done over HTTPS
