# GOLD BOOK
## Inspiration
GOLD BOOK was inspired by the real-world pain points faced by Indian pawnbrokers who struggle with manual record-keeping, interest calculation errors, and payment collection. The founders recognized that pawnbrokers across India face common challenges: inability to quickly find customer records, uncertainty about interest calculations, customers forgetting due dates requiring manual follow-up calls, and lack of proof when disputes arise. The product was built specifically for the RBI 2025 record-keeping standards, with a focus on compliance and simplicity.
## What it does
GOLD BOOK is a comprehensive gold loan management software for Indian pawnbrokers that:
- **Tracks gold loans** with automatic interest calculation (simple or compound interest computed to the day)
- **Provides a digital passbook** for customers accessible via WhatsApp, showing loan details, payment history, and balances
- **Sends WhatsApp reminders** with borrower's exact balance and payment links - no apps to install
- **Maintains a searchable digital ledger** of loans, customers, and payments with audit-ready CSV export
- **Calculates interest accurately** with frozen rates on every loan to prevent disputes
- **Supports payment recording** with UPI integration for online collections
- **Generates compliance-ready reports** and statements for RBI 2025 standards
- **Manages customer data** with search and history tracking
- **Handles staff permissions** and shop settings
The software is designed specifically for the counter, not the back office - mobile-first and practical for daily operations.
## How we built it
### Tech Stack
- **Frontend:** Next.js 15 with React 19, TypeScript, and Tailwind CSS v4
- **UI Components:** Shadcn/ui with Base UI primitives
- **Backend:** Supabase (PostgreSQL) for database and authentication
- **State Management:** TanStack Query for server state
- **Forms:** React Hook Form with Zod validation
- **PDF Generation:** @react-pdf/renderer for statements
- **Notifications:** Sonner for toast notifications
- **Theming:** next-themes for dark mode support
### Architecture
- App Router with route groups for admin, app, auth, marketing, and onboarding
- Server actions for all mutations with strict security guards
- Row-level security (RLS) in Supabase for multi-tenant isolation
- Custom SQL functions for interest calculation, loan summaries, and financial integrity
- Interest parity tests ensuring JavaScript preview matches SQL calculations
- Financial integrity tests guarding against rate tampering and unauthorized access
### Key Features
- Interest rates frozen on loan creation (immutable)
- Server-side loan number generation (GL-YYYY-NNNN format)
- Passbook tokens for customer access with 365-day expiry
- WhatsApp template system for customizable reminder messages
- Slab-based interest rate configuration
- Comprehensive test suite for financial calculations
## Challenges we ran into
1. **Interest Calculation Parity:** Ensuring JavaScript preview calculations match SQL calculations exactly to the rupee. Solved with comprehensive parity tests running 200+ random cases.
2. **Financial Integrity Guards:** Preventing tampering with frozen interest rates and ensuring closed loans stop accruing interest. Implemented strict SQL triggers and server-action guards.
3. **Multi-tenant Security:** Ensuring shops can only access their own data. Implemented RLS policies and server-side ownership checks.
4. **WhatsApp Integration:** Building a system that works without requiring borrowers to install apps. Used click-to-chat wa.me links with message templates.
5. **Compliance Requirements:** Meeting RBI 2025 record-keeping standards with frozen rates, complete audit trails, and one-click exports.
6. **Mobile-First Design:** Creating a UX that works on small screens at the counter, not just desktop back-office screens.
## Accomplishments that we're proud of
1. **Financial Integrity System:** Built a robust system with database-level guards preventing rate tampering, even with service-role access.
2. **Interest Calculation Engine:** Implemented dual-mode (simple/compound) interest calculation with day-precision and complete parity between SQL and JavaScript.
3. **Digital Passbook:** Created a customer-facing passbook accessible via a simple link that shows complete loan history, balances, and UPI payment options.
4. **Test Coverage:** Developed comprehensive tests including interest parity (200+ cases) and financial integrity gates that run on every build.
5. **WhatsApp Reminder System:** Built a template-based system that lets shop owners customize reminder messages while maintaining structure.
6. **Compliance-Ready Export:** One-click CSV export with complete audit trail for RBI 2025 compliance.
7. **Simple Pricing Model:** Competitive ₹999/month pricing with transparent breakdown and free trial.
## What we learned
1. **Domain-Driven Design:** The importance of deeply understanding the pawnbroker's workflow - the software had to work at the counter, not just in the back office.
2. **Financial Precision:** The critical importance of exact interest calculations and the need for parity between preview and production calculations.
3. **Security by Design:** Multi-tenant applications need defense in depth - RLS, server-side checks, and database triggers all working together.
4. **User Trust:** In financial applications, trust is built through transparency - frozen rates, audit trails, and clear dispute resolution mechanisms.
5. **Testing Strategy:** Financial calculations need both unit tests and integration tests - JavaScript preview needs to match SQL reality.
6. **Mobile UX in India:** WhatsApp is the platform - building on existing user behavior rather than requiring new app installations.
## What's next for GOLD BOOK
1. **Enhanced Analytics:** Dashboard insights on collection patterns, default rates, and shop performance metrics.
2. **Bulk Operations:** Bulk payment recording, bulk reminder sending, and bulk loan closure for high-volume shops.
3. **Multi-Location Support:** Managing multiple shop locations from a single account with cross-location reporting.
4. **Enhanced Integration:** Direct bank account integration for EMI collections and automated reconciliation.
5. **Mobile App:** Native mobile apps for staff to quickly record loans and payments at the counter.
6. **AI-Powered Insights:** Predictive analytics for identifying high-risk borrowers and optimizing collection schedules.
7. **Regional Language Support:** Support for Tamil, Telugu, Malayalam, and other regional languages across India.
8. **Marketplace Features:** Integration with gold price APIs for automatic valuation suggestions based on daily rates.
Log in or sign up for Devpost to join the conversation.