ASIM ANSARI // PROJECTS
PROJECT CASE STUDY // COMMERCE & MULTIMODAL AI

BILLPRODS AI

Item-level product intelligence ledger, receipt vision parsing, and price history tracking engine. Powered by Google Gemini multimodal vision, a high-performance FastAPI backend, PostgreSQL time-series schema, and an offline-ready React Progressive Web App.

FastAPI Gemini 3.1 Flash PostgreSQL React PWA Docker Compose
SIGNAL // CLOUD STAGING
Cloud Instance In Staging: Hosted cloud deployment for billprods-ai.asimansari.com is currently in active staging. In the meantime, the complete repository, containerized Docker Compose harness, and full REST API are 100% functional and reproducible on your local machine today.
[01] THE STORY // BEHIND THE SCENES

HOW BILLPRODS AI WAS BORN & EVOLVED

STAGE 01 // HOW IT STARTED Personal Utility · BillMind

Built to Track My Own Expenses with Gemini

The project started as a personal tool named BillMind. I wanted an effortless way to track my own daily expenses without having to type everything into a spreadsheet or app manually.

From day one, the prototype was built directly on top of Google Gemini. At the time, Gemini was the most capable, multimodal, and cost-efficient vision model available. I could snap a photo of my receipt, pass it straight to the model, and automatically extract the spending details.

STAGE 02 // THE TURNING POINT Real-World Problem · A Shop Owner Asked for Help

When a Shop Owner Needed a Real Solution

One day, a local person came to me asking for a solution for their shop. They were struggling with stacks of physical supplier bills and wholesale invoices, trying to keep track of changing inventory costs and supplier pricing.

Looking at their everyday struggle, it hit me: just logging total bill amounts is only half the story. What shopkeepers and cost-conscious buyers actually need is to track the individual products, unit prices, and categories inside those bills over time.

STAGE 03 // CONTINUOUS EVOLUTION From BillMind to BillProds AI

Evolving from a Simple Prototype into a Product Ledger

That shopkeeper's problem changed the entire direction of the codebase. BillMind evolved into BillProds AI (Bill Products AI).

Instead of treating a bill as a single number, I re-architected the system to deconstruct receipts into granular product items: product name, pack size, quantity, unit price, and timestamp. I kept building, testing, and iterating—re-engineering the database schemas with PostgreSQL and FastAPI, adding automated category heuristic rules, and wrapping the frontend in an offline-ready Progressive Web App.

STAGE 04 // CURRENT SYSTEM Zero-Touch Automated Categorization

Upload Your Bill & The System Does the Rest

Today, the workflow is dead simple: the user only has to upload their bill.

BillProds AI handles the rest automatically: decomposing the receipt into individual line items, auto-categorizing each product, logging unit price history, and plotting trends over time. It started as an MVP to solve my own personal expense tracking, and grew organically by solving a real problem for a real shop.

[02] PRODUCT TARGETING

WHO IT'S BUILT FOR

01 // INDEPENDENT MERCHANTS

Solo retailers and shop operators who buy supplies from physical wholesalers and want to track item price trends without painful manual bookkeeping.

02 // COST-CONSCIOUS CONSUMERS

Households and individuals tracking real unit-price inflation on food, household goods, and consumables across different merchants over time.

03 // DEVELOPERS & HACKERS

Engineers wanting a fully open-source, self-hostable financial ledger with clean REST APIs, Docker Compose scripts, and PWA offline capabilities.

[03] SYSTEM PIPELINE

PIPELINE ARCHITECTURE

STAGE 01 INGESTION

Receipt Capture

Physical paper slips, supermarket receipts, or digital PDF invoices captured via device camera or drag-and-drop.

PAYLOAD Image / PDF Stream
STAGE 02 GEMINI 3.1

Multimodal Extraction

Gemini 3.1 Flash decodes spatial table layouts to extract merchant, date, individual SKUs, unit prices, and quantities.

PAYLOAD Structured Line-Item JSON
STAGE 03 FASTAPI

Normalization & Rules

Pydantic schemas validate totals, normalize product names and units, compute decimal price precision, and apply categorization heuristics.

PAYLOAD Validated Schema Entities
STAGE 04 POSTGRES

Time-Series Ledger

Stores transactional line items into an atomic relational database, mapping SKU unit-price histories across time.

PAYLOAD Atomic SQL Persistence
STAGE 05 REACT PWA

Virtualized Grid

Client application leverages @tanstack/react-virtual to maintain 60 FPS performance across thousands of historical items.

PAYLOAD Sub-Second 60 FPS UI

SUB-SECOND VIRTUALIZATION

Rendering thousands of granular line items can cripple browser DOMs. Integrated @tanstack/react-virtual ensures only visible rows are painted, maintaining a constant 60 FPS.

ATOMIC TRANSACTION ROLLBACK

Importing historical backup datasets runs in a single database transaction session. Any parsing error triggers an instant rollback, guaranteeing data integrity.

OFFLINE PWA ENGINE

Built with Vite and Service Workers, supporting installation to Android/iOS home screens, offline caching of assets, and background sync.

[04] DEVELOPER QUICKSTART

RUNNING LOCALLY

1. backend // fastapi BASH
cd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# Start backend
uvicorn app.main:app --reload --port 8000
2. frontend // react pwa BASH
cd frontend
npm install

# Start Vite dev server
npm run dev

# Open http://localhost:5173
DOCKER PRODUCTION STACK: docker compose -f deploy/compose.yaml up -d Inspect compose.yaml ↗
[05] STATUS & ACTIVE CHALLENGE

CURRENT STAGE & THE HARD PART

STAGE // OPERATIONAL BASELINE CURRENT STAGE

Functional Full-Stack Prototype

The web app and progressive web app (PWA) baseline are fully functional. Users can upload crumpled or printed paper receipts, and Google Gemini multimodal vision extracts individual line-item products, unit prices, and quantities into a structured PostgreSQL ledger.

Containerized with Docker Compose for immediate, one-command local reproduction.

THE HARD PART // ACTIVE CHALLENGE IN PROGRESS

Hybrid Cost Architecture & Local Migration

Complex, faded physical thermal receipts require frontier multimodal vision—sub-1B models cannot accurately parse them without 16GB+ VRAM. The engineering challenge is eliminating all non-essential cloud spend to run the platform on a razor-thin personal budget.

I am re-architecting the system so cloud APIs are reserved strictly for receipt OCR. Everything else—database persistence, conversational financial querying, and voice processing—is being moved to run directly on the user's local device (client SQLite/OPFS, quantized on-device SLMs, and local Whisper).