How ayushgupta208019/voice-command-shopping-assistant works
Project Type and Purpose
• This is a lightweight full-stack web application (Voice Command Shopping Assistant) built with Python (Flask) on the backend and a single HTML frontend.
• It lets users speak shopping commands (e.g., “add two apples to my cart”) in the browser, processes those commands server-side, and updates a simple cart/products data store (JSON files).
High-Level Architecture
• Presentation Layer (Browser/Frontend)
• index.html (templates/index.html)
• JavaScript to capture voice input via the Web Speech API
• Sends RESTful requests (e.g., POST /command) to the Flask backend
• Application Layer (Backend)
• app.py (Flask application)
• Routes: serves index.html, receives voice command payloads
• Business logic: Natural Language Processing (simple parsing or external library) → action mapping (add/remove/list items)
• Reads/writes cart.json & products.json
• Data Layer
• products.json – master list of available products and their metadata
• cart.json – current user’s shopping cart state
• External Services (optional/extension)
• Could integrate third-party speech-to-text API if browser API is insufficient
• Could use a database (e.g., SQLite/PostgreSQL) instead of JSON in production
Detailing Essentials
• Don’t omit the voice-to-text step (crucial for “Voice Command”)
• Both read and write operations to cart.json/products.json
• That requirements.txt governs dependencies in Flask
• If planning extensions (e.g., DB migration, external ASR), include placeholder components