SmartPantry Shopping Tab

Implementation Plan & Feasibility Assessment

Feasibility
UI Preview
Admin Dashboard
Data Structure
Timeline
Risks

1 API & Data Sources

Component Provider Cost Status
Product Images Open Food Facts FREE Feasible
Price Search Brave Search API FREE (2,000/mo) Feasible
Price Cache Firebase Firestore Existing Plan Already in place
Direct Links Supermarket URLs FREE Always works

2 Usage Calculation

Scenario API Calls/Month Within Free Tier?
100 users x 5 ingredients x 3 stores 1,500 (first month) Yes
With 7-day cache (repeat searches) 300-500 ongoing Yes
Growth to 500 users 800-1,200 Yes
Growth to 1,000+ users 1,500-2,000 Near limit

Verdict: Feasible for MVP and early growth. Paid tier (~$4/1000 searches) available if needed.

3 Cost Summary

Open Food Facts (Images) $0/month
Brave Search API (2,000 searches) $0/month
Firebase (existing plan) $0 additional
Direct supermarket links $0/month
TOTAL $0/month

UI Shopping Tab Mockup

Smoked Mackerel

[Product Image from Open Food Facts]

Prices (as of 7 Jan 2026):

Waitrose
$3.50
View on site
Sainsbury's
$3.00
View on site
Aldi
CHEAPEST
$2.49
View on site

Prices may have changed. Click to verify on supermarket site.

How How It Works

User clicks ingredient

Opens the ingredient details modal

Switches to "Shopping" tab

Triggers price lookup

Check cache first

If cached within 7 days, show instantly

API call if needed

Brave Search for prices, Open Food Facts for image

Display with links

User can verify prices on supermarket sites

API & External Services

API API Usage Monitor

BRAVE SEARCH API USAGE

This Month: 1,247 / 2,000 (62%)

Cache Hit Rate: 78%
Projected End of Month: ~1,800 calls

Alert threshold: 80% (1,600 calls)

Users User Statistics

USER STATISTICS

Total Users: 342
Active This Week: 127 (37%)
New This Month: +23

Households: 89
Avg Members/Household: 2.4

Stats Feature Engagement

FEATURE ENGAGEMENT

Shopping Tab Views: 1,892 this month
Price Lookups: 847
"View on Site" Clicks: 423 (50%)

Most Searched Ingredients:
1. Chicken Breast (67)
2. Smoked Salmon (45)
3. Olive Oil (38)

Preferred Supermarkets:
Tesco 34% | Sainsbury's 28% | Aldi 22%

Cache Price Cache Status

PRICE CACHE

Cached Products: 456
Cache Size: 2.3 MB
Oldest Entry: 6 days ago
Expiring Today: 12 items

[Clear Cache] [Export Data] [View All]

AI / Gemini Analytics

AI Gemini API Usage

GEMINI API USAGE

API Calls This Month: 3,847

Token Usage:
Input Tokens: 1.2M
Output Tokens: 890K
Est. Cost: $0.00 (free tier)

Avg Response Time: 1.8s
Error Rate: 0.3%

Features AI Feature Breakdown

AI FEATURE USAGE

By Feature:
Recipe Generation: 1,245 (32%)
Meal Planning: 892 (23%)
What Can I Cook: 756 (20%)
Pantry Analysis: 534 (14%)
Shopping Suggestions: 420 (11%)

Most Active Hour: 6-7 PM

OCR Receipt Scanning

RECEIPT SCANNING

Scans This Month: 234
Success Rate: 94%
Avg Items/Receipt: 12.3

Common Issues:
Blurry images: 8
Unrecognized format: 6

Content Content Generation

CONTENT GENERATED

Recipes Created: 567
Meal Plans Generated: 234
Shopping Lists (AI): 189

Popular Recipe Types:
1. Quick Dinners (34%)
2. Healthy Options (28%)
3. Budget Meals (22%)

Firebase & Infrastructure

DB Firebase Usage

FIREBASE FIRESTORE

This Month:
Document Reads: 45,230
Document Writes: 8,934
Document Deletes: 1,245

Storage Used: 12.4 MB
Est. Cost: $0.00 (free tier)

Limits (Spark Plan):
Reads: 45K/50K (90%) !

Auth Authentication

FIREBASE AUTH

Total Registered: 342

