<?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: Raj Bhadane</title>
    <description>The latest articles on DEV Community by Raj Bhadane (@rajbhadane).</description>
    <link>https://dev.to/rajbhadane</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%2F4284796%2Fa1388c48-1026-4f48-8f56-8b54083f51c4.jpg</url>
      <title>DEV Community: Raj Bhadane</title>
      <link>https://dev.to/rajbhadane</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rajbhadane"/>
    <language>en</language>
    <item>
      <title>Building from Nashik: why my latest app only counts what two people agree on</title>
      <dc:creator>Raj Bhadane</dc:creator>
      <pubDate>Sat, 05 Dec 2026 22:34:36 +0000</pubDate>
      <link>https://dev.to/rajbhadane/building-from-nashik-why-my-latest-app-only-counts-what-two-people-agree-on-1hio</link>
      <guid>https://dev.to/rajbhadane/building-from-nashik-why-my-latest-app-only-counts-what-two-people-agree-on-1hio</guid>
      <description>&lt;p&gt;I'm Raj Bhadane, a developer from Nashik, Maharashtra. Since 2021 I've been CTO at Indigen Services, an AI and SaaS studio, and this year I co-founded Prospecx with my brother Yash. This month I shipped something smaller and more personal: &lt;strong&gt;Commitment: Shared Promises&lt;/strong&gt;, a free Android app.&lt;/p&gt;

&lt;p&gt;This post is about why it exists and what I learned building it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem I kept seeing
&lt;/h2&gt;

&lt;p&gt;Almost every small agreement between two people lives in one person's memory, or one person's notebook.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The milk delivery count at the end of the month.&lt;/li&gt;
&lt;li&gt;How many days the help at home came.&lt;/li&gt;
&lt;li&gt;The ₹2,000 a friend borrowed in March.&lt;/li&gt;
&lt;li&gt;A gym streak with a friend that "definitely" didn't break last Tuesday.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When the record belongs to one side, the other side has to trust it, or argue about it. Neither feels good.&lt;/p&gt;

&lt;h2&gt;
  
  
  One rule
&lt;/h2&gt;

&lt;p&gt;Commitment is built around a single rule: &lt;strong&gt;an entry only counts once the other person confirms it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of you marks that something happened: a day done, an amount, a session. The other gets it and confirms with one tap. Only then does it get a double tick and lock for both of you. Progress, streaks and monthly statements count confirmed entries only.&lt;/p&gt;

&lt;p&gt;A few things follow from that rule:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nobody can confirm their own entry. (The database enforces it, not just the UI. I wrote about the Postgres side &lt;a href="https://dev.to/rajbhadane/modeling-a-two-signature-record-in-postgres-one-person-marks-the-other-confirms-n74"&gt;here&lt;/a&gt;.)&lt;/li&gt;
&lt;li&gt;Requests expire after 48 hours, so nothing piles up unanswered.&lt;/li&gt;
&lt;li&gt;A waiting mark can be undone; a confirmed one stays for both.&lt;/li&gt;
&lt;li&gt;Only the two people in a commitment can see it. No feed, no public profile.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What surprised me
&lt;/h2&gt;

&lt;p&gt;I started with household use cases in mind: milk, help at home, money lent. The first people I showed it to immediately used it for other things: a reading goal with a child, a coach's 30-day deal with a client, a couple's workout streak. The mechanic is the product. The use case is whatever two people already promise each other.&lt;/p&gt;

&lt;p&gt;So the app doesn't lead with any single chore. It's a shared record for any promise between two people.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it's built
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;React Native with Expo, Android first (iPhone is in review).&lt;/li&gt;
&lt;li&gt;Supabase (Postgres + row-level security) so each commitment is visible only to its two members.&lt;/li&gt;
&lt;li&gt;English and Hindi from day one, because many of the people who need this most in India think in Hindi.&lt;/li&gt;
&lt;li&gt;Free, no ads, and it never handles money. Payments stay between you.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Building from a smaller city
&lt;/h2&gt;

