A real-time voice chat application powered by Google's Gemini AI, built with React, Node.js, and Web Speech API.
- 🎤 Real-time Voice Chat: Speak naturally with the AI assistant
- 🧠 Gemini AI Integration: Powered by Google's latest AI model
- 🔊 Text-to-Speech: AI responses are spoken back to you
- 🎨 Modern UI: Beautiful, responsive interface with dark/light themes
- ⚡ Real-time Communication: WebSocket-based communication
- 🏍️ Revolt Motors Assistant: Specialized knowledge about electric motorcycles
- Node.js (v16 or higher)
- npm or yarn
- Google Gemini API key
- Modern browser with Web Speech API support (Chrome, Edge, Safari)
-
Clone the repository
git clone <repository-url> cd gemini-voice-replika
-
Install dependencies
npm install
-
Set up your Gemini API key
Environment variable (recommended)
# Create a .env file in the root directory echo "GEMINI_API_KEY=your_api_key_here" > .env
-
Start the application
# Start both frontend and backend servers npm run dev:fullOr start them separately:
# Terminal 1: Start backend server npm run server # Terminal 2: Start frontend development server npm run dev
-
Open your browser
- Navigate to
http://localhost:8081(or the port shown in your terminal) - Allow microphone permissions when prompted
- Click the microphone button to start talking!
- Navigate to
-
"Microphone Access Required"
- Make sure you've allowed microphone permissions in your browser
- Refresh the page and try again
-
"Browser Not Supported"
- Use Chrome, Edge, or Safari for best compatibility
- Ensure you're using a modern browser version
-
"Server Connection" Error
- Make sure the backend server is running on port 3001
- Check that no other application is using the same port
-
"API key not configured"
- Set your Gemini API key via environment variable or UI
- Ensure the API key is valid and has proper permissions
-
Speech Recognition Not Working
- Check that your microphone is working and not muted
- Try speaking more clearly and slowly
- Ensure you're in a quiet environment
To get a Gemini API key:
- Go to Google AI Studio
- Create a new API key
- Copy the key and add it to your
.envfile or use the UI setup
- Frontend: React, TypeScript, Vite, Tailwind CSS
- Backend: Node.js, Express, Socket.IO
- AI: Google Gemini API
- Voice: Web Speech API (Speech Recognition & Synthesis)
- UI: Shadcn/ui components
npm run dev:full- Start both frontend and backendnpm run dev- Start frontend onlynpm run server- Start backend onlynpm run build- Build for productionnpm run lint- Run ESLint
##Made With ❤️ By Sarthak Jain