Work/No. 02 · Progressive web app

Ground Rules

A personal punch card for deliberate choices. Set your limit, write down why, and earn every punch.

My role
Idea, design and build
Stack
React · TypeScript · Vite · PowerSync · Supabase
Type
Installable web app that works offline
Status
In progress · invite only
Users
Two: me and a friend
yourgroundrules.com
The Ground Rules sign-in page: Set the standard. Keep your word.
My Drinks on my terms card in the app, with one slot punched.
01

Why I built it

For the last two and a half years I've been working on my health and training for Spartan races. In that time I've mostly quit drinking.

I'm not against a drink. But when I decided to have one, it sometimes turned into two, three or six. Then a few beers the next week felt easier, and so on. If I'm going to drink, I want it to be intentional: know why I'm having this one, and go through a ritual that makes me work for it.

Trust me, doing 30 burpees really makes you think about how much you really want that next drink.

Ground Rules works for any habit you want to keep on your own terms. Drinks are just where it started.

02

How a card works

A card has a time period, a number of punches, your why, and an optional ritual. Mine is 24 drinks over 12 months. My why: I want to maintain my health and to ensure I am always available to help family and friends.

Each punch saves the time, your confirmation that you did the ritual, and an optional note. You can look back through every punch whenever you like. Try a demo card below. It isn't connected to anything.

Personal standard / Ground RulesDemo

Drinks on my terms

12 months · 24 punches
24remainingNo. DEMO · 1/1
Before you punch

Make this one count.

  1. Stop and think. Do I really want this drink?
  2. What makes it worth it on this occasion?
  3. Earn it first: 30 burpees.

The back of my card, showing my why and my ritual.
Flip a card to see your why and your ritual.
03

Honest over perfect

What happens when you run out of punches early? Nothing gets locked. The card keeps recording, and you're encouraged to keep punching past your limit. Try it on the demo card above: the 25th punch still counts.

It's hard to change habits if you start hiding them. If you can't stay honest with yourself, it's going to be hard to follow through on anything in life.
04

Under the hood

Ground Rules is local-first. A punch saves to a database on your device straight away, then syncs when there's a connection. That means it works at the trailhead, at the cottage and in a basement bar.

React + TypeScript + VitePlain CSS. No UI kit, router or state library.
PowerSyncSQLite in the browser, with reactive queries and background sync.
SupabaseEmail-code sign-in and Postgres policies scoped to each owner.
Separate local databasesOne per account, plus a demo mode that never leaves the device.
Installable PWAService worker for offline use, and JSON export of your data.

It's my first progressive web app, and there's cleanup to do. Signing in with an email code means no password to remember, which is handy, but I may change it.

05

Before it opens up

  • End-to-end encryption. I don't want to be able to read what people put on their cards. If there's ever a breach, their data should be useless to whoever takes it.
  • A design pass before release.
  • Better sync and offline behaviour, now that I know what a PWA needs.
Two users today: me and one friend.

Invites open up once encryption is in.

Next pattern · No. 03

Designs by de Vries →