Skip to content

himaenshuu/ShopSense

Repository files navigation

πŸ›οΈ ShopSense - AI-Powered E-Commerce Shopping Assistant

Next.js TypeScript MongoDB Google Gemini License

An intelligent conversational assistant that transforms online shopping with AI-powered product discovery, sentiment analysis, and personalized recommendations.

🐳 Docker Image β€’ πŸ“– Documentation β€’ πŸš€ Live Demo


🌟 What Makes ShopSense Stand Out

ShopSense isn't just another e-commerce chatbot. It's a sophisticated AI-powered shopping companion that combines:

  • 🧠 Intelligent Intent Recognition - Understands complex shopping queries and classifies intent (product search, price comparison, reviews, general chat)
  • πŸ’¬ Context-Aware Conversations - Maintains conversation history with persistent chat sessions stored in real-time
  • 🎯 Semantic Product Search - MongoDB text indexing for lightning-fast, relevant product discovery
  • πŸ“Š Advanced Sentiment Analysis - Dual-mode sentiment processing using both Gemini AI and custom ML models for accurate review analysis
  • πŸ“§ Smart Email Generation - AI-crafted product recommendation emails with personalized content
  • πŸ”Š Text-to-Speech Integration - Convert responses to natural speech for accessibility
  • πŸ” Secure Authentication - Appwrite-powered auth with OAuth support and guest mode
  • 🎨 Beautiful UI/UX - Modern, responsive design with dark mode and 40+ shadcn/ui components

🎯 Problem Statement

Online shoppers face three critical challenges:

  1. Information Overload - Thousands of products, reviews, and specifications make decision-making exhausting
  2. Trust Deficit - Difficulty assessing genuine product quality from mixed reviews
  3. Time Consumption - Hours spent comparing prices, reading reviews, and researching alternatives

✨ Our Solution

ShopSense solves these problems by:

  • Conversational Product Discovery - Ask questions naturally: "Find me wireless headphones under $100 with good battery life"
  • Instant Review Synthesis - AI-powered sentiment analysis summarizes hundreds of reviews in seconds
  • Smart Comparisons - Compare products side-by-side with pricing insights and feature breakdowns
  • Proactive Recommendations - Email yourself curated product suggestions for later review

πŸš€ Key Features

πŸ€– AI-Powered Chat Interface

  • Natural language product queries with intent classification
  • Context-aware responses based on conversation history
  • Real-time streaming responses for instant feedback
  • Guest mode for quick access, authenticated mode for personalized experience

πŸ“ˆ Intelligent Sentiment Analysis

  • Hybrid sentiment engine combining Gemini AI and custom ML models
  • Review summarization with positive/negative/neutral categorization
  • Highlighted examples from actual customer reviews
  • Confidence scoring for reliability

πŸ” Advanced Product Search

  • MongoDB text search with relevance scoring
  • Multi-field indexing (name, category, description)
  • Price range filtering and sorting
  • Availability status tracking

πŸ’Œ Email Integration

  • AI-generated personalized product recommendation emails
  • SendGrid integration for reliable delivery
  • Customizable templates with product details and links
  • One-click email sending from chat interface

πŸŽ™οΈ Accessibility Features

  • Text-to-speech conversion using Gemini TTS
  • Screen reader compatible components
  • Keyboard navigation support
  • WCAG-compliant UI design

🎨 Modern User Experience

  • Responsive design for all devices
  • Dark/light theme toggle with system preference detection
  • Smooth animations and transitions
  • Real-time typing indicators

πŸ› οΈ Tech Stack

Frontend

  • Next.js 15.0.3 - React framework with App Router
  • React 18.3.1 - UI library
  • TypeScript 5.6.3 - Type-safe development
  • Tailwind CSS 3.4.17 - Utility-first styling
  • shadcn/ui - 40+ beautiful, accessible components
  • Radix UI - Unstyled, accessible component primitives

Backend & APIs

  • Next.js API Routes - Serverless functions
  • Google Gemini AI - Chat completions, sentiment analysis, email generation, TTS
  • Appwrite 16.0.2 - Authentication, realtime database, storage
  • MongoDB 6.20.0 - Product database with text search indexing
  • SendGrid - Transactional email delivery

AI/ML

  • @google/generative-ai - Google Gemini integration
  • @xenova/transformers 2.17.2 - Client-side ML models for sentiment analysis
  • Custom Intent Classifier - Query categorization engine
  • Sentiment Analyzer - Hybrid sentiment processing

DevOps & Deployment

  • Docker - Containerization for consistent deployments
  • Vercel - Production hosting with automatic deployments
  • GitHub Actions - CI/CD pipeline for testing and validation

🐳 Docker Deployment

Quick Start with Docker

# Pull the pre-built image
docker pull himaenshuu/shopassist:v1

# Run the container
docker run -p 3000:3000 --env-file .env himaenshuu/shopassist:v1

# Access at http://localhost:3000

Docker Image: 🐳 himaenshuu/shopassist:v1


πŸ“¦ Installation & Setup

Prerequisites

  • Node.js 18+ and npm
  • MongoDB Atlas account (free tier works)
  • Appwrite account (cloud or self-hosted)
  • Google Gemini API key
  • SendGrid API key (for email features)

πŸš€ Deployment

Vercel (Recommended)

  1. Connect GitHub repository to Vercel
  2. Add environment variables in Vercel dashboard
  3. Deploy automatically on push to main

πŸ§ͺ CI/CD Pipeline

Automated testing and validation on every pull request:

  • βœ… ESLint - Code quality and style checks
  • βœ… TypeScript - Type validation
  • βœ… Build - Compilation verification

Protected main branch ensures only validated code reaches production.


πŸ“Š Architecture Highlights

Data Flow

User Query β†’ Intent Classifier β†’ Product Service β†’ MongoDB
                                                        ↓
                                                 Gemini AI
                                                        ↓
                                            Response Generation
                                                        ↓
                                              User Interface

Key Components

Intent Classification

  • Analyzes user queries to determine intent
  • Routes to appropriate service (product search, review analysis, chat)
  • Confidence scoring for accurate classification

Product Search Pipeline

  • MongoDB text indexing for fast full-text search
  • Relevance scoring and ranking
  • Price filtering and availability checks

Sentiment Analysis Engine

  • Gemini AI for semantic understanding
  • Fallback to custom ML model for reliability
  • Structured output parsing with confidence metrics

Email Generation

  • Context-aware content creation
  • Product detail integration
  • SendGrid delivery with tracking

🀝 Contributing

We welcome contributions!

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with tests
  4. Submit a pull request

πŸ“ License

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


πŸ™ Acknowledgments

  • Google Gemini AI - Powerful language models
  • Appwrite - Backend-as-a-Service platform
  • MongoDB - Scalable document database
  • Vercel - Deployment and hosting
  • shadcn/ui - Beautiful component library
  • Open Source Community - Amazing tools and libraries

πŸ“§ Contact & Support


Built with ❀️ using Next.js and Google Gemini AI

⭐ Star this repo if you find it helpful!

About

Shopsenei is a shopping assistant and q & a system that enable us to know and compare the product available on amazon. It further sends you a buy now link of the selected product to your email.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages