This is a submission for the Built with Google Gemini: Writing Challenge
What I Built with Google Gemini
In Kenya, the local economy run on WhatsApp. From small-scale digital printing services to hair stylists, business is managed through a chaotic flow of phone calls, Sheng (local slang) texts, WhatsApp messages, and M-Pesa payment SMS.
The problem
Solopreneurs lose thousands of shillings every month due to poor record keeping - they forget to record a debt, or lose track of a job hidden in a chat thread. Sometimes they can get a hold of a previous quote given to a repeat customer. Manual bookkeeping is too slow for the "hustle"(fast paced business operations in Nairobi), and traditional accounting apps fell too corporate and complex.
The Solution: Daftari AI (Swahili for Ledger)
Daftari AI (Swahili for Ledger) is a WhatsApp-native business engine designed to bridge the gap between informal record-keeping and professional financial management. It eliminates the need for complex accounting software by meeting African solopreneurs where they already are: WhatsApp.
The Technical Flow: How it Works
- The User Interface: The business owner sends a natural language message (in English, Swahili, or Sheng) to the Daftari AI WhatsApp bot.
- The Proxy Layer: The message is received by the WhatsApp Cloud API, which triggers a webhook to our Next.js Proxy Server. This proxy acts as the traffic controller, sanitizing the incoming payload.
- The Cognitive Engine (Google Gemini): The proxy forwards the raw, unstructured text to Google Gemini. Serving as the Cognitive Parser, Gemini analyzes the intent and context.
- Input: "Nimefanya kazi ya Jane leo, ameacha deposit ya 500"
- Process: Gemini identifies the Customer (Jane), the Transaction Type (Income/Job), the Total Amount, and the Payment Status (Deposit).
- Output: Gemini returns a Structured JSON Object of customer, transaction and job card.
- The Persistence Layer: The proxy receives this JSON and automatically updates the Postgres Database (Supabase). The user receives an instant confirmation on WhatsAppโall without ever leaving the chat.
Multi-Operation Capabilities
Daftari AI isn't just a logger; it's a full-service business assistant. Users can perform diverse operations via simple chat commands:
๐ Job Tracking: Record new services, quantities, and descriptions.
๐ค Debt Management: Instantly check "who owes what" (e.g., "Bal Jane").
๐ณ Payment Logging: Forward M-Pesa SMS messages directly to the bot to reconcile accounts instantly.
๐ Quick Summaries: Request daily or weekly financial overviews (e.g., "Deni za leo" or "Muhtasari").
The Comprehensive Dashboard
While the WhatsApp bot handles the "on-the-go" hustle, Daftari AI provides a Professional Web Portal. Users can log in to their dashboard to view deep-dive analytics, export comprehensive financial reports, and manage their customer database with a birds-eye view of their business health.
Demo
Daftari AI is built with a Next.js backend, Supabase for the ledger, and the WhatsApp Cloud API.
GitHub Repository: https://github.com/geraldmuvengei06/daftari
Live Demo: https://daftariai.vercel.app
How to get started
- Visit https://daftariai.vercel.app
- Click Get Started with WhatsApp
- Start chatting with the WhatsApp bot
To login to the web portal
- send "Login" to the bot
- Provide your email Bot registers your email and sends a email verification link
- Click the email verification link, you will be redirected to your dashboard.
Caption: Gemini parsing an M-Pesa SMS and a Sheng job descriptions. The flow.
What I Learned
This project was a masterclass in Technical Pivot Strategy.
Model Versatility: I learned that "newer isn't always easier." When I hit regional quota blocks with Gemini 2.0, I had to learn how to reconfigure my middleware to leverage Gemini 1.5 Flash, which provided the stability and rate limits I needed for a production-ready bot.
The "Zero UI" Philosophy: I learned that the best interface for a busy entrepreneur is the one they already use. By building inside WhatsApp, I eliminated the "app fatigue" that kills most small-business tools.
Prompt Engineering for Chaos: I spent hours refining system instructions so Gemini could understand Sheng and mixed-language context, ensuring it never missed a decimal point in a transaction.
Google Gemini Feedback
The Good
The contextual intelligence of Gemini 1.5 Flash is world-class. It didn't just parse text; it understood intent. Whether a user forwarded a formal bank message or a casual "Jane paid me," Gemini treated the data with 100% accuracy. The speed of the Flash model is perfect for real-time WhatsApp webhooksโresponses feel instant.
The Bad
I encountered significant regional friction regarding Google Cloud Billing. In Kenya, setting up a verified billing account for "production" tier models often results in cryptic errors (like the [OR-CBAT-23] code), which can be a massive barrier for developers in the Global South.
The Ugly (and how I fixed it)
During the heat of development, I hit a 429 "Limit 0" Quota Error on the Gemini 2.0 API. Google billing kept rejecting my payment method. This could have ended the project. Instead of stopping, I pivoted:
I shifted my backend to Gemini 1.5 Flash via AI Studio to bypass the billing lock, which also didn't work so I added OPENAI as a fallback
I troubleshooted a Meta App Conflict where two apps were fighting for the same phone number.
I automated the WhatsApp Registration Handshake using cURL to reduce the user registration process.
Conclusion: Daftari AI is more than a bot; it's a tool that could revolutionize bookkeeping by meeting users where they are - WhatsApp.
Top comments (0)