Skip to content

Repository files navigation


🛒 SuperMartGPT

AI-Powered Multilingual Retail Assistant for Local Supermarkets

Next.js OpenAI Supabase Tailwind

SuperMartGPT is a full-stack AI prototype designed to modernize local supermarkets and confectionary stores—especially in linguistically diverse regions like India. It bridges the gap between traditional retail and modern AI by enabling text/voice interactions in regional languages, generating smart product recommendations, processing orders, and delivering actionable sales analytics to store owners.


🌊 Architecture & Data Flow

 ┌─────────────┐   Voice/Text    ┌───────────────┐                  ┌───────────────┐
 │  Customer   ├────────────────►│               ├─────────────────►│  OpenAI APIs  │
 │ (Web UI)    │                 │    Next.js    │ (Recs & NLP)     │ (GPT-4o-mini) │
 └──────┬──────┘                 │   App Router  │◄─────────────────┤   (Whisper)   │
        │                        │               │                  └───────────────┘
        │                        └───────┬───────┘
        │ (OTP Login)                    │ (Orders & Analytics)
        ▼                                ▼
 ┌─────────────┐                 ┌───────────────┐                  ┌───────────────┐
 │ Supabase    │                 │ Supabase (DB) │    Read-Only     │  Store Owner  │
 │ Auth System │                 │  PostgreSQL   ├─────────────────►│  (Dashboard)  │
 └─────────────┘                 └───────────────┘                  └───────────────┘

Table of Contents

  1. The Problem vs. The Solution
  2. Key Features
  3. AI Integration (OpenAI)
  4. Tech Stack 5.Quick Start (Local Development)
  5. Authentication & Security

1. The Problem vs. The Solution

The Problem (Local Supermarkets) The SuperMartGPT Solution
Language Barriers: Communication gaps between diverse customers and staff. Multilingual Chat & Voice: Native support for 8+ regional Indian languages.
No Product Discovery: Customers struggle to find specific or new items. AI Recommendations: Smart, inventory-aware product suggestions.
Blind Operations: Store owners lack visibility into daily sales trends. Admin Dashboard: Real-time revenue and top-selling product analytics.
Manual Ordering: Inefficient, error-prone, and leads to lost revenue. Automated Cart: Customers manage carts and receive unique Order IDs.

2. Key Features

Customer Features

  • Multilingual Chat: Seamless interaction in English, Hindi, Tamil, Telugu, Kannada, Malayalam, Bengali, and Marathi.
  • Voice-to-Text Querying: Speak naturally to search for products instead of typing.
  • Personalized AI Recommendations: Suggests complementary items based on current queries.
  • Smart Shopping Cart: Easily add/remove items and securely place orders (generates a unique Order ID).
  • User Authentication: Checkout is restricted to verified (logged-in) users only.

Admin Features

  • Sales Analytics Dashboard: A password-protected hub for store owners.
  • Revenue Tracking: Visualizes total revenue and units sold (utilizing both real orders and demo datasets).
  • Top Sellers: Automatically identifies and ranks best-selling inventory.

3. AI Integration (OpenAI)

SuperMartGPT relies heavily on OpenAI to provide a seamless, latency-optimized user experience while remaining highly cost-efficient.

AI Task OpenAI Model Rationale
Chatbot & Reasoning GPT-4o-mini Fast, affordable, and highly capable of contextual reasoning.
Multilingual Translation GPT-4o-mini High accuracy across regional Indian dialects.
Product Recommendations GPT-4o-mini Understands purchase intent to cross-sell/up-sell items.
Analytics Summaries GPT-4o-mini Synthesizes raw DB sales data into plain-text admin insights.
Voice-to-Text Input Whisper API Industry-leading speech recognition for noisy retail environments.

4. Tech Stack

  • Frontend: Next.js (App Router), React, Tailwind CSS
  • Backend: Next.js API Routes (Serverless)
  • AI & NLP: OpenAI API (GPT-4o-mini, Whisper)
  • Database: PostgreSQL (Hosted on Supabase)
  • Authentication: Supabase Auth (Email OTP login)
  • Deployment: Vercel

5. Quick Start (Local Development)

Easily run the full stack locally on your machine.

1. Clone and Install Dependencies:

git clone https://github.com/YOUR_USERNAME/SuperMartGPT.git
cd SuperMartGPT
npm install

2. Configure Environment Variables: Create a .env.local file in the root directory and add the following keys:

OPENAI_API_KEY=your_openai_key_here

SUPABASE_URL=your_supabase_url_here
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key_here
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url_here
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key_here

AUTH_PASSWORD=admin20

3. Boot the Application:

npm run dev

The app will be available at: http://localhost:3000


6. Authentication & Security

  • Passwordless Login: Employs secure Email OTP authentication via Supabase Auth for friction-free customer onboarding.
  • Protected Routes: Order placements are strictly restricted to authenticated users. The Admin Analytics dashboard is shielded by a separate secure password.
  • Zero Credential Leakage: All API keys and Supabase credentials are fundamentally separated from the source code using environment variables.
  • Disclaimer: This repository does not contain real API keys. You must provide your own API keys in the .env.local file to use the AI and DB features.

SuperMartGPT: Solving real-world retail problems.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages