Skip to content

gudlaa/AppliScan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

73 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ  AppliScan - AI-Powered Energy Decision Support

AppliScan Logo

Transform appliance shopping with AI-powered energy intelligence

Next.js TypeScript Tailwind CSS Vercel

Live Demo โ€ข Documentation โ€ข Features


๐Ÿ“‹ Table of Contents


โœจ Feature Highlights

  • ๐Ÿ” Camera-Activated Appliance Scan - Point your camera at any model number label for instant recognition
  • ๐ŸŽค Voice-Activated Energy Assistant - Natural, conversational AI powered by ElevenLabs
  • ๐Ÿ’ฐ Lifetime Cost & Carbon Intelligence - 10-year TCO calculations with location-based pricing
  • ๐ŸŽฏ Smart Comparisons & Recommendations - AI-driven alternatives with savings projections
  • ๐ŸŒ Location-Aware Analysis - Zip code-based utility rates and carbon intensity
  • ๐Ÿ’ธ Rebate Discovery - Automatic detection of energy efficiency rebates
  • ๐ŸŽจ Modern Glassmorphism UI - Beautiful green/black AI-themed interface

๐ŸŽฏ Overview

AppliScan is an AI-powered web application that helps consumers make informed decisions when purchasing home appliances. By combining OCR technology, Energy Star API integration, location-based utility data, and natural language AI, AppliScan provides comprehensive energy cost analysis, carbon impact tracking, and personalized recommendations.

What Makes AppliScan Special?

  1. Instant Visual Recognition - No manual data entry required. Simply point your camera at the model number label.
  2. AI Voice Assistant - Natural, human-like voice powered by ElevenLabs that explains costs, efficiency, and recommendations conversationally.
  3. True Cost Transparency - See the real 10-year cost, not just the sticker price.
  4. Location Intelligence - Calculations adapt to your local utility rates and grid carbon intensity.
  5. Smart Recommendations - AI finds more efficient alternatives and calculates your potential savings.
  6. Rebate Integration - Automatically surfaces available energy efficiency rebates in your area.

๐ŸŽฏ Product Purpose

AppliScan solves the critical problem of hidden energy costs in appliance purchases. Most consumers only see the upfront price, but the true cost of ownership includes 10 years of electricity bills. AppliScan makes this transparent, helping users:

  • Save Money - Understand true 10-year costs and find more efficient alternatives
  • Reduce Carbon Footprint - See lifetime COโ‚‚ emissions and make eco-friendly choices
  • Maximize Rebates - Discover available energy efficiency incentives
  • Make Informed Decisions - Compare products with comprehensive data and AI insights

๐Ÿš€ Key Capabilities

1. OCR-Powered Scanning

  • Real-time camera scanning with html5-qrcode
  • OCR.space API integration for text recognition
  • Tesseract.js fallback for offline capability
  • Photo upload support for model number labels

2. Energy Star Integration

  • Direct API integration with Energy Star's Socrata database
  • Automatic product matching by model number
  • Comprehensive product specifications retrieval
  • Energy efficiency ratings and certifications

3. Advanced Cost Calculations

  • 10-year Total Cost of Ownership (TCO)
  • Annual operating cost projections
  • Location-based utility rate integration
  • Rebate deduction calculations
  • Break-even analysis for upgrades

4. Carbon Impact Analysis

  • Lifetime COโ‚‚ emissions tracking
  • Regional carbon intensity data (EPA EGRID)
  • Grid region classification
  • Environmental impact comparisons

5. AI Voice Assistant

  • ElevenLabs text-to-speech for natural voice
  • Context-aware responses using ProductAnalysisContext
  • Web Speech API fallback
  • Voice preferences and welcome message controls
  • Conversational product analysis

6. Smart Recommendations

  • Energy-efficient alternative discovery
  • Savings calculations (annual and 10-year)
  • Energy improvement percentage
  • Product specification comparisons

7. Location Intelligence

  • Zip code to state mapping
  • 50 US states utility rate database
  • Regional carbon intensity data
  • State-specific rebate program lookup

๐ŸŽจ Features

Camera-Activated Appliance Scan

  • Real-time scanning with device camera
  • OCR text recognition using OCR.space API (primary) and Tesseract.js (fallback)
  • Model number extraction from product labels
  • Photo upload alternative for scanning
  • Instant product lookup via Energy Star API

