Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📒 उधार खाता (Udhaar Khata)

Voice-Powered Digital Ledger for Father with 100% Local Open-Weights AI

Built with ❤️ for my father for the Hacktoberfest Weekend Challenge: Build for a Friend
Entering Prize Category: Best Use of Gemma (Featured Category)


🎯 The Inspiration: Why I Built This For My Father

My father runs a local neighbourhood store in India. Like millions of small business owners and community elders, managing daily credit (udhaar) is a constant headache. Customers frequently buy items on credit and repay later in installments.

My father used to write these transactions down in dog-eared paper notebooks (bahi khata). Typing on smartphone keyboards is clumsy, especially when hands are busy with store merchandise and customers are waiting in line. Existing digital bookkeeping apps are bloated, littered with advertisements, in English-first terminology, and store sensitive financial records on third-party cloud servers.

Udhaar Khata changes this completely.
My father simply presses the big mic button and speaks naturally in Hindi or Hinglish:

  • "Ramesh ne 200 udhaar liya" (Ramesh took ₹200 on credit)
  • "Sunita ne 500 wapas kiye" (Sunita repaid ₹500)
  • "Sharma ji ko 1200 ka ration udhaar diya" (Sharma ji bought ₹1200 ration on credit)
  • "Mukesh ne 450 jama karwaye" (Mukesh deposited ₹450)

The app transcribes the audio, extracts structured ledger entries using Google Gemma 2 (2B), displays a clean confirmation card, updates the customer's balance sheet, and even drafts polite Hindi payment reminders with 1-click WhatsApp messaging!


🌟 Key Features

  1. 🎙️ Natural Voice Accounting (आवाज़ से हिसाब)

    • Speak colloquial Hindi or Hinglish with zero typing needed.
    • Dual speech recognition: Open-weight OpenAI Whisper (faster-whisper) + browser Web Speech API.
  2. 🧠 Open-Weights Intelligence (Google Gemma 2 2B)

    • Extracts customer name, rupee amount, transaction direction (udhaar vs jama), and items/notes.
    • 100% local inference on Apple Silicon / CPU via Ollama with sub-second latency.
    • Resilient hybrid architecture with sub-millisecond local Indic NLP fallback.
  3. ✅ Interactive Confirmation Card (पुष्टि करें)

    • Shows detected details before committing to the ledger.
    • Father can review, adjust, or listen to voice feedback before saving.
    • Celebratory micro-interactions (confetti animation).
  4. 📊 Real-time Balance Sheet (खाता बही)

    • Instantly tracks who owes what:
      • 🔴 लेना है (To Collect / Debtors)
      • 🟢 हिसाब चुकता (Settled Accounts)
    • Comprehensive customer statement drawer with chronological transaction timeline.
  5. 💬 Culturally Respectful Hindi Payment Reminders (तगादा / तकाज़ा)

    • Asking for money can be socially uncomfortable. The app drafts reminders in 4 distinct tones:
      • विनम्र (Polite & Respectful)
      • मित्रतापूर्ण (Friendly & Casual)
      • व्यावसायिक (Formal Business Notice)
      • Gemma 2 AI Custom Draft (e.g. "Tell them distributor payment is due tomorrow")
    • 1-click WhatsApp Share (https://wa.me/...) with pre-filled message + 1-click Copy.
  6. ⚡ 1-Click "Hisaab Chukta" (Account Settlement)

    • Clear entire balance with a single click.
  7. 📥 Export & Print Statements

    • Download complete ledger as CSV or print customer statement.
  8. 🌐 Full Bilingual Support

    • Instant toggle between हिंदी (Hindi), Hinglish, and English.

🛡️ Why Open Innovation Matters Here

Requirement Closed APIs (e.g. OpenAI / Claude) Our Open-Weights Stack (Gemma 2 + Whisper)
Privacy & Financial Sovereignty Ledger data & phone numbers sent to third-party servers 100% On-Device: Financial records never leave father's laptop
Offline Reliability Fails completely whenever shop Wi-Fi or mobile data drops Always Works: 0% dependence on internet connectivity
Operating Cost Metered token fees & recurring monthly subscriptions ₹0 Forever: Free execution on consumer hardware
Colloquial Hinglish Adaptation Generic responses; strict safety guardrails on money phrasing Tailored Prompts: Understands rokda, chukta, baaki, saman

🏗️ Architecture & Technology Stack

[ Father Speaks in Hindi/Hinglish ]
              │
              ▼
   [ Open-Weight Whisper STT ] ──── (Local speech transcription)
              │
              ▼
    [ Google Gemma 2 2B ]     ──── (Local Ollama inference / Metal acceleration)
              │
              ▼
   [ Structured Ledger JSON ] ──── (Customer Name, Amount, Type, Note)
              │
              ▼
   [ Confirmation Modal ]     ──── (Father reviews & confirms)
              │
              ▼
  [ SQLite Local Database ]   ──── (100% private, local storage)
              │
              ▼
 [ 1-Click WhatsApp Reminders ] ── (Polite Hindi reminders generated by Gemma 2)
  • LLM: Google Gemma 2 2B (gemma2:2b) running via Ollama.
  • STT: OpenAI Whisper (faster-whisper tiny/base) running locally on CPU/Metal.
  • Backend: Python 3.10 + FastAPI + SQLite.
  • Frontend: React 19 + Vite + Vanilla CSS design system.
  • Typography: Google Fonts (Plus Jakarta Sans & Noto Sans Devanagari).

🚀 Quickstart Guide

1. Prerequisites

  • Mac, Linux, or Windows with Python 3.10+ and Node.js 18+.
  • Ollama installed.

2. Pull the Open-Weights Model

ollama pull gemma2:2b

3. Setup Backend

python3 -m venv backend/venv
source backend/venv/bin/activate
pip install -r backend/requirements.txt

# Start backend server (runs on http://localhost:8000)
PYTHONPATH=backend python -m uvicorn main:app --host 0.0.0.0 --port 8000

4. Setup Frontend

cd frontend
npm install
npm run dev
# Open http://localhost:5173 in browser

🏆 Hacktoberfest DEV Submission

  • Agent Session: Embed via DevRelay tag {% agent_session building-udhaar-khata-voice-ai-digital-ledger-for-father-using-local-gemma-2-and-whisper-iaj7jh %}
  • Challenge: Hacktoberfest Weekend Challenge: Build for a Friend
  • Prize Category: Best Use of Gemma ($200 Featured Category)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages