Your Business. Your Hisab.
An intelligent, lightning-fast financial ledger and AI-powered expense notebook crafted for Indian small businesses, freelancers, and smart spenders.
UI Showcase β’ Features β’ Avatars β’ Merchants β’ Architecture β’ NLP Engine β’ Quickstart β’ Security β’ Roadmap
Hisab AI transforms the way Indian shopkeepers, MSMEs, contractors, and individuals manage their daily cash flow and credit accounts (Bahi-Khata).
Instead of tedious multi-step form entry, Hisab lets you type or speak naturally β like 500 diesel, Ramesh 500, or Sent 1200 to Sharma Hardware for cement β and instantly categorizes the transaction, infers incoming vs. outgoing flow, matches contacts, and keeps running balances accurate to the paisa.
Equipped with Google Gemini 2.0 Flash Vision AI, Hisab also scans printed receipts, grocery slips, and handwritten physical ledger notes, converting them into structured accounting entries in seconds.
β¨ Home & Natural Input
|
π Business Insights
|
π Transaction Ledger
|
π Onboarding Flow
|
βοΈ Settings & Theme Hub
|
πΌ Personalized Setup
|
- 3-Way Parsing Mode Switch (Settings β Parsing Engine):
- β‘ Local: Instant on-device NLP parser running in <2ms with phonetic speech-to-text mishearing normalization (
sent β saint,kal β call,maal β mall). 100% offline-ready. - π§ Smart Auto: Fast local parser runs first; if confidence is low or complex sentence structures are detected, it seamlessly escalates to Gemini 2.0 Flash AI.
- π€ Always AI: Routes every entry through Gemini 2.0 Flash for maximum contextual and semantic extraction.
- β‘ Local: Instant on-device NLP parser running in <2ms with phonetic speech-to-text mishearing normalization (
- Resilient, Non-Blocking UX: Displays an animated "Thinkingβ¦" state with a Cancel button while the AI call is in flight. Silently and instantly falls back to the local parser on any timeout, offline state, or quota exhaustion β user entry is never blocked.
- Dedicated Daily Quotas: Built-in free tier with 25 AI text parses/day (independent of the 3/day receipt scan quota), or unlimited usage by entering your own free Gemini API key in Settings.
- Provenance & AI Tagging: Entries parsed by Gemini are tagged
source: "ai_text"and display a distinctive "AI parsed" badge in the Transaction Detail Sheet.
- Tap the microphone and speak your transaction in Hinglish or English.
- Real-time transcription via Web Speech API with instantaneous parsing directly into the ledger.
- Receipt & Invoice Scanner: Point your camera at thermal paper slips, invoices, or grocery bills.
- Handwritten Khata Reader: Reads handwritten dairy pages and bahi-khata notebooks.
- Multi-Item Extraction: Breaks down bundled receipts into categorized sub-entries with vendor association and user-provided API key quota controls.
- Khata Directionality: Strict accounting conventions β clearly monitors "You owe" vs. "They owe you".
- Entity Relationship Tagging: Organize contacts by
Customer,Supplier,Employee,Partner,Freelancer, orPersonal. - Nickname & Alias System: Attach nicknames (e.g. "Pappu", "Hardware Shop") so the parser always resolves the right person.
- One-Tap Settle Up: Seamless debt reconciliation with auto-generated settlement records.
- Multi-Period Filters: Filter instantly by
Today,This Week,This Month,Last Month,This Year, orAll Time. - Visual Category Donut: Interactive breakdown of your highest spending categories.
- Daily Spending Trend Charts: Clean SVG visualization of daily cash flow.
- Auto-Generated Financial Health Cards: Contextual warnings on spike spending, highest-debt customers, and cash vs. digital split.
- Installable on Any Device: Native standalone experience on iOS (Safari Add to Home Screen) and Android (Chrome PWA prompt).
- Service Worker Offline Caching: Full cache fallback for core assets and routes, allowing continuous access even in zero-connectivity areas.
- Custom-Engineered PDF Export: Auto-formatted account statements with transaction histories, debt balance boxes, and clean rupee typography.
- WhatsApp Direct Dispatch: Native Web Share API integration to send PDFs or formatted ledger balances directly to party WhatsApp numbers.
- Signed-Out Mode: 100% offline-ready, single-device
localStoragepersistence. - Signed-In Mode: Supabase Cloud Sync with Row-Level Security (RLS), Google 1-Tap OAuth & Email/Password auth, optimistic UI updates, and automatic seed-to-cloud migration on first login.
- Mobile-First Luxury UI: Designed with delicate pastel tones, soft borders, clean card elevation, and tactile typography.
- Smooth Spring Physics: Powered by
motionwith gesture-driven swipeable sheets and tactile haptics. - Instant Theme Switching: Sage (warm earthy palette) and Indigo (crisp modern palette) with zero-flash CSS variable tokens.
Hisab includes a built-in library of 260+ vibrant 3D & illustrated WebP avatars with deterministic name hashing. Every party, vendor, and business profile receives a unique, charming avatar automatically:
Astronaut |
Dragon |
Alpaca |
Arctic Fox |
Axolotl |
Beagle |
Bee |
Bento |
Bonsai |
Camera |
Cat |
Corgi |
Coffee |
Badger |
Baby Seal |
Backpack |
...and 244+ more collectible avatars optimized for instant rendering!
Hisab includes an extensive built-in dictionary of 300+ top Indian and global merchants across food delivery, quick commerce, groceries, dining, shopping, utilities, travel, subscriptions, and digital payments. When you mention any brand or alias in your natural language entry, Hisab automatically recognizes the vendor, renders its official brand logo, and pre-categorizes the expense:
Swiggy |
Zomato |
Blinkit |
Zepto |
BigBasket |
McDonald's |
Domino's |
Starbucks |
Amazon |
Flipkart |
Myntra |
Uber |
Ola |
Apple |
Netflix |
Spotify |
Paytm |
PhonePe |
Google Pay |
Airtel |
Jio |
DMart |
Apollo 24|7 |
IRCTC |
...and 276+ more pre-mapped merchants with automatic brand colors, aliases & auto-categorization!
Hisab dynamically routes parsing based on your chosen engine mode (Local, Smart Auto, or Always AI):
Input: "Sent 4500 to Sharma Hardware for cement via UPI"
β
βββ π€ Engine : Gemini 2.0 Flash / Local Fallback
βββ π° Amount : βΉ4,500
βββ π€ Entity : Sharma Hardware (matched alias: "cement supplier")
βββ π·οΈ Category : Construction / Materials (matched keyword: "cement")
βββ π Direction : Outgoing ("You gave")
βββ π³ Payment : UPI
βββ π·οΈ Source : ai_text (Tagged with "AI parsed" badge)
βββ π― Confidence : 98% (Auto-suggests one-tap record)
| Input Sample | Detected Entity | Amount | Category | Direction | Source |
|---|---|---|---|---|---|
500 diesel petrol pump |
None | βΉ500 | Fuel & Travel | Outgoing | Local (<2ms) |
Ramesh gave 1200 cash for rent |
Ramesh | βΉ1,200 | Rent & Utilities | Incoming | Local (<2ms) |
Paid 15000 salary to Mukesh via NEFT |
Mukesh | βΉ15,000 | Salaries & Wages | Outgoing | Gemini AI |
Tea snacks with client 120 |
None | βΉ120 | Food & Dining | Outgoing | Local (<2ms) |
Received 5000 from ABC Corp for invoice 42 |
ABC Corp | βΉ5,000 | Sales / Income | Incoming | Gemini AI |
flowchart TD
subgraph Client ["Client (Browser / PWA / Service Worker)"]
UI["React 19 + Next.js App Router"]
Input["HisabInput (Thinking State & Fallback)"]
Voice["Web Speech API"]
OCR["Camera / Receipt Upload"]
LocalParser["Local NLP & Phonetic Engine (<2ms)"]
AIHelper["src/lib/aiParser.ts"]
Store["Dual-Mode State Layer (Optimistic Store)"]
SW["Service Worker (Offline Cache)"]
end
subgraph AI_Cloud ["AI & Cloud Services"]
GeminiText["Gemini 2.0 Flash (/api/parse-text)"]
GeminiVision["Gemini 2.0 Flash Vision (/api/scan-receipt)"]
SupabaseAuth["Supabase Auth (Google OAuth & Email)"]
SupabaseDB[("Supabase PostgreSQL (RLS & Profiles)")]
PDFGen["jsPDF + AutoTable Engine"]
end
Input --> |Local / Fallback| LocalParser
Input --> |Smart Auto / Always AI| AIHelper
Voice --> Input
AIHelper --> GeminiText
GeminiText -.-> |Silent Fallback on Timeout| LocalParser
OCR --> GeminiVision
GeminiVision --> Store
LocalParser --> Store
AIHelper --> Store
Store <--> |Signed Out| LocalStorage[("Browser localStorage")]
Store <--> |Signed In / Optimistic Sync| SupabaseDB
Store --> PDFGen
PDFGen --> WhatsApp["WhatsApp / Web Share API"]
SW <--> UI
| Layer | Technology | Purpose |
|---|---|---|
| Core Framework | Next.js 16 (App Router) | Turbopack-powered SSR/CSR hybrid web application |
| UI & Runtime | React 19 + TypeScript 5 | High-performance UI state management & full type safety |
| Styling | Tailwind CSS v4 | Utility-first styling with custom CSS variable themes |
| Animations & UX | Motion (Framer Motion) | Spring physics, swipeable bottom sheets & micro-interactions |
| Artificial Intelligence | Google Gemini 2.0 Flash | Multimodal vision OCR for receipts & handwritten ledgers |
| Backend & Database | Supabase (PostgreSQL) | Google OAuth, relational schema, and Row-Level Security |
| PWA & Offline | Progressive Web App | Service worker offline caching and home-screen installability |
| Document Generation | jsPDF + jspdf-autotable | Client-side vector PDF statement generator with Rupee formatting |
| Icons & Avatars | Lucide React + 260+ WebP Avatars | Deterministic visual representation and lightweight SVG icons |
HisabAI/
βββ web/
β βββ src/
β β βββ app/
β β β βββ (app)/ # Main app route group (BottomNav shell)
β β β β βββ page.tsx # Home dashboard & quick hisab entry
β β β β βββ accounts/ # Bahi-Khata ledger & party detail pages
β β β β βββ entries/ # Full date-grouped transaction history
β β β β βββ insights/ # Analytics, donuts, trends & cards
β β β β βββ more/ # Settings, themes, categories, export
β β β βββ api/
β β β β βββ scan-receipt/ # Gemini 2.0 Flash multimodal OCR route
β β β βββ login/ # Auth portal (Google OAuth / Email)
β β β βββ onboarding/ # Guided setup wizard
β β βββ components/
β β β βββ hisab/ # Account detail, transaction row, OCR modal
β β β βββ layout/ # BottomNav, page headers, error banners
β β β βββ onboarding/ # Step-by-step onboarding wizard screens
β β β βββ theme/ # Theme script, provider, & selector
β β β βββ ui/ # Cards, chips, bottom sheets, icon badges
β β βββ lib/
β β βββ parser.ts # Local NLP parser & phonetic normalizer
β β βββ store.tsx # Unified Dual-Mode State Provider
β β βββ avatars.ts # 260+ Avatar catalog & deterministic hasher
β β βββ categories.ts # Category dictionary & keyword registry
β β βββ statementPdf.ts # PDF statement engine with Rupee support
β β βββ whatsapp.ts # Direct WhatsApp sharing handler
β β βββ selectors.ts # Khata balance computation algorithms
β β βββ supabase/ # SSR client, server queries, RLS mappers
β βββ public/
β βββ Assets/ # Brand logos, icons, & 260+ avatars
β βββ screenshots/ # Showcase captures for web & mobile
β βββ sw.js # Service worker for PWA offline caching
β βββ manifest.json # Web App Manifest
βββ UI Plan/ # Complete product UX specifications & mockups
Follow these steps to run Hisab AI locally on your machine.
- Node.js: v18.18.0 or later (Node 20+ recommended)
- Package Manager:
npm,pnpm, oryarn - Supabase Account (optional, for cloud sync): supabase.com
- Google Gemini API Key (optional, for AI receipt scanning): Google AI Studio
git clone https://github.com/Magraa/Hisab-AI.git
cd Hisab-AI/webnpm installCreate a .env.local file in the web directory:
# Supabase Configuration (Optional for cloud sync)
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
# Gemini AI Vision Key (Optional - users can also provide their own key in Settings)
GEMINI_API_KEY=your-gemini-api-keyNote: Hisab runs 100% locally out-of-the-box using browser
localStorageif Supabase environment variables are omitted!
npm run devOpen http://localhost:3000 (or http://localhost:3100 if custom port is used) in your browser.
npm run build
npm run startWhen Supabase is enabled, Hisab enforces strict PostgreSQL Row-Level Security (RLS):
-- Example RLS Policy for Transactions
ALTER TABLE public.transactions ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Users can only access their own transactions"
ON public.transactions
FOR ALL
USING (auth.uid() = user_id)
WITH CHECK (auth.uid() = user_id);- Zero Data Leaks: Every entity, transaction, and profile is scoped to
auth.uid(). - Encrypted Local Storage: Client keys and offline entries remain on your hardware.
- Client-Side Key Option: Users can input their personal Gemini API key stored strictly in local memory.
- Core MVP: Natural language parsing, transaction feeds, and Bahi-Khata ledger.
- Supabase Sync: Real-time cloud backup, authentication, and offline rollback.
- Google OAuth: One-tap sign-in and account backup.
- Gemini 2.0 Flash OCR: Multimodal receipt and handwritten note scanner.
- Hybrid AI Text Parsing: Gemini 2.0 Flash text endpoint (
/api/parse-text) + 3-Way Mode Switch. - Dynamic Categories: User-customizable categories with custom keywords.
- 260+ Deterministic Avatars: Instant visual identities for contacts & accounts.
- 300+ Merchant Intelligence: Instant brand logo matching, alias detection & auto-categorization.
- Progressive Web App (PWA): Offline service worker caching & install prompt.
- PDF & WhatsApp: Auto-generated statements with direct WhatsApp share.
- Multi-Currency Support: International currencies beyond INR (
βΉ). - GST Invoice Export: One-tap monthly GST breakdown reports for Indian businesses.
- SMS Auto-Detection: Android companion to parse bank transactional SMS.
Contributions make the open-source community thrive. Any contributions you make are greatly appreciated!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'feat: add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Crafted with β€οΈ for Indian MSMEs, Freelancers, and Small Businesses.
Hisab AI β’ Your business. Your Hisab.