Voice-Activated Energy Assistant

  • Global Voice Agent - Persistent floating assistant available on all pages
  • ElevenLabs Integration - Natural, human-like British male voice
  • Context-Aware Responses - Understands product analysis context
  • Conversational Interface - Ask questions, get voice responses
  • Welcome Messages - Configurable voice greetings
  • Voice Preferences - Toggle voice welcomes on/off

Lifetime Cost & Carbon Intelligence

  • 10-Year TCO Calculation
    10-Year TCO = (Upfront Price - Rebates) + (Annual kWh ร— Electricity Rate ร— 10)
    
  • Annual Operating Cost - Yearly electricity expenses
  • Lifetime COโ‚‚ Emissions - Total carbon footprint in tons
  • Energy Efficiency Levels - Categorization (Very Low, Low, Medium, High)
  • Payback Timeline - ROI analysis for upgrades

Smart Comparisons & Recommendations

  • Top 3 Alternatives - Most energy-efficient options
  • Energy Improvement % - Efficiency gains over current product
  • 10-Year Savings - Projected cost savings
  • Product Specifications - CEF, capacity, dimensions comparison
  • Side-by-Side Analysis - Easy visual comparison

Location-Aware Analysis

  • Zip Code Input - Enter your location for accurate rates
  • State-Level Data - 50 US states covered
  • Utility Rate Database - EIA & FERC form data
  • Carbon Intensity - EPA EGRID regional data
  • Rebate Discovery - State-specific energy efficiency programs

Modern UI/UX

  • Glassmorphism Design - Translucent cards with backdrop blur
  • Green/Black AI Theme - Modern, tech-forward aesthetic
  • Responsive Layout - Mobile-first design
  • Smooth Animations - Enhanced user experience
  • Accessibility - Voice-first interface, keyboard navigation

๐Ÿ› ๏ธ Technology Stack

Frontend

  • Next.js 14 - React framework with App Router
  • React 18 - UI library with hooks and context
  • TypeScript 5.0 - Type-safe development
  • Tailwind CSS 3.3 - Utility-first styling
  • html5-qrcode - Barcode/QR code scanning
  • Tesseract.js - Client-side OCR fallback

Backend & APIs

  • Next.js API Routes - Serverless functions
  • Energy Star API - Socrata database integration
  • OCR.space API - Cloud-based OCR service
  • ElevenLabs API - Text-to-speech synthesis
  • Web Speech API - Browser-native speech recognition

Data Sources

  • Energy Star Database - Product specifications and efficiency data
  • EIA & FERC - Utility rate data (residential electricity rates)
  • EPA EGRID - Carbon intensity data (regional grid emissions)
  • State Rebate Programs - Energy efficiency incentive data

Development Tools

  • Vercel - Deployment and hosting
  • Git - Version control
  • npm - Package management
  • TypeScript - Type checking
  • ESLint - Code linting

๐Ÿ“ฆ Installation

Prerequisites

  • Node.js 18+ and npm
  • Git
  • Modern web browser (Chrome, Safari, Firefox, Edge)

Step 1: Clone the Repository

git clone https://github.com/gudlaa/ClearCost.git
cd ClearCost

Step 2: Install Dependencies

npm install

Step 3: Environment Variables

Create a .env.local file in the root directory:

# OCR API Key (get free key at https://ocr.space/ocrapi/freekey)
OCR_SPACE_API_KEY=your_ocr_space_api_key

# ElevenLabs API Key (get at https://elevenlabs.io)
ELEVENLABS_API_KEY=your_elevenlabs_api_key

# Optional: Custom ElevenLabs Voice ID
ELEVENLABS_VOICE_ID=onwK4e9ZLuTAKqWW03F9  # Daniel (British male)

Step 4: Run Development Server

npm run dev

Visit http://localhost:3000 to see the app.


โš™๏ธ Configuration

Vercel Deployment

The project includes vercel.json with optimized settings:

  • Build command: npm run build
  • Framework: Next.js
  • Region: iad1 (US East)
  • API route headers for CORS

Environment Variables in Vercel

  1. Go to Vercel Dashboard โ†’ Your Project โ†’ Settings โ†’ Environment Variables
  2. Add:
    • OCR_SPACE_API_KEY (Production, Preview, Development)
    • ELEVENLABS_API_KEY (Production, Preview, Development)
  3. Redeploy after adding variables

See VERCEL_DEPLOYMENT.md for detailed instructions.

Voice Preferences

Users can toggle voice welcomes via the Voice Agent UI. Preferences are stored in localStorage:

  • Key: voiceWelcomeEnabled
  • Default: true

