<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Bright Londa</title>
    <description>The latest articles on DEV Community by Bright Londa (@brightldev).</description>
    <link>https://dev.to/brightldev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4218557%2F32767dfe-41e3-4d1e-8a37-558935bf5109.png</url>
      <title>DEV Community: Bright Londa</title>
      <link>https://dev.to/brightldev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/brightldev"/>
    <language>en</language>
    <item>
      <title>Pamsika: how a photo of a price board became a DevDraft Best Builder win at Hack Day Lusaka</title>
      <dc:creator>Bright Londa</dc:creator>
      <pubDate>Sun, 08 Nov 2026 12:33:12 +0000</pubDate>
      <link>https://dev.to/brightldev/pamsika-how-a-photo-of-a-price-board-became-a-devdraft-best-builder-win-at-hack-day-lusaka-6gk</link>
      <guid>https://dev.to/brightldev/pamsika-how-a-photo-of-a-price-board-became-a-devdraft-best-builder-win-at-hack-day-lusaka-6gk</guid>
      <description>&lt;p&gt;&lt;em&gt;Pamsika&lt;/em&gt; means "at the market" in Nyanja. We built it last weekend at &lt;strong&gt;Hacktoberfest Hack Day Lusaka&lt;/strong&gt;, and it won &lt;strong&gt;Best Builder from &lt;a href="https://devdraft.ai" rel="noopener noreferrer"&gt;DevDraft&lt;/a&gt;&lt;/strong&gt; 🏆&lt;/p&gt;

&lt;p&gt;One photo of a price board becomes a digital shop with a payment link for every product, and every published board feeds a public price board for the city.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Live demo: &lt;a href="https://pamsika-app.netlify.app" rel="noopener noreferrer"&gt;https://pamsika-app.netlify.app&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Public Market Price Watch: &lt;a href="https://pamsika-app.netlify.app/prices" rel="noopener noreferrer"&gt;https://pamsika-app.netlify.app/prices&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Code (MIT): &lt;a href="https://github.com/cozyCodr/pamsika" rel="noopener noreferrer"&gt;https://github.com/cozyCodr/pamsika&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thank you to &lt;strong&gt;Parity&lt;/strong&gt; and &lt;strong&gt;Tech Kaizen&lt;/strong&gt; for organising the Hack Day, to &lt;strong&gt;MLH&lt;/strong&gt; for making events like this happen, and to &lt;strong&gt;DevDraft&lt;/strong&gt; for the award.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Walk through Soweto or Kamwala market in Lusaka and prices live on chalk boards. Sales live in the trader's head, and "send to my number" mobile-money payments leave no receipt. Customers can't order ahead, and shoppers have no way to see what mealie meal or cooking oil costs at the next market today.&lt;/p&gt;

&lt;p&gt;Almost everyone already has a phone camera and mobile money. So the whole product had to be one action: &lt;strong&gt;snap the board&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Snap.&lt;/strong&gt; The trader photographs their board, or a product held next to its price.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check.&lt;/strong&gt; Gemma 4 turns the photo into a catalogue and flags anything that looks wrong. One tap fixes it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Get paid.&lt;/strong&gt; Publishing creates a product and a mobile-money payment link per item, plus a stall QR to print or share on WhatsApp. When a customer pays, a signed webhook lights up a "Payment received" banner on the seller's phone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public good.&lt;/strong&gt; Every published board adds today's staple prices to an anonymised &lt;strong&gt;Market Price Watch&lt;/strong&gt;, market by market, with the change since yesterday.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Gemma 4 as the eyes
&lt;/h2&gt;

&lt;p&gt;We call &lt;code&gt;gemma-4-26b-a4b-it&lt;/code&gt; through the Gemini API with the photo and a prompt that asks for strict JSON, then validate it with zod and retry once with the validation error if it doesn't parse. Two prompt rules did most of the work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- "name": short product name in Title Case. When a product's packaging is visible,
  name it from the label (brand and flavour, e.g. "Fanta Orange"), never use the
  price itself as the name.
- "flag_reason": a short, friendly sentence for the seller when the price looks
  like a likely typo for that item (e.g. a missing zero) ... else null.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first version only knew about chalk boards. When a teammate photographed a Fanta bottle next to "K29", Gemma named the item "K29" and flagged it as "not a price board". Telling it that product photos are valid, and to name items from packaging, fixed it: the same photo now reads as &lt;strong&gt;Fanta Orange · 500ml · K29&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;On a test board with a deliberate typo, it returned:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"K5 for kapenta looks low. Did you mean K50?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We also back the model with a small deterministic check: known staples have a plausible price range, and a price that is 10× too small gets a suggested fix even if the model misses it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Google's API sometimes returns a 500.&lt;/strong&gt; We hit one live in front of the trader screen. Now transient errors retry once on the same model, then fall back to &lt;code&gt;gemma-4-31b-it&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;models&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;gemmaModel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;gemmaModel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;FALLBACK_MODEL&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;gemmaModel&lt;/span&gt;&lt;span class="p"&gt;]];&lt;/span&gt;
&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;models&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;entries&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;ai&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;models&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generateContent&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;contents&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;config&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;genConfig&lt;/span&gt; &lt;span class="p"&gt;})).&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;isTransient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;             &lt;span class="c1"&gt;// 500/503/429 only&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;600&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)));&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Getting paid with DevDraft
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://devdraft.ai" rel="noopener noreferrer"&gt;DevDraft&lt;/a&gt; handles the money side. When a seller publishes their board, Pamsika creates a DevDraft product and a payment link for each item, with &lt;code&gt;allowMobilePayment&lt;/code&gt; switched on so customers can pay from their phones. The stall QR code points at those links.&lt;/p&gt;

&lt;p&gt;When a customer pays, DevDraft sends an HMAC-signed webhook. The receiver verifies the signature over the &lt;strong&gt;raw&lt;/strong&gt; body with a constant-time compare, stores each event id once, and matches the payment to the right stall item by looking for any of our link or product ids anywhere in the payload:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;verifySignature&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;rawBody&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;signature&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;secret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;signature&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;secret&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;expected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createHmac&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sha256&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;secret&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;rawBody&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hex&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;signature&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/^sha256=/&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;timingSafeEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Live updates reach the seller by server-sent events when the app runs as one server. On Netlify, functions don't share memory, so the sales screen also polls every 3 seconds and announces any payment id it hasn't seen yet. Both paths feed the same banner.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stack
&lt;/h2&gt;

&lt;p&gt;Next.js (App Router) · TypeScript · Tailwind CSS · Zustand · Turso (libSQL) · Netlify · Gemini API (Gemma 4) · DevDraft API. MIT licensed.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd do differently
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Test the real photos people will take, early.&lt;/strong&gt; Our prompt was tuned for chalk boards, but the first real photo was a product next to a price on a laptop screen.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don't trust the API docs blindly.&lt;/strong&gt; The docs list a products endpoint that the live API answered with "Cannot GET", so publishing falls back to amount-based payment links.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Posts that helped
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;"Webhooks in the Next.js App Router: Field Notes on Raw Bodies, Signature Verification, and Returning 200 Before the Work" by ahmed_mahmoud360 shaped how we read the raw body for HMAC: &lt;a href="https://dev.to/ahmed_mahmoud360/webhooks-in-the-nextjs-app-router-field-notes-on-raw-bodies-signature-verification-and-1bc6"&gt;https://dev.to/ahmed_mahmoud360/webhooks-in-the-nextjs-app-router-field-notes-on-raw-bodies-signature-verification-and-1bc6&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;"How I Built an AI Document Ingestion Pipeline" by sym is a good walkthrough of photo-to-JSON with graceful fallback: &lt;a href="https://dev.to/sym/how-i-built-an-ai-document-ingestion-pipeline-1abf"&gt;https://dev.to/sym/how-i-built-an-ai-document-ingestion-pipeline-1abf&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;"I Fine-Tuned Gemma 4 to Read Receipts" by katsu, from another Hacktoberfest Hack Day team, on getting Gemma 4 to read real-world paper: &lt;a href="https://dev.to/katsu/i-fine-tuned-gemma-4-to-read-receipts-hactoberfest26-56ic"&gt;https://dev.to/katsu/i-fine-tuned-gemma-4-to-read-receipts-hactoberfest26-56ic&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Built with help from Claude Code.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>ai</category>
      <category>opensource</category>
      <category>nextjs</category>
    </item>
  </channel>
</rss>
