Skip to content

Latest commit

Β 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Nova Logo

Nova -- AI Voice Assistant

Nova Voice Assistant Preview


star Overview

Nova is a production-grade, multilingual AI voice assistant that delivers natural conversation directly in the browser. Powered by Google Gemini 2.0 Flash with real-time SSE streaming, a 3D GLSL shader visualization, and full Web Speech API integration, Nova supports English, Arabic (Lebanese), and French. Talk, type, or say "Hey Nova" -- it handles all three.


features Features

voice Voice & Speech

  • speech recognition Speech Recognition -- Browser-native speech-to-text via Web Speech API with interim results
  • tts Text-to-Speech -- Sentence-queue TTS with per-language pitch/rate tuning and intelligent voice selection
  • wake word Wake Word Detection -- Hands-free activation with "Hey Nova" / "Nova"; extracts trailing query automatically
  • chrome fix Chrome 15s TTS Fix -- Prevents Chrome from silently cutting off long utterances via sentence splitting and periodic pause/resume keep-alive
  • multilingual Multilingual Support -- English (US), Arabic (Lebanese), French with voice-triggered language switching
  • debounce Listening Debounce -- 250ms stop-restart delay prevents overlapping recognition sessions

ai AI Backend

  • streaming SSE Streaming -- Real-time progressive text delivery via Netlify Edge Functions (Deno runtime)
  • proxy Server-side API Proxy -- Gemini API key never reaches the browser; proxied through Netlify serverless functions
  • context Multi-turn Context -- Last 10 conversation messages sent with each request for context-aware responses
  • rate limit Rate Limiting -- 30 requests per 60-second window per IP with in-memory tracking
  • retry Retry with Backoff -- Automatic retry on 503 errors (2 attempts, 1s base delay)
  • safety Safety Filtering -- 4 harm categories blocked at medium threshold (harassment, hate, sexual, dangerous content)
  • config Tuned Generation -- temperature 0.7, topK 40, topP 0.95, maxOutputTokens 1024
  • fallback Streaming Fallback -- Automatically falls back to single-shot requests when streaming fails

ux User Experience

  • text input Text Input -- Type-to-chat alternative with localized placeholders and RTL support for Arabic
  • search Message Search & Filtering -- Real-time case-insensitive search with highlighted matching text and result count
  • persistence Conversation Persistence -- Messages survive page refresh via localStorage (capped at 200 messages with schema validation)
  • greeting Time-based Greeting -- Contextual welcome message based on time of day (morning / afternoon / evening)
  • responsive Fully Responsive -- Adapts layout and blob sizing for mobile and desktop
  • accessibility Accessible Conversation History -- Focus trap, keyboard navigation, focus restoration, outside-click dismiss
  • language selector Language Selector -- Visual picker with flag indicators; spoken confirmation on switch

network Network Awareness

  • online Online/Offline Detection -- Reactive connectivity status with localized banner (EN/AR/FR)
  • quality Network Quality Monitoring -- Reads effective connection type, downlink, RTT, and Save-Data via Network Information API
  • adaptive Adaptive Streaming -- Automatically disables SSE on 2G / slow-2G / Save-Data connections
  • slow Slow Network Banner -- Visual warning when degraded connection is detected

visualization 3D Blob Visualization

  • three Three.js Animated Blob -- IcosahedronGeometry at detail level 5 (~20K faces) with custom GLSL shaders
  • noise Simplex Noise Deformation -- Organic surface morphing via 3D simplex noise in vertex shader
  • fresnel Fresnel Rim Lighting -- Glowing edge effect with pulse color oscillation in fragment shader
  • colors State-driven Colors -- Idle (purple), Listening (blue), Speaking (purple), Responding (green)
  • webgl WebGL Context Recovery -- Handles GPU context loss/restore without reloading
  • keyboard Keyboard & Screen Reader Support -- Enter/Space activation, dynamic aria-labels per state

security Security

  • csp Content Security Policy -- Strict CSP with whitelisted sources; frame-ancestors and object-src set to none
  • hsts HSTS -- Forced HTTPS with 2-year max-age, includeSubDomains, and preload
  • headers Security Headers -- X-Frame-Options (DENY), X-Content-Type-Options (nosniff), Referrer-Policy (strict-origin-when-cross-origin)
  • permissions Permissions Policy -- Microphone restricted to self; camera blocked entirely
  • validation Input Validation -- Query length (2000 chars), history cap (10 items), language enum enforcement

extras Additional Features

  • favicon Dynamic Favicon -- Favicon changes to match assistant state (idle / listening / speaking / responding)
  • pwa Progressive Web App -- Installable with offline caching via Workbox service worker
  • analytics Privacy-friendly Analytics -- Plausible integration (production-only) with custom event tracking
  • errors Error Tracking -- Global error capture with FIFO buffer (max 20 reports); unhandled rejection handling
  • localized errors Localized Error Messages -- Error text displayed in the user's active language

rocket Getting Started

  1. Clone the Repository

    git clone https://github.com/naveed-gung/nova.git
    cd nova
  2. Install Dependencies

    npm install
  3. Set Up Environment Variables

    For local development, create a .env file:

    VITE_GEMINI_API_KEY=your_gemini_api_key

    For Netlify deployment, set GEMINI_API_KEY in the Netlify dashboard (Settings > Environment variables). The API key is proxied through a serverless function and never exposed to the client.

  4. Start Development Server

    npm run dev

    The app will be available at http://localhost:8080.


voice Voice Commands

Wake Word

Say "Hey Nova" or "Nova" followed by your question to activate hands-free. The assistant will detect the wake word and process the trailing query automatically.

Language Switching

Language Commands
English "Switch to Arabic", "Speak Arabic", "Switch to French", "Speak French"
Arabic "ΨͺΩƒΩ„Ω… Ψ§Ω†Ψ¬Ω„ΩŠΨ²ΩŠ" (Speak English), "ΨͺΩƒΩ„Ω… ΩΨ±Ω†Ψ³ΩŠ" (Speak French)
French "Parle anglais", "Passer a l'anglais", "Parle arabe"

tech Tech Stack

Layer Technology
frontend Frontend React 18.3.1 + TypeScript 5.5.3
styling Styling Tailwind CSS 3.4.11 + tailwindcss-animate
ai AI Google Gemini 2.0 Flash (via Netlify Functions + Edge Functions)
speech Speech Web Speech API (SpeechRecognition + SpeechSynthesis)
3d 3D Three.js 0.159.0 (custom GLSL shaders)
build Build Vite 7.3.1 + SWC
pwa PWA vite-plugin-pwa 1.2.0 + Workbox
backend Backend Netlify Functions (Node.js) + Edge Functions (Deno)

architecture Architecture

blob Dynamic Blob Visualization

  • GLSL simplex noise vertex shader drives organic surface deformation
  • Fresnel rim lighting with pulse color oscillation in fragment shader
  • State-driven color and animation parameters (speed, amplitude, pulse rate)
  • WebGL context recovery for resilience against GPU context loss
  • Code-split Three.js chunk (~452KB) loaded independently

ai AI Pipeline

  • Streaming path: Client β†’ Netlify Edge Function (Deno) β†’ Gemini SSE endpoint β†’ chunked text back to UI
  • Non-streaming path: Client β†’ Netlify Handler Function (Node.js) β†’ Gemini REST endpoint β†’ complete response
  • Automatic path selection based on network quality; manual fallback on stream failure
  • Per-language system prompts instruct concise, direct responses

security Security Model

  • API key isolated on server; never bundled or transmitted to the client
  • CSP, HSTS, X-Frame-Options, and Permissions-Policy headers enforced via netlify.toml
  • Rate limiting at the function layer (30 req/min per IP)
  • Input validation on query length, history depth, and language enum

deployment Deployment

  • Hosted on Netlify with automatic builds from the repository
  • PWA with Workbox service worker for offline asset caching
  • Code-split bundles for optimal loading performance
  • SPA fallback routing configured for client-side navigation

About

Nova is a modern, multilingual AI voice assistant that brings natural conversation to your browser. With support for English πŸ‡ΊπŸ‡Έ, Arabic πŸ‡±πŸ‡§, and French πŸ‡«πŸ‡·, Nova makes interaction seamless and intuitive.

Topics

Resources

Contributing

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages