DEV Community

Cover image for I Built Daftari - A Digital Ledger for Solopreneurs to Track Job Cards and Payments via WhatApp Chats
muvengei.dev
muvengei.dev

Posted on

I Built Daftari - A Digital Ledger for Solopreneurs to Track Job Cards and Payments via WhatApp Chats

Built with Google Gemini: Writing Challenge

This is a submission for the Built with Google Gemini: Writing Challenge

What I Built with Google Gemini

Daftari AI Login

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

  1. The User Interface: The business owner sends a natural language message (in English, Swahili, or Sheng) to the Daftari AI WhatsApp bot.

Chat with Daftari AI

  1. 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.

Example Chat

  1. 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.

Example Chat

  1. 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.

Daftari AI Customers

Daftari AI jobs

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").

All Operations

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.

How to get started

  1. Visit https://daftariai.vercel.app
  2. Click Get Started with WhatsApp
  3. Start chatting with the WhatsApp bot

To login to the web portal

  1. send "Login" to the bot
  2. Provide your email Bot registers your email and sends a email verification link
  3. 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)