<?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: Lex Na</title>
    <description>The latest articles on DEV Community by Lex Na (@lexsgd).</description>
    <link>https://dev.to/lexsgd</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3860282%2F03897963-e94f-4a1e-9efe-eed940034ae5.jpg</url>
      <title>DEV Community: Lex Na</title>
      <link>https://dev.to/lexsgd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lexsgd"/>
    <language>en</language>
    <item>
      <title>Connecting AI to WhatsApp Business API — Lessons from 1000+ SME Deployments</title>
      <dc:creator>Lex Na</dc:creator>
      <pubDate>Sat, 04 Apr 2026 03:19:11 +0000</pubDate>
      <link>https://dev.to/lexsgd/connecting-ai-to-whatsapp-business-api-lessons-from-1000-sme-deployments-3glc</link>
      <guid>https://dev.to/lexsgd/connecting-ai-to-whatsapp-business-api-lessons-from-1000-sme-deployments-3glc</guid>
      <description>&lt;p&gt;We built HeyMag to connect AI assistants to WhatsApp Business numbers for SMEs across Southeast Asia. Here's what we learned.&lt;/p&gt;

&lt;h2&gt;
  
  
  WhatsApp Business API Quirks
&lt;/h2&gt;

&lt;p&gt;The WhatsApp Business API has some non-obvious constraints that will trip you up if you're coming from building chatbots on other platforms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;24-hour messaging windows&lt;/strong&gt; — you can only send free-form messages within 24 hours of the customer's last message. After that, you need pre-approved template messages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Template messages need pre-approval&lt;/strong&gt; — Meta reviews every outbound template. Expect 24-48 hours for approval. Plan your flows around this.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Media handling requires specific formatting&lt;/strong&gt; — images, documents, and location pins each have their own payload structure. PDFs max out at 100MB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rate limits scale with your quality rating&lt;/strong&gt; — Meta assigns your number a quality rating based on user blocks and reports. Low quality = severe rate limits.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What Actually Matters for AI Integration
&lt;/h2&gt;

&lt;p&gt;Building the AI part was the easier half. The hard part was making it work for real businesses with real customers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Context window management&lt;/strong&gt; — WhatsApp conversations are long-running, not session-based. A customer might message Monday, disappear, then reply Thursday referencing Monday's conversation. Your AI needs to handle this gracefully.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Language switching&lt;/strong&gt; — customers in Singapore switch between English, Mandarin, and Singlish mid-conversation. Sometimes mid-sentence. Your model needs to handle code-switching without breaking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Escalation design&lt;/strong&gt; — knowing when to hand off to a human is more important than the AI being perfect. We use confidence scoring plus keyword triggers for escalation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Response latency&lt;/strong&gt; — customers expect sub-3-second replies on WhatsApp. If your AI takes 8 seconds, they've already opened another tab. We pre-generate responses for common patterns and stream the rest.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Biggest Lesson
&lt;/h2&gt;

&lt;p&gt;SME owners don't care about your AI model. They don't care about your architecture or your prompt engineering. They care about one thing: did customers stop complaining about slow replies?&lt;/p&gt;

&lt;p&gt;Ship fast, iterate on accuracy. A mediocre AI that replies in 2 seconds beats a perfect AI that takes 10 seconds. Every time.&lt;/p&gt;

&lt;p&gt;The second biggest lesson: WhatsApp's 90%+ open rate in Southeast Asia makes email look like sending letters by carrier pigeon. If you're building customer-facing AI for this region, WhatsApp is the channel.&lt;/p&gt;

&lt;p&gt;More at &lt;a href="https://heymag.app" rel="noopener noreferrer"&gt;heymag.app&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>softwaredevelopment</category>
      <category>startup</category>
    </item>
    <item>
      <title>Building Offline-First POS for Singapore Hawker Centres</title>
      <dc:creator>Lex Na</dc:creator>
      <pubDate>Sat, 04 Apr 2026 03:17:43 +0000</pubDate>
      <link>https://dev.to/lexsgd/building-offline-first-pos-for-singapore-hawker-centres-25fj</link>
      <guid>https://dev.to/lexsgd/building-offline-first-pos-for-singapore-hawker-centres-25fj</guid>
      <description>&lt;p&gt;WiFi in Singapore hawker centres is unreliable. Here's how we built Lunchbox to handle offline-first transactions with automatic sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Challenge
&lt;/h2&gt;

&lt;p&gt;A hawker stall doing 200+ transactions per day can't afford downtime when the WiFi drops. Traditional cloud POS systems freeze. Customers leave. The lunch rush doesn't wait for your router to reboot.&lt;/p&gt;

&lt;p&gt;We learned this the hard way during early pilot testing at a hawker centre in Toa Payoh. The merchant lost 15 minutes of transactions during peak hour because the shared WiFi went down. That's roughly $300 in lost revenue — in one lunch service.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Approach
&lt;/h2&gt;

&lt;p&gt;We rebuilt the core transaction engine to be offline-first:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Local-first data storage with IndexedDB&lt;/strong&gt; — every transaction is written locally before any network call&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Background sync when connectivity returns&lt;/strong&gt; — uses the Background Sync API with exponential backoff&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conflict resolution for multi-device setups&lt;/strong&gt; — timestamp-based last-write-wins with manual override for edge cases&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Payment fallback modes&lt;/strong&gt; — PayNow QR works offline via static QR codes; NETS requires connectivity but we queue the confirmation&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Key Insight
&lt;/h2&gt;

&lt;p&gt;Don't treat offline as an error state. Treat it as the default state, and online sync as a bonus.&lt;/p&gt;

&lt;p&gt;This changes everything about your architecture. Instead of "fetch from server, display to user," it becomes "read from local store, display to user, sync in background." The UX is faster even when you have great WiFi, because you're never waiting on a network round-trip for the critical path.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;We've had merchants run full lunch rushes on zero WiFi without a single lost transaction. The sync catches up within seconds once connectivity returns, and the dashboard shows real-time data as if nothing happened.&lt;/p&gt;

&lt;p&gt;If you're building for markets with unreliable connectivity, the offline-first mindset changes everything. The investment in local-first architecture pays for itself in reliability alone.&lt;/p&gt;

&lt;p&gt;Check out what we're building at &lt;a href="https://lunchbox.asia" rel="noopener noreferrer"&gt;lunchbox.asia&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>singapore</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
