Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ VocaMate - AI Voice Assistant

A modern, full-stack conversational AI voice assistant web application built with React and Node.js.

VocaMate Banner

✨ Features

  • 🎀 Voice Input: Web Speech API integration for voice-to-text conversion
  • πŸ”Š Text-to-Speech: Murf AI integration for natural-sounding voice output
  • 🧠 Multiple AI Providers: Support for OpenAI GPT-4 and Google Gemini 1.5 Pro
  • 🌍 Multi-language Support: English, Hindi, Spanish, French, and German
  • πŸŒ™ Dark/Light Mode: Toggle between themes with smooth animations
  • πŸ“± Responsive Design: Optimized for both desktop and mobile devices
  • πŸ’¬ Real-time Chat: Smooth chat interface with typing indicators
  • 🎨 Modern UI: Built with Tailwind CSS and Framer Motion animations
  • πŸ”’ Secure: Environment-based API key management

πŸ› οΈ Tech Stack

Frontend

  • React 18 - User interface library
  • Tailwind CSS - Utility-first CSS framework
  • Framer Motion - Animation library
  • Axios - HTTP client
  • Lucide React - Icon library

Backend

  • Node.js - Runtime environment
  • Express.js - Web framework
  • Helmet - Security middleware
  • CORS - Cross-origin resource sharing
  • Rate Limiting - API protection

AI Services

  • OpenAI GPT-4 - Conversational AI
  • Google Gemini 1.5 Pro - Advanced AI model
  • Murf AI - Text-to-speech synthesis

πŸ“¦ Project Structure

vocamate/
β”œβ”€β”€ backend/                 # Node.js backend server
β”‚   β”œβ”€β”€ config/             # Configuration files
β”‚   β”‚   └── config.js       # App configuration
β”‚   β”œβ”€β”€ routes/             # API routes
β”‚   β”‚   β”œβ”€β”€ chat.js         # Chat endpoints
β”‚   β”‚   └── speech.js       # Speech endpoints
β”‚   β”œβ”€β”€ services/           # Service layers
β”‚   β”‚   β”œβ”€β”€ openaiService.js # OpenAI integration
β”‚   β”‚   β”œβ”€β”€ geminiService.js # Gemini integration
β”‚   β”‚   └── murfService.js   # Murf AI integration
β”‚   β”œβ”€β”€ server.js           # Main server file
β”‚   β”œβ”€β”€ package.json        # Dependencies
β”‚   └── .env               # Environment variables
β”œβ”€β”€ frontend/               # React frontend app
β”‚   β”œβ”€β”€ public/            # Static files
β”‚   β”‚   β”œβ”€β”€ index.html     # HTML template
β”‚   β”‚   └── manifest.json  # PWA manifest
β”‚   β”œβ”€β”€ src/               # Source code
β”‚   β”‚   β”œβ”€β”€ components/    # React components
β”‚   β”‚   β”‚   β”œβ”€β”€ Header.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ChatContainer.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ChatMessage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ChatInput.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ TypingIndicator.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ErrorBoundary.jsx
β”‚   β”‚   β”‚   └── LoadingScreen.jsx
β”‚   β”‚   β”œβ”€β”€ App.jsx        # Main app component
β”‚   β”‚   β”œβ”€β”€ api.js         # API client
β”‚   β”‚   β”œβ”€β”€ index.js       # App entry point
β”‚   β”‚   └── index.css      # Global styles
β”‚   β”œβ”€β”€ package.json       # Dependencies
β”‚   β”œβ”€β”€ tailwind.config.js # Tailwind configuration
β”‚   β”œβ”€β”€ postcss.config.js  # PostCSS configuration
β”‚   └── .env              # Environment variables
└── README.md              # This file

πŸš€ Quick Start

Prerequisites

  • Node.js 16+ and npm
  • API Keys for:
    • OpenAI (optional)
    • Google Gemini (optional)
    • Murf AI (recommended)

1. Clone the Repository

git clone https://github.com/your-username/vocamate.git
cd vocamate

2. Backend Setup

cd backend
npm install

Create .env file in the backend directory:

# Server Configuration
PORT=5000
NODE_ENV=development

# AI Service API Keys
OPENAI_API_KEY=your_openai_api_key_here
GEMINI_API_KEY=your_gemini_api_key_here

# Text-to-Speech API Key
MURF_API_KEY=your_murf_api_key_here
MURF_PROJECT_ID=your_murf_project_id_here

# CORS Configuration
FRONTEND_URL=http://localhost:3000

Start the backend server:

npm start

The backend will be running on http://localhost:5000

3. Frontend Setup

Open a new terminal:

cd frontend
npm install

Create .env file in the frontend directory:

# Backend API Configuration
REACT_APP_API_BASE_URL=http://localhost:5000/api

# App Configuration
REACT_APP_NAME=VocaMate
REACT_APP_VERSION=1.0.0
REACT_APP_DEFAULT_LANGUAGE=en
REACT_APP_DEFAULT_AI_PROVIDER=gemini

Start the frontend development server:

npm start

The frontend will be running on http://localhost:3000

πŸ”‘ API Keys Setup

OpenAI API Key

  1. Visit OpenAI Platform
  2. Create a new API key
  3. Add it to your backend .env file

Google Gemini API Key

  1. Visit Google AI Studio
  2. Create a new API key
  3. Add it to your backend .env file

Murf AI API Key

  1. Visit Murf AI
  2. Sign up for an account
  3. Get your API key from the dashboard
  4. Add it to your backend .env file

🌍 Supported Languages

  • English (en) - Default
  • Hindi (hi) - ΰ€Ήΰ€Ώΰ€‚ΰ€¦ΰ₯€
  • Spanish (es) - EspaΓ±ol
  • French (fr) - FranΓ§ais
  • German (de) - Deutsch

πŸ“± Usage

  1. Text Chat: Type your message in the input box and press Enter
  2. Voice Input: Click the microphone button to speak your message
  3. Voice Output: AI responses are automatically converted to speech
  4. Language Switch: Use the language dropdown to change conversation language
  5. AI Provider: Switch between OpenAI and Gemini models
  6. Dark Mode: Toggle between light and dark themes

πŸ”§ Development

Running in Development Mode

Backend:

cd backend
npm run dev  # Uses nodemon for auto-restart

Frontend:

cd frontend
npm start    # Hot reload enabled

Building for Production

Frontend:

cd frontend
npm run build

🚨 Troubleshooting

Common Issues

  1. Backend Connection Failed

    • Ensure backend server is running on port 5000
    • Check if CORS is configured correctly
    • Verify API keys are set in environment variables
  2. Speech Recognition Not Working

    • Use HTTPS or localhost (required for Web Speech API)
    • Check browser compatibility (Chrome/Edge recommended)
    • Ensure microphone permissions are granted
  3. Text-to-Speech Issues

    • Verify Murf AI API key is valid
    • Check internet connection
    • In development mode, mock audio will be used
  4. AI Responses Not Working

    • Ensure at least one AI provider API key is configured
    • Check API key validity and quota
    • Monitor browser console for error messages

Browser Compatibility

  • Chrome 80+ βœ… (Recommended)
  • Edge 80+ βœ…
  • Firefox 75+ ⚠️ (Limited speech features)
  • Safari 14+ ⚠️ (Limited speech features)

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“§ Support

If you encounter any issues or have questions, please:

  1. Check the troubleshooting section
  2. Search existing GitHub issues
  3. Create a new issue with detailed information

Made with ❀️ by [Your Name]

🌟 If you found this project helpful, please give it a star!

About

A modern, full-stack conversational AI voice assistant web application built with React and Node.js.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages