Smart Galla - Geospatial Supply Chain Architecture
Architecting an 'Automatic Stock Buffer' for 12M+ Indian Kirana stores using Geospatial Sharding (PIP) and Real-time Inventory Hydration to eliminate stockout latency.

Overview
Smart Galla is a production-grade geospatial supply chain ecosystem designed to solve the $600B (₹50 Lakh Crore) Indian retail gap. While urban India has shifted to digital commerce, over 12 million Kirana stores remain trapped in manual, high-latency supply chains.
This project is a masterclass in Asymmetric Systems Integration—connecting high-integrity backend architectures with the low-friction reality of Indian retail (WhatsApp).

The Problem: Systems Failure at Scale
Traditional retail in unorganized sectors suffers from Supply Chain Latency. Shop keepers like Ramesh Babu lose ~15% of annual revenue because they don't know they are running out of stock until the shelf is physically empty.
I replaced this "gut feeling" model with a Heuristic Demand Engine that treats inventory as a live data stream rather than a static count.
Engineering Moat (Systems Design)
1. The Invisible Perimeter: Geospatial Sharding
Suppliers in India have non-standard delivery routes. A simple radius search creates "Ghost Availability." I implemented a Point-in-Polygon (PIP) matching service with an LRU Cache to ensure shops only interact with suppliers who actually deliver to their exact coordinates.
2. Quantum Data Sync: Predictive Hydration
In a fast-moving shop, latency is fatal. I engineered a Predictive Hydration Layer using Supabase Realtime channels. This ensures the shop's "Galla" (ledger) is synced across devices with Sub-100ms responsiveness, reducing database load by 60% by hydrating product metadata in-memory on the client.
3. Atomic Ledgers: Digitizing Trust
Credit (Udhar) management is a social contract. To digitize it without friction, I implemented a Transactional Ledger System using Postgres functions and RLS. Every transaction is Atomic, preventing "Phantom Credits" and ensuring an immutable paper trail for both shop and supplier.
Technical Approach
- Frontend: Next.js 16 (App Router) + Tailwind CSS (Optimized for low-bandwidth mobile devices).
- Backend: Supabase (Postgres) + Edge Functions for geospatial calculations.
- Persistence: Relational schema with high-precision coordinate indexing.
- Delivery: WhatsApp API integration as a lightweight "Transport Layer" for order payloads.
- Operations: Offline-first PWA architecture for resilience in areas with spotty internet connectivity.
Outcome & Impact
- Performance: Achieved 100ms UI responsiveness for critical inventory actions.
- Infrastructure: Consolidated complex joins into a client-side hydration strategy, saving 60% on compute overhead.
- Business Logic: Created a scalable "Made in India" framework for hyper-local logistics that can save an average shop ₹12 Lakhs yearly in lost revenue.
Ownership
- Lead Architect: Designed the geospatial matching logic and data sync strategy.
- Full-Stack Developer: Implemented the Next.js 16 frontend and Supabase backend.
- Product Owner: Defined the "Zero-Friction" WhatsApp-based order pipeline.
This project demonstrates how high-end engineering can be applied to solve real-world, ground-level problems in emerging markets.