Sign-in Methods:
Google: 287 (84%)
Email/Password: 55 (16%)

Context Usage:
Personal Mode: 253 (74%)
Household Mode: 89 (26%)

Time Peak Usage

USAGE PATTERNS

Peak Hours (UTC):
1. 18:00-19:00 highest
2. 12:00-13:00
3. 08:00-09:00

Peak Days:
Sunday: 18%
Saturday: 16%

Avg Session: 4.2 min

Sync Real-time Sync

SYNC ACTIVITY

Active Listeners: 47
Sync Events/Hour: 234

Multi-device Users:
2 devices: 89
3+ devices: 23

Sync Conflicts: 2 this week

DB Firebase Collections

// Admin analytics collection /admin/apiUsage { braveSearchCalls: 1247, lastReset: "2026-01-01", dailyUsage: { "2026-01-14": 45, "2026-01-13": 52, ... }, cacheHits: 4532, cacheMisses: 1247 } // Price cache collection /priceCache/{ingredientKey} { ingredient: "smoked mackerel", prices: { waitrose: { price: "$3.50", url: "...", fetchedAt: timestamp }, sainsburys: { price: "$3.00", url: "...", fetchedAt: timestamp }, tesco: { price: "$2.89", url: "...", fetchedAt: timestamp } }, image: "https://images.openfoodfacts.org/...", lastUpdated: timestamp, searchCount: 23 } // Feature analytics /analytics/features { shoppingTabViews: 1892, priceLookups: { total: 847, byIngredient: {...} }, viewOnSiteClicks: { total: 423, byStore: {...} }, topIngredients: [...], topStores: [...] } // Gemini AI analytics /admin/geminiUsage { callsThisMonth: 3847, inputTokens: 1200000, outputTokens: 890000, byFeature: { recipeGeneration: 1245, mealPlanning: 892, whatCanICook: 756, pantryAnalysis: 534, shoppingSuggestions: 420 }, avgResponseTimeMs: 1800, errorCount: 12, lastReset: "2026-01-01" } // Receipt scanning analytics /admin/receiptScanning { scansThisMonth: 234, successfulScans: 220, avgItemsPerReceipt: 12.3, failureReasons: { blurryImage: 8, unrecognizedFormat: 6 } } // User activity tracking /admin/userActivity { dailyActiveUsers: { "2026-01-14": 127, ... }, peakHours: [18, 12, 8], avgSessionMinutes: 4.2, contextUsage: { personal: 253, household: 89 } }

1 Phase 1: Foundation (Week 1)

TaskPriorityEffort
Set up Brave Search API accountHigh30 min
Create Firebase price cache collectionHigh1 hour
Build cache read/write functionsHigh2 hours
Test Open Food Facts image fetchingMedium1 hour

2 Phase 2: Shopping Tab UI (Week 1-2)

TaskPriorityEffort
Add "Shopping" tab to ingredient modalHigh2 hours
Display cached prices with datesHigh2 hours
Add direct supermarket linksHigh1 hour
Add "price may have changed" disclaimerMedium30 min
Mobile-responsive designMedium1 hour

3 Phase 3: Admin Dashboard (Week 2-3)

TaskPriorityEffort
Create admin authentication checkHigh1 hour
Build API usage monitor panelHigh3 hours
Build user statistics panelHigh2 hours
Build feature analytics panelMedium3 hours
Build cache management panelMedium2 hours
Add alert system (email/in-app)Low2 hours

4 Phase 4: Analytics Integration (Week 3)

TaskPriorityEffort
Track Shopping tab viewsMedium1 hour
Track price lookups per ingredientMedium1 hour
Track "View on Site" clicksMedium1 hour
Generate weekly reportsLow2 hours

! Risk Mitigation

RiskMitigation Strategy
API limit reached Alert at 80%, fallback to direct links only
Brave Search changes pricing Architecture supports swapping to Google/Serper
Open Food Facts missing images Fallback to placeholder or Google Images link
Firebase costs increase Cache TTL adjustable, can reduce storage

OK Final Assessment

AspectAssessment
Technical Feasibility Fully feasible
Cost $0/month (free tiers sufficient)
Scalability Caching makes it scale-friendly
User Value High - prices + images in-app
Admin Visibility Full dashboard with analytics
Timeline 2-3 weeks for full implementation