&lt;p&gt;People sometimes assume products like this come out of Bengaluru. Nashik is a good place to build: the problems are close, the users are your neighbours, and you notice the small frictions that big-city products miss.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Commitment is free on Google Play: &lt;a href="https://play.google.com/store/apps/details?id=app.commitment.android" rel="noopener noreferrer"&gt;https://play.google.com/store/apps/details?id=app.commitment.android&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;More about the app: &lt;a href="https://commitment.live" rel="noopener noreferrer"&gt;https://commitment.live&lt;/a&gt;. More about me and the other things I've built: &lt;a href="https://commitment.live/raj-bhadane" rel="noopener noreferrer"&gt;https://commitment.live/raj-bhadane&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you use it with someone, I'd love to hear what you track. That's how the app gets better.&lt;/p&gt;

</description>
      <category>startup</category>
      <category>android</category>
      <category>buildinpublic</category>
      <category>india</category>
    </item>
    <item>
      <title>Modeling a two-signature record in Postgres: one person marks, the other confirms</title>
      <dc:creator>Raj Bhadane</dc:creator>
      <pubDate>Sat, 05 Dec 2026 13:19:00 +0000</pubDate>
      <link>https://dev.to/rajbhadane/modeling-a-two-signature-record-in-postgres-one-person-marks-the-other-confirms-n74</link>
      <guid>https://dev.to/rajbhadane/modeling-a-two-signature-record-in-postgres-one-person-marks-the-other-confirms-n74</guid>
      <description>&lt;p&gt;I'm building Commitment, a small Android app (iOS is in review) for counts that two people share: milk deliveries, a maid's attendance, money lent to a friend, a gym streak. The whole product is one rule: &lt;strong&gt;an entry only counts once the other person confirms it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That rule turned out to be a nice little data-modeling problem. Here is how it ended up in Postgres on Supabase, with the actual constraints from the migration.&lt;/p&gt;

&lt;h2&gt;
  
  
  The mark table
&lt;/h2&gt;

&lt;p&gt;Every "this happened" is a row in &lt;code&gt;marks&lt;/code&gt;, with a small state machine in a &lt;code&gt;check&lt;/code&gt; constraint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;create&lt;/span&gt; &lt;span class="k"&gt;table&lt;/span&gt; &lt;span class="n"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;marks&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="kt"&gt;uuid&lt;/span&gt; &lt;span class="k"&gt;primary&lt;/span&gt; &lt;span class="k"&gt;key&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;gen_random_uuid&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;span class="n"&gt;commitment_id&lt;/span&gt; &lt;span class="kt"&gt;uuid&lt;/span&gt; &lt;span class="k"&gt;not&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="k"&gt;references&lt;/span&gt; &lt;span class="n"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;commitments&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;on&lt;/span&gt; &lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="k"&gt;cascade&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;day&lt;/span&gt; &lt;span class="kt"&gt;date&lt;/span&gt; &lt;span class="k"&gt;not&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;marked_by&lt;/span&gt; &lt;span class="kt"&gt;uuid&lt;/span&gt; &lt;span class="k"&gt;not&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="k"&gt;references&lt;/span&gt; &lt;span class="n"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;profiles&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;on&lt;/span&gt; &lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="k"&gt;cascade&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;marked_at&lt;/span&gt; &lt;span class="kt"&gt;timestamptz&lt;/span&gt; &lt;span class="k"&gt;not&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nb"&gt;now&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;span class="n"&gt;status&lt;/span&gt; &lt;span class="kt"&gt;text&lt;/span&gt; &lt;span class="k"&gt;not&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="s1"&gt;'waiting'&lt;/span&gt;
    &lt;span class="k"&gt;check&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'waiting'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'confirmed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'rejected'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'expired'&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;span class="n"&gt;responded_by&lt;/span&gt; &lt;span class="kt"&gt;uuid&lt;/span&gt; &lt;span class="k"&gt;references&lt;/span&gt; &lt;span class="n"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;profiles&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;on&lt;/span&gt; &lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;responded_at&lt;/span&gt; &lt;span class="kt"&gt;timestamptz&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="k"&gt;check&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;responded_by&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="k"&gt;or&lt;/span&gt; &lt;span class="n"&gt;responded_by&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;marked_by&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;p&gt;The last line does a lot of work. &lt;strong&gt;You cannot confirm your own mark.&lt;/strong&gt; No app logic needs to remember that, because the database refuses it.&lt;/p&gt;

&lt;h2&gt;
  
  
  One live mark per day
&lt;/h2&gt;

&lt;p&gt;Two people tapping "mark today" at the same moment shouldn't produce two entries. A partial unique index handles it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;create&lt;/span&gt; &lt;span class="k"&gt;unique&lt;/span&gt; &lt;span class="k"&gt;index&lt;/span&gt; &lt;span class="n"&gt;marks_one_live_per_day&lt;/span&gt;
  &lt;span class="k"&gt;on&lt;/span&gt; &lt;span class="n"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;marks&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;commitment_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;day&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;where&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'waiting'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'confirmed'&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;Rejected and expired marks don't block the day, so after a "no" you can mark again with the right amount. Waiting and confirmed ones do block it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Expiry without a cron job
&lt;/h2&gt;

&lt;p&gt;Requests that sit unanswered shouldn't pile up into a month of claims someone confirms blindly on the 30th. Waiting marks expire after 48 hours. I don't run a scheduler for this. The functions that work on a commitment's marks call this first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;create&lt;/span&gt; &lt;span class="k"&gt;or&lt;/span&gt; &lt;span class="k"&gt;replace&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;expire_marks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cid&lt;/span&gt; &lt;span class="kt"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;returns&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt; &lt;span class="n"&gt;language&lt;/span&gt; &lt;span class="n"&gt;sql&lt;/span&gt; &lt;span class="n"&gt;security&lt;/span&gt; &lt;span class="n"&gt;definer&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="n"&gt;search_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;public&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; $$
  &lt;span class="k"&gt;update&lt;/span&gt; &lt;span class="n"&gt;marks&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'expired'&lt;/span&gt;
  &lt;span class="k"&gt;where&lt;/span&gt; &lt;span class="n"&gt;commitment_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cid&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'waiting'&lt;/span&gt;
    &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;marked_at&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nb"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="kt"&gt;interval&lt;/span&gt; &lt;span class="s1"&gt;'48 hours'&lt;/span&gt;
$$&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lazy expiry keeps the state correct whenever anyone touches it, which is the only time it matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  Undo, but only for your own waiting mark
&lt;/h2&gt;

&lt;p&gt;Mistakes happen ("I tapped 2 litres, meant 1"). The person who made a mark can withdraw it while it is still waiting, and not after:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;marks&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;
 &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="n"&gt;commitments&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;
 &lt;span class="k"&gt;where&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p_mark&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;marked_by&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;uid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'waiting'&lt;/span&gt;
   &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;commitment_id&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'active'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="k"&gt;not&lt;/span&gt; &lt;span class="n"&gt;found&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt; &lt;span class="n"&gt;raise&lt;/span&gt; &lt;span class="n"&gt;exception&lt;/span&gt; &lt;span class="s1"&gt;'can only undo your own waiting mark'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;end&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once confirmed, an entry is locked for both people. That's the point of the whole thing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Everything reads from the confirmed set
&lt;/h2&gt;

&lt;p&gt;Streaks, the progress ring and the month-end bill never count waiting rows. The bill is a sum over &lt;code&gt;status = 'confirmed'&lt;/code&gt;, so "what do I owe" and "what did we agree on" are the same query.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writes go through RPCs, not table grants
&lt;/h2&gt;

&lt;p&gt;Clients can't &lt;code&gt;insert&lt;/code&gt; or &lt;code&gt;update&lt;/code&gt; marks directly. All state changes go through &lt;code&gt;security definer&lt;/code&gt; functions (&lt;code&gt;mark_day&lt;/code&gt;, &lt;code&gt;respond_mark&lt;/code&gt;, &lt;code&gt;undo_mark&lt;/code&gt;) that check &lt;code&gt;auth.uid()&lt;/code&gt; against the commitment's two members. Row-level security walls each pair's data off for reads. This keeps the state machine in one place instead of spread across the React Native client.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;I added &lt;code&gt;strict&lt;/code&gt; to the respond function late, after realising a &lt;code&gt;null&lt;/code&gt; decision was being read as "no". Make nulls explicit from day one.&lt;/li&gt;
&lt;li&gt;Freeze history when a commitment ends. I added that in a later migration. It should have been in the first one.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you've modeled something similar (two-party approvals, dual sign-off), I'd like to hear how you handled expiry. The app is free with no ads: &lt;a href="https://play.google.com/store/apps/details?id=app.commitment.android" rel="noopener noreferrer"&gt;Google Play&lt;/a&gt;, and the site is &lt;a href="https://commitment.live" rel="noopener noreferrer"&gt;commitment.live&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>supabase</category>
      <category>reactnative</category>
      <category>database</category>
    </item>
  </channel>
</rss>
