ai newsMo., 19. Okt.
EilmeldungMy LLM chat API taught me that '50+ models' is a maintenance tax, not a feature

CartPulse: Building an In-Store AI Budget Guardian That Shoppers Would Actually Pay For

🛒 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 me

dev.toMontag 00:39 · 19.10.5 Min. Lesezeit
Bild: dev.to

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission 💸

Built for the Hacktoberfest 2026 Open-Source AI Challenge: Week 2 ("Side Hustle").

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.

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.

We designed CartPulse with two distinct, viable revenue paths:

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:

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.

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:

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.

In retail, hallucinating a price or miscalculating a budget total destroys user trust immediately. CartPulse strictly separates financial math from natural language reasoning:

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 ₦ ).

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 Pause)"] 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 1. 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.

Visible on every screen once checked in:

Accessible from bottom navigation, persistent header, or floating action button (FAB):

We built a comprehensive automated test suite with Vitest to guarantee mathematical correctness, state consistency, and AI reasoning reliability:

✓ tests/calculations.test.ts (8 tests) • Calculates item subtotals correctly • Computes cart total and total units • Accurately measures remaining budget and overage amounts • Validates 80% warning and 100% danger status triggers • Simulates purchase impact before adding items • Formats currency with Nigerian Naira (₦) ✓ tests/store.test.ts (6 tests) • Adds products and increments quantities • Updates item quantities and removes when zero • Supports item removal with undo restoration • Manages budget and store configuration • Deduplicates recent search history • Ticks simulated camera pause countdown ✓ tests/ai-intelligence.test.ts (6 tests) • Matches product keywords from natural queries • Evaluates affordability within remaining budget accurately • Identifies cheaper catalogue alternatives • Prioritizes purchases and suggests non-essential removals when over budget • Generates pre-checkout executive summary • Generates AI responses without price hallucinations ✓ tests/scan-flow.test.ts (4 tests) • Sets store on check-in and resets session state • Selects random demonstration product for mock scanning • Rejects product scan and pauses camera for 5 seconds • Manages reality check modal and transitions to checkout summary ✓ tests/catalogue.test.ts (4 tests) • Validates 21 items with unique IDs, barcodes, and positive prices • Searches catalogue by query and category filter Test Files: 5 passed (5) Tests: 28 passed (28) Pass Rate: 100% Enter fullscreen mode Exit fullscreen mode 🛠️ 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: git clone https://github.com/kayode96-max/cart.git cd cart Enter fullscreen mode Exit fullscreen mode Install dependencies: npm install Enter fullscreen mode Exit fullscreen mode Run automated tests: npm test Enter fullscreen mode Exit fullscreen mode Start the local server: npm run dev Enter fullscreen mode Exit fullscreen mode 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.

Quelle: dev.to (dev.to). Original öffnen