A modern, zero-latency, voice-first shopping list manager & e-commerce catalog powered by browser-native Speech Recognition, a client-side NLP intent engine, fuzzy edit-distance matching, smart recommendation algorithms, and an authoritative Monochrome High-Contrast glassmorphic interface.
VocalCart is engineered as a zero-latency, voice-first web application built with React 18 and Vite. Speech recognition and text-to-speech feedback are handled client-side via the browser-native Web Speech API (SpeechRecognition & SpeechSynthesis), supporting real-time streaming transcripts and multilingual switching (English, Spanish, Hindi, French).
Command processing relies on a pure JavaScript NLP engine that tokenizes spoken input to extract intents (ADD, REMOVE, SEARCH, FILTER_PRICE, VIEW_CART, GET_SUGGESTIONS), numerical quantities ("two" -> 2), units (bottles, lbs), and price thresholds (under $5). The engine features a custom stem normalizer and Levenshtein edit-distance fuzzy matcher to seamlessly parse plurals and speech typos (e.g. "millks" -> "Organic Whole Milk"). Unlisted items trigger audio feedback indicating unavailability.
A custom recommendation engine provides smart substitute suggestions (e.g. Almond Milk for Whole Milk), date-aware seasonal produce alerts, and localStorage-backed purchase history tracking to alert users when essentials run low. The UI follows a strict Monochrome High-Contrast design system utilizing pure black surfaces (#141313), white glass blurs (backdrop-filter: blur(24px)), Outfit & Inter typography, a bottom-right floating microphone FAB, and animated audio waveforms.
ββββββββββββββββββββββββββββββββββββββββ
β User Voice Input (Mic) β
ββββββββββββββββββββ¬ββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββ
β Layer 1: Web Speech API STT β
β (SpeechRecognition / lang switcher) β
ββββββββββββββββββββ¬ββββββββββββββββββββ
β (Raw Transcript Stream)
βΌ
ββββββββββββββββββββββββββββββββββββββββ
β Layer 2: Local JS NLP & Stemmer β
β - Action Keyword Intent Classifier β
β - Quantity & Price Filter Tokenizer β
β - Levenshtein Fuzzy Product Matcher β
ββββββββββββββββββββ¬ββββββββββββββββββββ
β (Structured Intent Object)
βΌ
ββββββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββ
β Shopping List State β β Recommendation Engine β β Product Catalog State β
β - Auto-Categorization β β - Smart Substitutes β β - Price Range Filtering β
β - Quantity Steppers β β - Seasonal Produce β β - Organic Attribute Tag β
β - LocalStorage Persist β β - Low-Stock History β β - Search Query Filter β
ββββββββββββββ¬βββββββββββββββ ββββββββββββββ¬βββββββββββββββ ββββββββββββββ¬βββββββββββββββ
β β β
ββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββ
β Layer 3: Audio TTS & UI Render β
β - SpeechSynthesis Audio Feedback β
β - Bottom-Right Floating Mic FAB β
β - Monochrome High-Contrast Glass β
ββββββββββββββββββββββββββββββββββββββββ
- Explicit Action Keyword Enforcement: Intent detection requires explicit command verbs (
add,buy,need,remove,delete,find,search,suggest). Conversational phrases like "hello" or "testing 123" yield aGREETINGorUNKNOWNintent, preventing accidental list modifications. - Numeric & Unit Normalization: Converts verbal number words (
"one","two","a dozen") into integer quantities and extracts standard measurement units (bottles,gallons,lbs,packs). - Price Filter Extraction: Regex patterns parse monetary constraints (e.g.
"under $5","less than 10 dollars") into structured price bounds (maxPrice: 5.00).
-
Plural Normalization: Strips trailing plurals (
"ies"->"y","es"->"","s"->"") and collapses double letters ("millk"->"milk"). -
Levenshtein Similarity: Calculates string edit distance similarity (
$1 - \frac{\text{dist}}{\text{maxLen}}$ ) to match speech variations (e.g. "millks", "milks", "appels", "strawberries") to exact catalog items (Organic Whole Milk, Honeycrisp Apples, Fresh Strawberries). - Strict Store Catalog Check: If an item is not in the store database and yields a similarity score below 0.70, it is rejected with spoken feedback: "Sorry, [item] is currently not available in our store."
- Smart Substitutes: When an item like Whole Milk is added, the app highlights dietary/healthy alternatives (Almond Milk, Oat Milk) with 1-tap swap buttons.
- Date-Aware Seasonal Produce: Evaluates the current month (
new Date().getMonth()) to highlight in-season fruits and vegetables. - History-Based Reorder Warnings: Stores item timestamps in
localStorage. If an essential item like bread or milk was added over 4 days ago, prompts a low-stock alert.
- Speaking "What is in my cart?", "What's on my list?", or "Show my cart" opens the shopping drawer and generates a natural spoken audio summary: "In your cart, you have 2 Organic Whole Milk and 1 Honeycrisp Apples. Total estimated cost is $14.28."
The application strictly implements the Monochrome High-Contrast aesthetic:
- Background Surfaces: Pure Black (
#141313,#0E0E0E) for deep, glare-free dark surfaces. - Glassmorphism: White glass panels (
rgba(255, 255, 255, 0.06)fill,backdrop-filter: blur(24px)), defined by 1px stroke borders (rgba(255, 255, 255, 0.15)). - Typography: Outfit for geometric display headings and Inter for body text and data labels.
- Voice UI: Bottom-Right Floating Action Button (FAB) with animated frequency soundwaves (
animate-wave-1throughanimate-wave-5) and pulsing mic ripple rings (mic-listening).
d:\projects\unthinkable\
βββ index.html # Entry HTML with Outfit & Inter Google Fonts
βββ package.json # Dependencies (React 18, Vite, Lucide React, Tailwind CSS)
βββ vite.config.js # Vite build configuration
βββ tailwind.config.js # Tailwind v3 theme tokens & colors
βββ postcss.config.js # PostCSS plugins
βββ README.md # Technical assessment documentation & write-up
βββ src/
βββ main.jsx # React application root
βββ App.jsx # Main state coordinator, NLP dispatcher & speech lifecycle
βββ index.css # Monochrome High-Contrast design system tokens & animations
βββ data/
β βββ productsData.js # E-Commerce grocery product catalog database
βββ services/
β βββ nlpEngine.js # NLP intent classifier, stemmer & Levenshtein matcher
β βββ speechEngine.js # Web Speech API (STT & TTS) manager & language switcher
β βββ recommendationEngine.js # Substitutes map, seasonal matrix & purchase history
βββ components/
βββ Navbar.jsx # Top bar with transcript streamer, multilingual picker & TTS toggle
βββ VoiceConsole.jsx # Floating Bottom-Right Mic FAB & glass toast feedback
βββ ProductCatalog.jsx # Product grid, search bar, price filters & seasonal carousel
βββ ShoppingListSidebar.jsx # Categorized cart drawer, quantity steppers & substitute popovers
βββ QuickGuideModal.jsx # Voice command cheat-sheet popup
- Node.js (v18 or higher)
- Google Chrome, Microsoft Edge, Safari, or Brave (for Web Speech API support)
# 1. Clone the repository
git clone https://github.com/your-username/vocalcart-voice-shopping-assistant.git
cd vocalcart-voice-shopping-assistant
# 2. Install dependencies
npm install
# 3. Start local development server
npm run dev
# 4. Open in browser
# Navigate to http://localhost:3000# Build production bundle
npm run build
# Preview production build locally
npm run preview| Feature Category | Assessment Requirement | Implementation Status |
|---|---|---|
| Voice Input | Voice Command Recognition | β
Native SpeechRecognition API real-time listening |
| Voice Input | Varied Phrasing NLP | β
Intent tokenizer for add, buy, need, remove, find
|
| Voice Input | Multilingual Support | β
Dynamic language switcher (en-US, es-ES, hi-IN, fr-FR) |
| Smart Suggestions | History Low-Stock Alerts | β
localStorage timestamp tracker for items >4 days old |
| Smart Suggestions | Seasonal Recommendations | β Date-aware seasonal produce carousel |
| Smart Suggestions | Dietary Substitutes | β 1-tap substitute popover badges (e.g. Milk -> Almond Milk) |
| Shopping List | Add / Remove / Modify | β Complete list state CRUD with spoken TTS audio responses |
| Shopping List | Auto-Categorization | β Grouped categories (Produce, Dairy, Bakery, Pantry, etc.) |
| Shopping List | Quantity Management | β
Extracted numbers ("2") & units ("bottles") with quantity steppers |
| Voice Search | Item & Attribute Search | β Voice search by product name, brand, or organic tag |
| Voice Search | Price Range Filtering | β
Parses "under $5" / "less than $10" and applies live filters |
| UI / UX | Minimalist High-Contrast UI | β Pure black surfaces, Outfit & Inter fonts, 24px blurs, Floating Mic FAB |
Distributed under the MIT License. Built for Technical Assessment Evaluation.


