<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Eng. Apdow — Notes</title>
    <link>https://eng-apdow.vercel.app/blog</link>
    <description>Engineering write-ups on offline-first architecture, messaging infrastructure, accessibility and the craft of shipping web products.</description>
    <language>en</language>
    <lastBuildDate>Thu, 18 Sep 2025 09:00:00 GMT</lastBuildDate>
    <generator>Astro</generator>
    <atom:link href="https://eng-apdow.vercel.app/rss.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Offline-first web apps that actually work on bad connections</title>
      <link>https://eng-apdow.vercel.app/blog/offline-first-web-apps</link>
      <guid isPermaLink="true">https://eng-apdow.vercel.app/blog/offline-first-web-apps</guid>
      <pubDate>Thu, 18 Sep 2025 09:00:00 GMT</pubDate>
      <description>Somalia taught me more about caching than any lighthouse report. How to design an app whose core loop never depends on the network.</description>
      <category>Architecture</category>
      <category>PWA</category>
      <category>Performance</category>
      <content:encoded>&lt;p&gt;Most “offline support” ships as a polite error message. For users on 2G — or on a 3G connection that dies every ten minutes — that is the entire product experience. When I built Babelish, the requirement was blunt: every lesson must open with zero bars.&lt;/p&gt;
      &lt;h2&gt;1. Decide what is core before you touch a service worker&lt;/h2&gt;
      &lt;p&gt;Write the three things a user must be able to do on a plane. For a learning app that was: open a lesson, complete it, keep the streak. Everything else — leaderboards, avatars, AI scores — is progressive.&lt;/p&gt;
      &lt;h2&gt;2. Treat the network as a sync engine, not a data source&lt;/h2&gt;
      &lt;p&gt;The UI reads from local state only. Mutations go into an outbox table with an idempotency key, and a background worker drains it. When the drain fails, nothing breaks: the outbox is just still full.&lt;/p&gt;
      &lt;pre&gt;&lt;code&gt;type Outbox = {
  id: string;          // idempotency key, generated on device
  op: &quot;complete_lesson&quot; | &quot;score&quot;;
  payload: unknown;
  attempts: number;
};&lt;/code&gt;&lt;/pre&gt;
      &lt;h2&gt;3. Version your content packs&lt;/h2&gt;
      &lt;p&gt;Lessons ship as signed JSON packs with a &lt;code&gt;version&lt;/code&gt; field. On boot the client asks for the manifest (a few KB, gzip-friendly) and only downloads changed packs. A 25-language catalogue stays under 4&amp;nbsp;MB per active language.&lt;/p&gt;
      &lt;h2&gt;4. Make sync visible&lt;/h2&gt;
      &lt;p&gt;A tiny pill (“3 changes queued”) removes almost all support tickets. Users forgive degraded behaviour when they can see it.&lt;/p&gt;
      &lt;blockquote&gt;The test I keep coming back to: put the phone in flight mode and try to finish your onboarding. If you cannot, the app is online-only with nicer error copy.&lt;/blockquote&gt;</content:encoded>
    </item>
    <item>
      <title>Designing a unified inbox across four messaging providers</title>
      <link>https://eng-apdow.vercel.app/blog/unified-inbox-architecture</link>
      <guid isPermaLink="true">https://eng-apdow.vercel.app/blog/unified-inbox-architecture</guid>
      <pubDate>Wed, 02 Jul 2025 09:00:00 GMT</pubDate>
      <description>WhatsApp, Instagram, Messenger and Telegram all model conversations differently. Here is the normalisation layer that made MideSync possible.</description>
      <category>Architecture</category>
      <category>Realtime</category>
      <category>AI</category>
      <content:encoded>&lt;p&gt;Every provider thinks it invented messaging. WhatsApp gives you phone-number identities and 24-hour session windows; Instagram hides the username behind a scoped ID; Telegram happily lets bots edit messages; Messenger fires webhooks for things you never asked for.&lt;/p&gt;
      &lt;h2&gt;The conversation model&lt;/h2&gt;
      &lt;p&gt;I normalised everything into three tables: &lt;code&gt;contacts&lt;/code&gt; (one human, many channel identities), &lt;code&gt;conversations&lt;/code&gt; (a thread bound to a channel identity) and &lt;code&gt;messages&lt;/code&gt; (append-only, provider-agnostic).&lt;/p&gt;
      &lt;pre&gt;&lt;code&gt;messages
  id            uuid
  conversation  uuid
  direction     &apos;in&apos; | &apos;out&apos;
  provider      enum
  provider_ref  text   -- external id, unique per provider
  body          jsonb  -- normalised blocks
  sent_at       timestamptz
  state         &apos;queued&apos; | &apos;sent&apos; | &apos;delivered&apos; | &apos;read&apos; | &apos;failed&apos;&lt;/code&gt;&lt;/pre&gt;
      &lt;h2&gt;Idempotency is the whole game&lt;/h2&gt;
      &lt;p&gt;Webhooks retry. Users double-send. A unique index on &lt;code&gt;(provider, provider_ref)&lt;/code&gt; plus an upsert means replays are free, and the realtime layer never has to reason about duplicates.&lt;/p&gt;
      &lt;h2&gt;Where AI belongs&lt;/h2&gt;
      &lt;p&gt;Not in the write path. AI triage subscribes to new inbound messages, writes a &lt;em&gt;suggestion&lt;/em&gt; row, and a human (or an automation rule) decides. That keeps a bad model response from ever reaching a customer unflagged.&lt;/p&gt;
      &lt;blockquote&gt;The moment a product claims “one inbox”, the hard part is not the UI. It is agreeing on what a message &lt;em&gt;is&lt;/em&gt;.&lt;/blockquote&gt;</content:encoded>
    </item>
    <item>
      <title>Motion that respects people: reduced-motion as a first-class state</title>
      <link>https://eng-apdow.vercel.app/blog/accessible-motion</link>
      <guid isPermaLink="true">https://eng-apdow.vercel.app/blog/accessible-motion</guid>
      <pubDate>Fri, 11 Apr 2025 09:00:00 GMT</pubDate>
      <description>Scroll-driven reveals, parallax and glitch effects are lovely — until they make someone nauseous. A practical checklist.</description>
      <category>Accessibility</category>
      <category>CSS</category>
      <category>Front-end</category>
      <content:encoded>&lt;p&gt;Roughly one in three adults is sensitive to large motion. When a portfolio site animates the whole viewport, that is not a flourish — it is a barrier.&lt;/p&gt;
      &lt;h2&gt;Start with the media query, not the animation&lt;/h2&gt;
      &lt;pre&gt;&lt;code&gt;@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}&lt;/code&gt;&lt;/pre&gt;
      &lt;p&gt;That single rule killed every infinite loop on this site, including the glitch canvas and the logo marquee.&lt;/p&gt;
      &lt;h2&gt;Keep the information, drop the travel&lt;/h2&gt;
      &lt;p&gt;A section that fades in should still appear instantly; it just should not slide 200px while doing it. Opacity is far gentler than transform.&lt;/p&gt;
      &lt;h2&gt;Test with the real setting&lt;/h2&gt;
      &lt;p&gt;macOS: Accessibility → Display → Reduce motion. Windows: Settings → Accessibility → Visual effects → Animation effects. Enable it and browse your own site for five minutes.&lt;/p&gt;</content:encoded>
    </item>
  </channel>
</rss>
