Skip to content

W3JDev/w3jai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

W3J Assistant

A modern, real-time AI chat application with text, voice, and video capabilities.

W3J Assistant

Features

Core Features

  • πŸ€– Real-time AI chat with streaming responses
  • πŸŽ™οΈ Voice chat with speech recognition
  • πŸ“ File upload support (text/images)
  • πŸŽ₯ Video chat with recording and image capture
  • πŸ” Web search capabilities
  • πŸ’¬ Customizable system prompts
  • πŸ€– Advanced reasoning with step-by-step thinking
  • 🌐 Multiple AI model support
  • 🎨 Modern, responsive UI
  • πŸ”’ User authentication and profiles with Supabase
  • πŸ’Ύ Chat history with session management
  • 🍽️ Menu data integration for restaurant assistant
  • πŸ“Š Structured output rendering
  • πŸ“ˆ Usage analytics and admin dashboard
  • β™Ώ Comprehensive accessibility features
  • 🌐 Internationalization with multiple languages
  • πŸ”§ User preferences and settings

AI Models

  • Multiple AI Provider Support
    • OpenRouter Integration
      • Claude 2
      • Gemini Pro
      • Llama 2 70B
      • Mistral 7B
    • OpenAI Direct Integration
      • GPT-3.5 Turbo
      • GPT-4
      • GPT-4 Turbo
      • GPT-4o
      • GPT-4 Vision
    • Anthropic Direct Integration
      • Claude 3 Opus
      • Claude 3 Sonnet
      • Claude 3 Haiku
    • Google Gemini Direct Integration
      • Gemini Pro
      • Gemini Pro Vision
      • Gemini 1.5 Pro
    • GROQ Integration
      • Llama 3 70B
      • Llama 3 8B
      • Mixtral 8x7B
      • Gemma 7B
    • Deepseek Integration
      • Deepseek Chat
      • Deepseek Coder
      • Deepseek LLM 67B
    • Hugging Face Integration
      • Mixtral 8x7B
      • Llama 2 70B
      • Gemma 7B
      • Phi-2
      • StableLM Zephyr 3B
  • Voice Synthesis with ElevenLabs
  • Real-time streaming responses
  • Advanced reasoning capabilities
  • Tool function support for web search and other capabilities

Technical Features

  • ⚑ Real-time WebSocket communication
  • πŸ”Š Advanced audio processing
  • πŸ“Ή Video recording and image capture
  • πŸ€– Modular AI provider architecture
  • πŸ” Web search integration
  • πŸ’¬ System prompt customization
  • πŸ“± Mobile-first responsive design
  • πŸ”’ Secure API key management
  • 🎯 High-performance architecture

Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Modern web browser

Installation

# Clone the repository
git clone https://github.com/yourusername/w3j-assistant.git

# Navigate to project directory
cd w3j-assistant

# Install dependencies
npm install

# Create environment file
cp .env.example .env

# Start development server
npm run dev

API Keys Setup

  1. AI Provider API (Required - choose one)

    • OpenRouter API
      • Visit OpenRouter
      • Create an account
      • Generate API key
      • Add to .env: VITE_OPENROUTER_KEY=your_key
    • OpenAI API
      • Visit OpenAI
      • Create an account
      • Generate API key
      • Add to .env: VITE_OPENAI_KEY=your_key
    • Google Gemini API
      • Visit Google AI Studio
      • Create an account
      • Generate API key
      • Add to .env: VITE_GEMINI_KEY=your_key
    • GROQ API
      • Visit GROQ
      • Create an account
      • Generate API key
      • Add to .env: VITE_GROQ_KEY=your_key
    • Deepseek API
      • Visit Deepseek
      • Create an account
      • Generate API key
      • Add to .env: VITE_DEEPSEEK_KEY=your_key
    • Hugging Face API
      • Visit Hugging Face
      • Create an account
      • Generate API key
      • Add to .env: VITE_HUGGINGFACE_KEY=your_key
  2. ElevenLabs API (Optional - for voice)

    • Visit ElevenLabs
    • Create an account
    • Generate API key
    • Add to .env: VITE_ELEVENLABS_KEY=your_key
  3. Google Search API (Optional - for web search)

    • Visit Google Cloud Console
    • Create a project and enable Custom Search API
    • Generate API key
    • Create a Custom Search Engine and get the CSE ID
    • Add to .env:
      • VITE_GOOGLE_API_KEY=your_key
      • VITE_GOOGLE_CSE_ID=your_cse_id
  4. Supabase (Required - for authentication and data storage)

    • Visit Supabase
    • Create a new project
    • Get your project URL, anon key, and service key
    • Add to .env:
      • VITE_SUPABASE_URL=your_supabase_url
      • VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
      • VITE_SUPABASE_SERVICE_KEY=your_supabase_service_key
      • VITE_ENCRYPTION_KEY=your_encryption_key_for_api_keys
    • Run the SQL migrations in supabase/migrations/ to set up the database schema
    • The migrations will create tables for:
      • User profiles and preferences
      • API key storage (encrypted)
      • Chat history
      • Analytics tracking
      • Restaurant information

