#
🛒 CartPulse: Building an In-Store AI Budget Guardian That Shoppers Would Actually Pay For
Built for the Hacktoberfest 2026 Open-Source AI Challenge: Week 2 ("Side Hustle").
#
💡 The Side Hustle: What We Built & Who Would Pay For It
Every weekend, millions of shoppers walk into supermarkets with a mental spending limit—say, ₦15,000 or $50—and walk out stunned at the register after spending 30% more than planned.
The reasons are universal:
- Product prices are scattered across aisles and easily forgotten while walking the store.
- Mental math deteriorates after 20 minutes of navigating fluorescent-lit aisles.
- Impulse additions quietly push the basket over the budget limit.
- When shoppers finally reach the cashier, returning embarrassing unscanned items causes delays and frustration for everyone in line.
CartPulse is an in-store shopping companion web application that puts a financial guardian in the shopper's pocket. It combines instant barcode scanning, predictive product search, live cart state tracking, dynamic budget metering, and an open-weight AI shopping assistant that actively prevents overspending before reaching checkout.
Who Would Pay For This?
We designed CartPulse with two distinct, viable revenue paths:
- Direct-to-Consumer (B2C Freemium / $3.99/mo)
Target Audience: College students on tight allowances, single professionals managing strict weekly grocery limits, and families balancing household budgets amidst inflation. #
Value Proposition: If CartPulse saves a family ₦5,000–₦15,000 ($10–$30) per shopping trip by highlighting cheaper catalogue substitutes and flagging impulse creep, paying a modest subscription or tip is an immediate positive ROI. #
Premium Features: Multi-store loyalty catalogue sync, nutritional goal balancing, household shared lists, and receipt export.
- Retailer White-Label License (B2B SaaS / Store Partnership)
Target Audience: Supermarket chains (such as Shoprite, Spar, and regional grocery outlets). #
Value Proposition: Checkout bottleneck reduction. CartPulse generates an encrypted express checkout QR code summarizing verified items. Retailers accelerate checkout lane throughput by up to 40%, lower cashier staffing overhead during peak hours, and drastically reduce abandoned cart restock labor.
#
🧠 Why Open Innovation Matters for What We Built
The Hacktoberfest Week 2 prompt asked builders: Tell us why open innovation matters for what you built.
For CartPulse, open-weight AI is not an optional marketing badge—it is the structural reason the business model works:
- Zero Per-Query API Fees Makes the Unit Economics Work
If you build a shopping assistant with a proprietary closed API (e.g., OpenAI or Claude), every shopper scanning 20 items and asking 5 budget questions burns through dozens of token calls. At thousands of daily users, API bills completely destroy the margins of a lean consumer side hustle.
By running Qwen 2.5 0.5B Instruct (under an Apache 2.0 license) locally in the browser via WebGPU / ONNX, inference costs exactly $0.00 per scan. The business stays profitable from day one.
- Absolute Customer Privacy of Food & Expense Data
What a shopper buys, what brand of medicine or cereal they pick, and how much cash they have left in their bank account is intimate personal data. Proprietary cloud LLMs route user queries through remote server farms and data brokers. With CartPulse:
- Zero shopping cart data ever leaves the user's device.
- All session states, budget thresholds, and item tallies live locally in browser storage.
- Supermarket Aisle Offline Resilience
Physical supermarkets are notorious Faraday cages. Thick concrete walls and metal shelving frequently kill cellular signals in Aisle 4. Because CartPulse pairs local open weights with a deterministic in-browser intelligence engine, shoppers get instant answers even when cellular bars drop to zero.
- Zero Hallucinations: Deterministic Financial Accuracy
In retail, hallucinating a price or miscalculating a budget total destroys user trust immediately. CartPulse strictly separates financial math from natural language reasoning:
All monetary calculations (totals, subtotals, remaining budget, overage, percentages) are computed by deterministic, pure TypeScript functions.
- The open model receives structured application context and explains trade-offs, compares items, and suggests actions, but never invents fictional prices or products .
- Localization for Regional Supermarkets
Because the model weights are open, future iterations can easily be adapted for regional supermarkets across Africa, Europe, and Asia, understanding local brand colloquialisms (e.g., Nigerian pantry staples like Maggi Star Cubes, Peak Milk, Indomie, Golden Penny Spaghetti, and Dangote Sugar in Nigerian Naira ₦).
#
🏛️ System Architecture
flowchart TD
subgraph Client ["Client Device (Mobile Browser / PWA)"]
UI["Next.js 14 Mobile-First Interface\\n(Space Grotesk + Plus Jakarta Sans)"]
ZStore[("Zustand Local Store\\n• Budget: ₦15,000\\n• Cart Items\\n• Active Store\\n• Recent Searches")]
UI <--> ZStore
end
subgraph ScannerEngine ["In-Store Barcode & Search Gateway"]
Cam["Viewfinder & Real Camera (getUserMedia)"]
Toast["Scan Confirmation Toast\\n(3s Auto-Add / 5s Reject )"]
Search["Predictive Search Engine\\n(Aisles 1-6 • Category Filtering)"]
Cam --> Toast --> ZStore
Search --> ZStore
end
subgraph DeterministicMath ["Deterministic Financial Engine"]
M1["calculateCartTotal()"]
M2["calculateRemainingBudget()"]
M3["getBudgetStatus() (<80%, 80-99%, ≥100%)"]
M4["simulatePurchaseImpact()"]
ZStore <--> M1 & M2 & M3 & M4
end
subgraph AIEngine ["CartPulse Open AI Layer"]
Qwen["Qwen 2.5 0.5B Instruct\\n(Apache 2.0 • Local In-Browser Inference)"]
Adapter["CartPulseAIAdapter"]
Tools["Recommendation Tools\\n• checkAffordability()\\n• findCartAlternatives()\\n• prioritizeCartItems()\\n• generatePreCheckoutSummary()"]
Adapter <--> Qwen
Adapter <--> Tools
Tools <--> DeterministicMath
ZStore <--> Adapter
end
subgraph CheckoutGate ["Express Gate Checkout"]
Modal["Reality Check Verification Modal"]
QR["SVG QR Matrix Session Generator\\n(Prototype Reference Token)"]
UI --> Modal --> QR
end
#
📱 User Experience & Key Features
- Screen 0: Store Check-In
Shoppers scan the entrance QR code or pick a geo-fenced branch preset (Shoprite Ikeja City Mall, Shoprite Minna, or Spar Victoria Island). Live pricing and aisle maps synchronize immediately with a pulsating laser reticle.
- Persistent Dynamic Shopping Header
Visible on every screen once checked in:
- Active store indicator and live shopping bag unit counter.
- Running totals:
Total: ₦[cartTotal]andBudget: ₦[budget](with 1-click inline budget editing).
Dynamic 3-Tier Budget Progress Bar : - < 80%: Electric emerald positive progress. #
80%–99%: Amber warning badge with remaining funds reminder. #
≥ 100%: Red danger alert displaying exact excess amount (₦X over budget! ).
- Screen 1: Camera Scanner & 3-Second Confirmation Toast
- Dual-mode viewfinder: supports real camera stream via
getUserMediaor high-fidelity simulated supermarket aisle. - Torch toggle with illumination beam effect.
Floating Scan Confirmation Toast : When a barcode is scanned, a compact card appears displaying the product photo, name, and emerald price. A 3-second animated timeout bar counts down—if not rejected, the item is auto-added with an audio synthesizer beep. PressingReject cancels the addition and s scanning for 5 seconds to prevent accidental duplicates.
- Screen 2: Predictive Product Search
- Sub-millisecond instant filtering across 21 everyday grocery staples.
- Category carousel: Seasoning & Spices ,Dairy & Breakfast ,Pasta & Grains ,Household & Pantry ,Bakery & Fresh ,Snacks & Beverages .
Budget Pacing Card : Live indicator showing available funds and whether the shopper is within limit.
- 1-tap circular
+addition buttons.
- Screen 3: Live Cart Dashboard
- Full itemized basket with micro-steppers (
-/+), individual subtotals, and SKU tags. - Accessible item removal with an instant Undo notification banner .
- "Review my budget with AI" call-to-action button.
- Pinned bottom checkout bar with "Finish Shopping" trigger.
- Screen 4 & 5: Reality Check & Checkout QR Code
Reality Check Modal : Displays an animated amber warning ping:"Does your physical cart match your digital list exactly? Unscanned items will cause delays at the checkout." #
Checkout Confirmation : Generates a high-contrast, self-contained SVG QR code matrix encoding a safe demonstration checkout reference token, accompanied by an itemized grocery breakdown.
- Smart Shopping Assistant Panel
Accessible from bottom navigation, persistent header, or floating action button (FAB):
- Displays the Qwen 2.5 0.5B • Apache 2.0 • Local In-Browser Inference badge.
- Instant suggested question chips:
- "Can I still afford milk and bread?"
- "What can I remove to stay within my budget?"
- "Find cheaper alternatives to the products in my cart."
- "Which items should I prioritize?"
- "Summarize my shopping so far."
Interactive Actionable Recommendation Cards : When the assistant suggests cheaper substitutes (e.g. switching Peak Powdered Milk ₦3,100 to Dano Full Cream ₦2,400 to save ₦700), it presents a 1-tapSwitch orAdd button that directly modifies the live cart!
#
🧪 Automated Test Suite
We built a comprehensive automated test suite with Vitest to guarantee mathematical correctness, state consistency, and AI reasoning reliability:
#
🛠️ Tech Stack
Framework: Next.js 14 (App Router) #
Language: TypeScript 5 (Strict Mode) #
Styling: Tailwind CSS 3 (CartPulse Dark Precision Engineering Design System) #
Typography: Space Grotesk (Headlines, Numerics, Tabular Figures) & Plus Jakarta Sans (Body) #
State Management: Zustand with safe local storage persistence & SSR hydration handling #
Audio Feedback: Web Audio API synthesizer #
Testing: Vitest #
License: Apache 2.0
#
🛒 Try It Out
Clone the repository:
Install dependencies:
Run automated tests:
Start the local server:
Open http://localhost:3000 in your mobile browser or desktop browser!
CartPulse proves that open-source AI is not just for cloud researchers—it's the foundation for real, privacy-first side hustles that solve everyday human problems.