DukaanIQ
Your Shop. Your Language. Your Voice
The problem DukaanIQ solves
Here is a clean, submission-ready Idea Description in Markdown for DukaanIQ:
DukaanIQ — Your Shop. Your Language. Your Voice.
The Problem
India's 12+ million neighborhood kirana stores run on fast, informal, multilingual conversations — mixing English, Hindi, Bengali, Hinglish, and Benglish — yet most retail software is built around complex English-only forms, manual barcode typing, and desktop-first workflows. As a result, shopkeepers still rely on paper kaccha ledgers, lose money to unnoticed wholesale price hikes and expiring stock, miss out on better wholesaler deals, and struggle to track daily udhar (credit) and UPI collections.
Our Solution
DukaanIQ is a voice-first, bilingual Kirana Shop Operating System & B2B Dealer Network that lets shopkeepers run their entire store simply by speaking or snapping a photo in their own language.
Key Capabilities
- 5-Language Voice & AI Intelligence Hub (
Qwen4-Max+Gemini 2.5 Flash+ Fast Parser):- Speak or type naturally in English, हिन्दी, বাংলা, Hinglish, or Benglish.
- Live speech streaming auto-sends queries and speaks answers back aloud (Google-Assistant style), with a 10-second Undo window and explicit confirmation cards before any financial write.
- Smart Bill Scanner (Live Back/Front Camera + Upload OCR):
- Snap a photo of handwritten wholesale parchis or upload distributor GST invoices to extract items, quantities, cost/unit, and retail prices into editable rows, then stock inventory and update the ledger in one tap.
- Voice Udhar & Khata:
- Record customer credit by voice ("Rahim ko 250 rupaye udhar likho"), send 1-tap WhatsApp UPI payment reminders, record repayments, and manage or remove customer entries cleanly.
- Expiry Rescue & Barcode/Expiry OCR:
- Scan product barcodes and expiry labels using the device's back camera, track batches early, and generate BOGO or clearance discount offers before stock expires.
- Nearby Suppliers & Fair Wholesale Offer Comparison:
- Discover nearby wholesalers by GPS, area, or PIN code and compare true landed cost using
Net Cost = (Qty × Rate) − Supplier Offer Discount + Delivery Charge, with 1-tap restock orders.
- Discover nearby wholesalers by GPS, area, or PIN code and compare true landed cost using
- Live UPI Soundbox & Hisab-Kitab Ledger:
- Real-time cash/UPI/udhar ledger with CSV export, daily profit/loss alerts, missed-demand tracking, and a live Soundbox that announces today's actual UPI collections in the shopkeeper's chosen language.
- B2B Dealer Portal:
- Dedicated portal for wholesale distributors to manage incoming kirana restock requests, update SKU stock and wholesale rates, broadcast price-drop alerts, and connect with nearby shops.
Tech Stack
- Frontend: Responsive HTML/Tailwind CSS/JavaScript (mobile drawer + desktop workspace) deployed on Vercel
- Backend: FastAPI (Python, Controller → Service → Repository architecture) + Alembic migrations deployed via Docker on Railway
- Database: PostgreSQL (Railway) in production / SQLite locally with multi-tenant
shop_idisolation - AI & Vision: Qwen4-Max (primary intent & Q&A), Gemini 2.5 Flash (Vision OCR, audio transcription & fallback), plus a deterministic 5-language offline parser & Browser Web Speech API (
SpeechRecognition+SpeechSynthesis)
Challenges we ran into
Here is a ready-to-use Challenges we ran into section in Markdown, based directly on the real bugs and engineering hurdles we solved while building DukaanIQ:
Challenges We Ran Into
1. Multilingual NLP & Number-Word Collisions Across 5 Indian Languages
- The Hurdle: Supporting English, Hindi (Devanagari), Bengali, Hinglish, and Benglish meant everyday retail speech frequently collided with parser rules. For example, the Hindi verb "do" (meaning "please give") was misparsed as the number
2, standard\bregex word boundaries failed on Devanagari and Bengali scripts (राहुल ने,রহিম ২০০), and conversational filler phrases ("Ek customer Dove Shampoo mang raha tha par stock mein nahi tha") leaked into extracted product names. - How We Got Over It: We added context-aware lookahead checks in
backend/app/utils/number_words.py(only converting"do"when followed by a unit, multiplier, or currency), replaced\bboundaries with Unicode-safe(?=\s|$)lookaheads and script-aware name extractors inbackend/app/integrations/gemini.py, and validated the full pipeline with a 14,874-question stress test (100% pass) alongsidepytest.
2. SQLite vs. PostgreSQL Migration Dialect Mismatch on Railway
- The Hurdle: Local development ran smoothly on SQLite (
dukaaniq.db), which silently accepts integer defaults (1/0) for boolean columns. When deploying to Railway Managed PostgreSQL, Alembic migration44615e3beb4dcrashed with:
column "delivery_available" is of type boolean but default expression is of type integer(ALTER TABLE sellers ADD COLUMN delivery_available BOOLEAN DEFAULT 1 NOT NULL). Additionally, Railway injectsDATABASE_URLwith apostgres://prefix, which SQLAlchemy withpsycopgrejects. - How We Got Over It: We added a Pydantic
field_validatorinbackend/app/core/config.pyto normalizepostgres://andpostgresql://topostgresql+psycopg://, audited all 5 Alembic migrations, updateddelivery_available,is_verified, andis_demoto use PostgreSQL-safesa.text('true')/sa.text('false')(andserver_default=text("true")/text("false")inmodels.py), and verified the generated DDL usingalembic upgrade head --sql.
3. Vercel Monorepo Framework Auto-Detection (FASTAPI_ENTRYPOINT_NOT_FOUND)
- The Hurdle: Because the repository contains both the static
frontend/and the FastAPIbackend/(withrequirements.txt), Vercel auto-detectedfastapiand failed frontend deployments looking for a Python entrypoint. - How We Got Over It: We explicitly disabled framework auto-detection with
"framework": null,"buildCommand": "", and"outputDirectory": "frontend"invercel.json(plus a dedicatedfrontend/vercel.json) so Vercel cleanly serves the static frontend while Railway hosts the FastAPI container.
4. Making Browser Voice Assistant & Bill OCR Reliable for Live Demos
- The Hurdle: Initially, clicking the mic didn't stream live interim words or auto-send/auto-speak like a real voice assistant;
SpeechSynthesistripped on emojis and₹symbols inhi-IN/bn-INvoices; the Soundbox had a hardcoded₹250announcement; and when the frontend ran standalone without a connected backend URL, pages spammed"Request failed"toasts and repeated a generic"DukaanIQ shop data sync kar raha hai"message. - How We Got Over It: We built
prepareTextForSpeech()andresolveTtsLocale()for clear 5-language TTS, wired the Soundbox to liveupi_today_paisefrom/api/v1/dashboard/summary, upgradedtoggleVoiceInput()andrecordVoiceKhata()to streaminterimResultswith auto-send + auto-speak (and/api/v1/voice/transcribefallback), added live Back/Front camera capture + client-side OCR fallback for any uploaded grocery bill, replaced all browseralert()/prompt()/confirm()dialogs with keyboard-accessible in-app modals, and added a 5-languageproject_knowledge.py+ demo fallback inexpiry-supplier-workflow.js.
5. AI Safety, Prompt Injection & Offline Latency Stalls
- The Hurdle: Unfiltered inputs allowed prompt-injection strings to trigger
ADD_UDHARdrafts, contradictory payment modes ("cash sale on credit") weren't caught, raw user text risked XSS in chat bubbles, and default retries on the Qwen client caused ~2.7s stalls when offline. - How We Got Over It: We added pre-intent security, empty-input, and contradictory-payment guards in
gemini.pyandvoice_service.py, addedescHtml()XSS sanitization inshopkeeper.html, enforced explicit confirmation cards with a 10-second Undo window before financial writes, and configuredmax_retries=0, timeout=6.0on the Qwen client so deterministic fallbacks respond in milliseconds.