Development

Project Structure

react-ai-chat/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ aiService.js       # Base AI service interface
β”‚   β”‚   β”œβ”€β”€ aiServiceFactory.js # Factory for creating AI services
β”‚   β”‚   β”œβ”€β”€ openRouterService.js # OpenRouter implementation
β”‚   β”‚   β”œβ”€β”€ openAIService.js   # OpenAI implementation
β”‚   β”‚   β”œβ”€β”€ geminiService.js   # Google Gemini implementation
β”‚   β”‚   β”œβ”€β”€ chatService.js     # Unified chat service
β”‚   β”‚   β”œβ”€β”€ videoService.js    # Video processing
β”‚   β”‚   β”œβ”€β”€ websocket.js       # WebSocket management
β”‚   β”‚   β”œβ”€β”€ audioProcessor.js  # Audio handling
β”‚   β”‚   └── streamProcessor.js # Stream management
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ VideoChat.jsx     # Video chat component
β”‚   β”‚   └── ui/
β”‚   β”‚       └── card.jsx      # UI components
β”‚   β”œβ”€β”€ App.jsx              # Main component
β”‚   β”œβ”€β”€ main.jsx            # Entry point
β”‚   └── index.css           # Global styles
β”œβ”€β”€ public/
β”‚   └── favicon.svg         # App icon
└── docs/
    β”œβ”€β”€ DOCUMENTATION.md    # Technical docs
    β”œβ”€β”€ ROADMAP.md         # Development plan
    β”œβ”€β”€ TESTING_PLAN.md    # Testing strategy
    └── VIDEO_IMPLEMENTATION.md  # Video features

Available Scripts

# Development
npm run dev         # Start dev server
npm run build      # Build for production
npm run preview    # Preview production build

# Testing
npm run test       # Run tests
npm run test:watch # Watch mode
npm run test:coverage # Coverage report

# Linting
npm run lint       # Run ESLint
npm run format    # Format with Prettier

Testing

Running Tests

# Unit tests
npm run test

# E2E tests
npm run test:e2e

# Coverage report
npm run test:coverage

Test Categories

  1. Unit Tests

    • Components
    • Services
    • Utilities
  2. Integration Tests

    • Chat flow
    • Voice processing
    • Video processing
    • File handling
  3. E2E Tests

    • Complete user flows
    • API integration
    • Error scenarios

Deployment

Build for Production

# Build
npm run build

# Preview
npm run preview

Deployment Options

  1. Netlify

    • Connect repository
    • Configure build settings
    • Deploy
  2. Docker

# Build image
docker build -t w3j-assistant .

# Run container
docker run -p 80:80 w3j-assistant

Security

API Key Protection

  • Environment variables
  • Local storage encryption
  • Secure transmission

Content Security

  • Input validation
  • File type checking
  • Size limitations

Data Protection

  • Local processing
  • Secure storage
  • Privacy controls

Contributing

Getting Started

  1. Fork repository
  2. Create feature branch
  3. Make changes
  4. Submit pull request

Guidelines

  • Follow code style
  • Add tests
  • Update documentation
  • Keep commits clean

Documentation

Technical Docs

Roadmap

See ROADMAP.md for planned features and enhancements.

Support

Resources

Getting Help

  1. Check documentation
  2. Search issues
  3. Open new issue
  4. Join discussions

License

MIT License - see LICENSE for details

Acknowledgments

  • OpenRouter API
  • ElevenLabs
  • Supabase
  • React community
  • Open source contributors

Built with ❀️ using React, Vite, and TailwindCSS

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published