<?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: Jawad Ur Rehman</title>
    <description>The latest articles on DEV Community by Jawad Ur Rehman (@jawad_urrehman_c9ec7a21f).</description>
    <link>https://dev.to/jawad_urrehman_c9ec7a21f</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%2F4266941%2Fc44a7873-dd4d-401a-9019-32831f06ebe9.jpg</url>
      <title>DEV Community: Jawad Ur Rehman</title>
      <link>https://dev.to/jawad_urrehman_c9ec7a21f</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jawad_urrehman_c9ec7a21f"/>
    <language>en</language>
    <item>
      <title>Building Offline-First Apps for Pakistan's Load-Shedding with Kiro</title>
      <dc:creator>Jawad Ur Rehman</dc:creator>
      <pubDate>Thu, 26 Nov 2026 12:50:25 +0000</pubDate>
      <link>https://dev.to/jawad_urrehman_c9ec7a21f/building-offline-first-apps-for-pakistans-load-shedding-with-kiro-1jjo</link>
      <guid>https://dev.to/jawad_urrehman_c9ec7a21f/building-offline-first-apps-for-pakistans-load-shedding-with-kiro-1jjo</guid>
      <description>&lt;p&gt;In Pakistan, small shopkeepers still track customer credit (udhaar) in paper notebooks, and small clinics still hand out paper token slips. Digital apps exist, but most of them assume the internet is always there. In reality, mobile data drops often and daily load-shedding cuts power for hours.&lt;/p&gt;

&lt;p&gt;For Kiroween, I entered the &lt;strong&gt;Skeleton Crew&lt;/strong&gt; category with &lt;strong&gt;Ghost Sync&lt;/strong&gt;: one reusable offline-first skeleton, and two complete apps built on top of it. Here is what I built, and how Kiro changed the way I worked.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Khata&lt;/strong&gt; is a digital credit ledger for kiryana shops. Shopkeepers add customers, record credit and payments, see balances, send payment reminders on WhatsApp or SMS, and view reports.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clinic Queue&lt;/strong&gt; is a patient token system for small clinics. The receptionist issues tokens like A-12, the doctor calls the next patient with one tap, and a waiting-room screen shows the current token (numbers only, never patient names).&lt;/p&gt;

&lt;p&gt;Both apps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;work fully offline after the first visit and can be installed on Android&lt;/li&gt;
&lt;li&gt;work in English and Urdu, with a full right-to-left layout&lt;/li&gt;
&lt;li&gt;sync between phones through Supabase when the internet comes back, paired with a sync code or QR code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Try them: &lt;a href="https://ghost-sync-kappa.vercel.app/" rel="noopener noreferrer"&gt;Khata&lt;/a&gt; · &lt;a href="https://ghost-sync-clinic-queue.vercel.app/" rel="noopener noreferrer"&gt;Clinic Queue&lt;/a&gt; · &lt;a href="https://github.com/jawadurrehman48/ghost-sync" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The key idea: never edit data, only add it
&lt;/h2&gt;

&lt;p&gt;The hardest part of offline-first apps is syncing. If two phones edit the same record while offline, which change wins?&lt;/p&gt;

&lt;p&gt;My answer was to make every change a new, append-only record with a UUID, a timestamp and a device ID. A payment is a record. A correction is a &lt;em&gt;reversal&lt;/em&gt; record. A customer's balance, or today's queue, is calculated from the records. Because nothing is ever edited, phones can sync in any order and never conflict.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Kiro changed my approach
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Specs before code
&lt;/h3&gt;

&lt;p&gt;Before, I would start coding and figure things out as I went. With Kiro, I wrote a spec first: requirements, then design, then tasks. I wrote three specs: the skeleton core, Khata, and Clinic Queue.&lt;/p&gt;

&lt;p&gt;Reviewing the requirements and design caught decisions early, such as storing money as integer paisa (no floating-point errors) and fixing mistakes with reversals instead of edits. Then Kiro implemented the tasks phase by phase, running the tests after each one.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Steering docs: rules written once
&lt;/h3&gt;

&lt;p&gt;My steering docs (&lt;code&gt;product.md&lt;/code&gt;, &lt;code&gt;tech.md&lt;/code&gt;, &lt;code&gt;structure.md&lt;/code&gt;) describe who the users are and the rules of the project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;every feature must work offline&lt;/li&gt;
&lt;li&gt;apps only access data through the shared skeleton&lt;/li&gt;
&lt;li&gt;every string must exist in English and Urdu&lt;/li&gt;
&lt;li&gt;only RTL-safe Tailwind classes (&lt;code&gt;ms-&lt;/code&gt;, &lt;code&gt;me-&lt;/code&gt;, &lt;code&gt;text-start&lt;/code&gt;), never &lt;code&gt;ml-&lt;/code&gt; or &lt;code&gt;text-left&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This made the biggest difference. I didn't have to repeat these rules in every prompt, and Kiro followed them in both apps.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Hooks for the boring checks
&lt;/h3&gt;

&lt;p&gt;I added two agent hooks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;auto-test-skeleton&lt;/strong&gt; runs the tests whenever a skeleton file is saved, so a change to shared code can't silently break an app&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;translation-checker&lt;/strong&gt; compares &lt;code&gt;en.json&lt;/code&gt; and &lt;code&gt;ur.json&lt;/code&gt; on save and fills in missing translations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Missing Urdu strings are an easy mistake in a bilingual app. The hook made them impossible to miss.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Property-based testing
&lt;/h3&gt;

&lt;p&gt;For logic that must never be wrong, I used property-based tests with fast-check. Instead of a few hand-written examples, they generate thousands of random cases and check rules like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;syncing in any order, with interruptions, never loses or duplicates a record&lt;/li&gt;
&lt;li&gt;a balance always equals credit minus payments&lt;/li&gt;
&lt;li&gt;token numbers never repeat across offline devices&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These tests found a real bug: with a large re-read window, sync pulls could stop moving forward. I would never have found it with normal tests. The project ends with 742 passing tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Skeleton Crew result
&lt;/h2&gt;

&lt;p&gt;Khata and the skeleton took about &lt;strong&gt;two weeks&lt;/strong&gt;. Then I wrote the Clinic Queue spec and Kiro built the whole app in about &lt;strong&gt;1.5 hours&lt;/strong&gt;, because storage, sync, Urdu support, the UI kit and helpers already existed in the skeleton.&lt;/p&gt;

&lt;p&gt;That is the point of a good template: the second app is mostly just its own screens.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Designing for offline first makes you rethink data, and append-only records make sync much simpler.&lt;/li&gt;
&lt;li&gt;Specs catch design problems before any code is written.&lt;/li&gt;
&lt;li&gt;Steering docs are the best way to keep AI-generated code consistent.&lt;/li&gt;
&lt;li&gt;Building Urdu and RTL in from day one is far easier than adding it later.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;Proper user logins (especially for patient data), testing with real shops and clinics, and more apps on the same skeleton, such as school fee tracking.&lt;/p&gt;

&lt;p&gt;Thanks for reading! You can try both apps and read the code on &lt;a href="https://github.com/jawadurrehman48/ghost-sync" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>kiro</category>
      <category>hackathon</category>
      <category>pwa</category>
      <category>offlinefirst</category>
    </item>
  </channel>
</rss>