๐Ÿ“– Usage

Basic Workflow

  1. Launch App - Visit the home page, hear "Welcome to AppliScan"
  2. Start Scanning - Click "Start Scanning" button
  3. Scan Product - Point camera at model number label or upload photo
  4. View Results - See product info, energy use, and efficiency rating
  5. Enter Location - Provide zip code for location-based rates
  6. Review Analysis - See 10-year cost, carbon impact, and recommendations
  7. Interact with Voice - Ask questions or request voice summary

Voice Commands

  • "What is the 10-year cost?"
  • "Tell me about the carbon impact"
  • "What are the recommendations?"
  • "Change location to [zip code]"
  • "Read the results"

Example Journey

  1. User scans dryer model DVE52M77
  2. App displays: Samsung dryer, 607 kWh/year, average efficiency
  3. User enters zip code 10001 (New York)
  4. System calculates:
    • Utility rate: $0.1990/kWh
    • 10-Year Cost: $1,594
    • Annual Operating: $119.40
    • Carbon: 6 tons COโ‚‚
  5. App recommends 3 more efficient alternatives with savings
  6. User clicks Voice Agent, asks "What are my savings?"
  7. Voice responds with natural, conversational explanation

๐Ÿ“ Project Structure

ClearCost/
โ”œโ”€โ”€ app/                          # Next.js App Router
โ”‚   โ”œโ”€โ”€ api/                      # API routes
โ”‚   โ”‚   โ”œโ”€โ”€ calculate-tco/        # TCO calculation endpoint
โ”‚   โ”‚   โ”œโ”€โ”€ utility-rates/        # Location-based rates
โ”‚   โ”‚   โ”œโ”€โ”€ rebates/              # Rebate lookup
โ”‚   โ”‚   โ”œโ”€โ”€ recommend/            # Product recommendations
โ”‚   โ”‚   โ”œโ”€โ”€ ocr-space/            # OCR.space proxy
โ”‚   โ”‚   โ”œโ”€โ”€ elevenlabs/           # ElevenLabs TTS proxy
โ”‚   โ”‚   โ””โ”€โ”€ lookup-upc/            # UPC lookup
โ”‚   โ”œโ”€โ”€ page.tsx                  # Home page
โ”‚   โ”œโ”€โ”€ scan/                     # Scanner page
โ”‚   โ”œโ”€โ”€ results/                  # Results page
โ”‚   โ”œโ”€โ”€ compare/                  # Comparison page
โ”‚   โ”œโ”€โ”€ layout.tsx                # Root layout
โ”‚   โ””โ”€โ”€ globals.css               # Global styles
โ”œโ”€โ”€ components/                   # React components
โ”‚   โ”œโ”€โ”€ barcode-scanner/          # Scanner components
โ”‚   โ”œโ”€โ”€ voice-assistant/          # Voice AI components
โ”‚   โ”œโ”€โ”€ navigation/               # TopNav component
โ”‚   โ”œโ”€โ”€ recommendations/          # Product recommendations
โ”‚   โ””โ”€โ”€ energy-label/             # Energy label display
โ”œโ”€โ”€ lib/                          # Utility libraries
โ”‚   โ”œโ”€โ”€ calculations/             # Energy calculations
โ”‚   โ”œโ”€โ”€ utils/                    # Helper functions
โ”‚   โ”‚   โ”œโ”€โ”€ voiceAssistant.ts     # Voice synthesis
โ”‚   โ”‚   โ”œโ”€โ”€ elevenlabsVoice.ts    # ElevenLabs integration
โ”‚   โ”‚   โ””โ”€โ”€ voicePreferences.ts   # User preferences
โ”‚   โ””โ”€โ”€ api-clients/              # API clients
โ”‚       โ”œโ”€โ”€ energyStar.ts         # Energy Star API
โ”‚       โ””โ”€โ”€ upcitemdb.ts          # UPC database
โ”œโ”€โ”€ contexts/                     # React contexts
โ”‚   โ””โ”€โ”€ ProductAnalysisContext.tsx # Global product state
โ”œโ”€โ”€ backend/                      # Backend data
โ”‚   โ”œโ”€โ”€ data/                     # Static data files
โ”‚   โ”‚   โ”œโ”€โ”€ utility_rates.json    # Utility rates by state
โ”‚   โ”‚   โ”œโ”€โ”€ carbon_intensity.json # Carbon data by state
โ”‚   โ”‚   โ””โ”€โ”€ rebates.json          # Rebate programs
โ”‚   โ””โ”€โ”€ api/                      # FastAPI routes (legacy)
โ”œโ”€โ”€ public/                       # Static assets
โ”‚   โ””โ”€โ”€ whiteLogo.png             # AppliScan logo
โ”œโ”€โ”€ vercel.json                   # Vercel configuration
โ”œโ”€โ”€ next.config.js                # Next.js configuration
โ”œโ”€โ”€ tailwind.config.js            # Tailwind configuration
โ””โ”€โ”€ package.json                  # Dependencies

๐Ÿ—๏ธ Architecture

Frontend Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         Next.js App Router              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚
โ”‚  โ”‚  Pages   โ”‚  โ”‚  Layout  โ”‚           โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ”‚
โ”‚       โ”‚              โ”‚                 โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”‚
โ”‚  โ”‚   React Components       โ”‚         โ”‚
โ”‚  โ”‚  - Scanner               โ”‚         โ”‚
โ”‚  โ”‚  - Voice Agent          โ”‚         โ”‚
โ”‚  โ”‚  - Results Display      โ”‚         โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ”‚
โ”‚       โ”‚                                โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”‚
โ”‚  โ”‚   Context Providers      โ”‚         โ”‚
โ”‚  โ”‚  - ProductAnalysisContext โ”‚         โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Data Flow

User Action (Scan/Upload)
    โ†“
OCR Processing (OCR.space โ†’ Tesseract fallback)
    โ†“
Model Number Extraction
    โ†“
Energy Star API Query
    โ†“
Product Data Retrieved
    โ†“
User Enters Zip Code
    โ†“
Utility Rates API + Carbon Data
    โ†“
TCO Calculation + Recommendations
    โ†“
Results Display + Voice Context Update
    โ†“
User Interacts with Voice Agent
    โ†“
Context-Aware Voice Response

API Architecture

Client (Browser)
    โ†“
Next.js API Routes (/api/*)
    โ†“
External APIs:
  - Energy Star (Socrata)
  - OCR.space
  - ElevenLabs
    โ†“
Data Processing
    โ†“
Response to Client

๐Ÿ“ก API Reference

1. Calculate TCO

Endpoint: POST /api/calculate-tco

Request Body:

{
  "product": {
    "model_number": "DVE52M77",
    "estimated_annual_energy_use_kwh_yr": 607,
    "brand_name": "Samsung"
  },
  "upfrontPrice": 800,
  "rebates": 0,
  "utilityRate": 0.1990,
  "carbonIntensity": 0.20
}

Response:

{
  "costs": {
    "tenYearTotalCost": 1594.00,
    "annualOperatingCost": 119.40
  },
  "energy": {
    "energyUseLevel": {
      "level": "medium",
      "description": "Average efficiency"
    }
  },
  "carbon": {
    "tenYear_emissions_tons": 6.07
  }
}

2. Utility Rates

Endpoint: GET /api/utility-rates?zipCode=10001

Response:

{
  "state": "NY",
  "stateName": "New York",
  "gridRegion": "Northeast",
  "utilityRate": 0.1990,
  "carbonIntensity": 0.20,
  "rateUnit": "$/kWh",
  "carbonUnit": "lbs CO2/kWh"
}

3. Rebates

Endpoint: GET /api/rebates?zipCode=10001&productType=dryer

Response:

{
  "state": "NY",
  "stateName": "New York",
  "productType": "dryer",
  "programs": [
    {
      "name": "New York ENERGY STAR Program",
      "appliances": ["dryer", "washer"],
      "rebateAmount": 125,
      "url": "https://www.dec.ny.gov"
    }
  ],
  "totalPrograms": 1
}

4. Recommendations

Endpoint: GET /api/recommend?model=DVE52M77&productType=dryer&maxResults=3

Response:

{
  "recommendations": [
    {
      "brand_name": "Samsung",
      "model_name": "DVE45T6000W",
      "model_number": "DVE45T6000W",
      "estimated_annual_energy_use_kwh_yr": 520,
      "energyImprovement": "14% more efficient",
      "combined_energy_factor_cef": "4.2"
    }
  ]
}

5. OCR Processing

Endpoint: POST /api/ocr-space

Request Body:

{
  "imageBase64": "data:image/jpeg;base64,..."
}

Response:

{
  "success": true,
  "fullText": "MODEL DVE52M77...",
  "words": [
    {
      "text": "DVE52M77",
      "confidence": 95.5,
      "left": 100,
      "top": 50
    }
  ]
}

6. ElevenLabs TTS

Endpoint: POST /api/elevenlabs/tts

Request Body:

{
  "text": "Welcome to AppliScan",
  "voice_id": "onwK4e9ZLuTAKqWW03F9",
  "voice_settings": {
    "stability": 0.3,
    "similarity_boost": 0.75,
    "style": 0.7
  }
}

Response: Audio stream (MPEG)


๐Ÿ—„๏ธ Database Schema

AppliScan uses static JSON files for data storage (no database):

utility_rates.json

{
  "NY": {
    "stateName": "New York",
    "gridRegion": "Northeast",
    "residentialRate": 0.1990,
    "commercialRate": 0.1650
  }
}

carbon_intensity.json

{
  "NY": {
    "stateName": "New York",
    "carbonIntensity": 0.20,
    "gridRegion": "Northeast"
  }
}

rebates.json

{
  "NY": {
    "stateName": "New York",
    "programs": [
      {
        "name": "New York ENERGY STAR Program",
        "appliances": ["dryer", "washer"],
        "rebateAmount": 125,
        "url": "https://www.dec.ny.gov"
      }
    ]
  }
}

Note: Product data is fetched dynamically from Energy Star API.


๐Ÿงฉ Components

Core Components

ModelNumberScanner

  • Location: components/barcode-scanner/ModelNumberScanner.tsx
  • Purpose: OCR-based model number scanning
  • Features:
    • Camera integration
    • Photo upload
    • OCR.space API integration
    • Tesseract.js fallback
    • Model number extraction

GlobalVoiceAI

  • Location: components/voice-assistant/GlobalVoiceAI.tsx
  • Purpose: Persistent voice assistant
  • Features:
    • Floating bubble UI
    • Speech recognition
    • ElevenLabs TTS
    • Context-aware responses
    • Voice preferences toggle

TopNav

  • Location: components/navigation/TopNav.tsx
  • Purpose: Top navigation bar
  • Features:
    • AppliScan branding
    • Status indicator
    • Glassmorphism styling

ProductAnalysisContext

  • Location: contexts/ProductAnalysisContext.tsx
  • Purpose: Global state management
  • State:
    • productData - Current product info
    • tcoData - Cost calculations
    • recommendations - Alternative products
    • locationDisplay - User location
    • utilityRate - Current rate

โšก Real-Time Features

Voice Recognition

  • Web Speech API - Browser-native speech recognition
  • Real-time transcription - Continuous listening mode
  • Command processing - Natural language understanding
  • Context-aware responses - Uses ProductAnalysisContext

Voice Synthesis

  • ElevenLabs API - High-quality text-to-speech
  • Web Speech API fallback - Browser-native synthesis
  • Voice preferences - User-controlled welcome messages
  • Streaming audio - Real-time playback

Live Scanning

  • Camera stream - Real-time video feed
  • Frame capture - Continuous OCR processing
  • Instant feedback - Immediate model number detection

๐ŸŽจ Styling & Theming

Design System

  • Theme: Green/Black AI aesthetic
  • Style: Glassmorphism with translucent overlays
  • Colors:
    • Primary: #22c55e (green-500)
    • Background: #000000 (black)
    • Text: #d1d5db (gray-300)
    • Accent: #10b981 (emerald-500)

Custom CSS Classes

.glass-card        /* Translucent card with blur */
.glass-overlay     /* Semi-transparent overlay */
.glass-nav         /* Navigation bar styling */
.ai-text-glow      /* Green text glow effect */
.gradient-border    /* Animated gradient border */

Tailwind Configuration

  • Custom color palette
  • Extended spacing scale
  • Custom animation utilities
  • Responsive breakpoints

๐Ÿงช Testing

Manual Testing Guide

See TESTING_GUIDE.md for comprehensive testing instructions.

Test Scenarios

  1. Scanner Page

    • Camera access and permissions
    • Photo upload functionality
    • OCR accuracy with various label types
    • Model number extraction
  2. Results Page

    • TCO calculation accuracy
    • Location-based rate lookup
    • Recommendations display
    • Voice interaction
  3. Voice Agent

    • Welcome message playback
    • Speech recognition
    • Context-aware responses
    • Voice preferences persistence

API Testing

# Test TCO calculation
curl -X POST http://localhost:3000/api/calculate-tco \
  -H "Content-Type: application/json" \
  -d '{"product": {...}, "upfrontPrice": 800, ...}'

# Test utility rates
curl http://localhost:3000/api/utility-rates?zipCode=10001

๐Ÿš€ Performance Optimizations

Frontend

  • Code Splitting - Next.js automatic code splitting
  • Image Optimization - Next.js Image component
  • Lazy Loading - Dynamic imports for heavy components
  • Memoization - React.memo for expensive renders
  • Suspense Boundaries - Async component loading

API Routes

  • Caching - Static data cached in memory
  • Rate Limiting - Protection against abuse
  • Error Handling - Graceful fallbacks
  • Response Compression - Gzip compression

Voice Features

  • Audio Streaming - Chunked audio delivery
  • Fallback Mechanisms - Web Speech API backup
  • Preference Caching - localStorage for settings

๐Ÿ”’ Security Considerations

API Keys

  • Server-Side Only - API keys never exposed to client
  • Environment Variables - Secure storage in .env.local
  • Vercel Secrets - Encrypted environment variables

Data Privacy

  • No User Data Storage - No personal information collected
  • Client-Side Processing - OCR can run locally (Tesseract)
  • HTTPS Only - Secure connections enforced

Input Validation

  • Zip Code Validation - 5-digit numeric only
  • Model Number Sanitization - Alphanumeric filtering
  • Image Size Limits - Prevent abuse

๐Ÿ”ฎ Future Enhancements

Planned Features

  • Multi-Product Comparison - Side-by-side comparison tool
  • Wishlist - Save products for later
  • Price Tracking - Historical price data
  • Smart Home Integration - Connect with smart appliances
  • Time-of-Use Rates - TOU rate calculations
  • Rebate Application - Direct rebate submission
  • Mobile App - Native iOS/Android apps
  • Social Sharing - Share product analyses
  • Export Reports - PDF/CSV export
  • Multi-Language Support - Internationalization

Technical Improvements

  • Database Migration - Move from JSON to PostgreSQL
  • Caching Layer - Redis for API responses
  • Analytics - User behavior tracking
  • A/B Testing - Feature experimentation
  • Progressive Web App - PWA capabilities

๐Ÿ› Troubleshooting

Common Issues

Voice Not Working

  • Check API Key - Verify ELEVENLABS_API_KEY is set
  • Browser Permissions - Allow microphone access
  • Fallback Mode - Web Speech API should work without API key
  • Console Errors - Check browser console for errors

OCR Not Recognizing Text

  • Image Quality - Ensure clear, well-lit photos
  • API Key - Verify OCR_SPACE_API_KEY is set
  • Fallback - Tesseract.js should work offline
  • Model Number Format - Check if format matches expected pattern

Build Errors

  • TypeScript Errors - Run npm run build to see details
  • Missing Dependencies - Run npm install
  • Environment Variables - Check .env.local exists

Vercel Deployment Issues

  • Environment Variables - Must be set in Vercel dashboard
  • Build Logs - Check Vercel deployment logs
  • API Routes - Ensure export const dynamic = 'force-dynamic' for dynamic routes

Getting Help

  1. Check VERCEL_DEPLOYMENT.md for deployment issues
  2. Review TESTING_GUIDE.md for testing scenarios
  3. Check browser console for errors
  4. Verify environment variables are set correctly

๐Ÿค Contributing

We welcome contributions! Here's how to get started:

  1. Fork the Repository
  2. Create a Feature Branch
    git checkout -b feature/your-feature-name
  3. Make Your Changes
  4. Test Thoroughly
  5. Commit Your Changes
    git commit -m "Add: your feature description"
  6. Push to Your Fork
    git push origin feature/your-feature-name
  7. Create a Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Use Tailwind CSS for styling
  • Write descriptive commit messages
  • Test on multiple browsers
  • Update documentation as needed

๐Ÿ“„ License

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


๐Ÿ‘ฅ Team

  • Ritya Godala - Project Lead & Developer
  • Contributors - [Add your name here]

๐Ÿ™ Acknowledgments

  • Energy Star - Product database and efficiency ratings
  • OCR.space - OCR API service
  • ElevenLabs - Natural text-to-speech
  • EIA & FERC - Utility rate data
  • EPA EGRID - Carbon intensity data
  • Next.js Team - Amazing framework
  • Vercel - Deployment platform

๐Ÿ“š Resources

Documentation

Project Documentation

External Links


Made with โค๏ธ for sustainable energy decisions

Report Bug โ€ข Request Feature โ€ข Documentation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors