# The check-in app is one web page and two wrappers

> A tablet by the door where members check themselves in: a Next.js app, then iOS and Android apps that render exactly that page in a WebView and carry no product logic. Along the way I built, tested and shipped a subsystem, then deleted it eight days later.

- Author: Deyan Peev (https://deyanpeev.com)
- Published: 2026-09-19
- Tags: React Native, Next.js, Mobile, Frontend, TypeScript
- URL: https://deyanpeev.com/posts/the-check-in-app-is-one-web-page-and-two-wrappers

A gym wants a tablet by the door. A member walks up, holds their phone's QR
code to it or taps in a PIN, and the screen goes green. The front desk isn't
involved, because at 18:25 on a Tuesday the front desk has a queue.

We already had a kiosk. It had been in the product since last autumn, and it
works with a staff member standing behind it who finds the person and confirms
the check-in. The obvious move was to add a mode to it. I started a new app
instead, and then that app grew two native wrappers over the summer. This is
what each of those decisions bought.

# Why not a mode on the kiosk

The two screens look similar and have almost nothing in common underneath.

The staff kiosk is operated by someone who works there. It can show an error
code, because the person reading it knows what to do with one. It can leave
a screen open on the last member, because the operator moves it on. It assumes
a trained user and a supervised device.

A self-service tablet assumes neither. Everything it says is read by a
stranger, in the language their gym picked, once, while somebody waits behind
them. It has to reset itself, because no one else will. It has to be unusable
as a web browser, because it's mounted on a wall in a public room. That is a
different app, with a different set of things it is allowed to do, and I don't
think feature flags would have covered it.

The cost of two surfaces showed up a month later, somewhere I didn't predict.
Both apps send the same `public_kiosk` product header and share the same
session cookie. So when we added a `source` column to every check-in (so a club
can see whether an entry came from reception, the member's phone, an
instructor, or the door) the header could not tell the two kiosks apart. It had
to be passed explicitly by the routes, and the mapping table in
`server/lib/checkin-source.ts` now carries a comment explaining why
`PUBLIC_KIOSK` is left unmapped, in a column that exists to tell the two apart.

# The organisation comes from the hostname, and from nothing else

Each club gets `{slug}.checkin.1club.ai`. The proxy resolves the slug off the
host, sets it as a header, and every request downstream carries it. There is
no path fallback and no query parameter.

A tablet can't be pointed at the wrong club by a mistyped link, and no screen
in the app has to ask "which organisation is this", because the answer arrived
with the request. It's also why the native wrapper needs a setup screen at all,
but I'll come to that.

# Identification is not eligibility

The first version did what the staff kiosk did, one call that took a QR code
or a PIN and came back with a check-in. Three weeks in I split it, and that
split is the one I'd keep in any similar app.

A member can identify themselves three ways (scan a QR code, type a PIN, or
have someone pick their name out of a search), and one of those produces no
code at all. Meanwhile there are four or five things that can happen *next*:
they have a booking starting in ten minutes, they have no booking and the club
offers a class list, they are on an open-gym membership, they owe money, the
class is full.

Folding those together meant every new outcome touched every entry path.
`/v1/kiosk/identify` now takes a PIN, a code or a known contact id and returns
just one thing, who this is plus what they already hold. What happens next is
the screen's decision. The check-in flow itself works purely on contact ids and
has never heard of a QR code.

# The screen only ever says what the server said

The staff kiosk uses a two-phase API. It resolves the check-in to a target,
shows the operator what it found, then commits. The self-service app reuses
both phases and drops the human in the middle, so a resolved target is
committed immediately.

What it doesn't do is decide the outcome. There are three result screens: green
for done, amber for "you are in, but there is a payment outstanding", orange
for "see the front desk". The variant is derived only from the server's
response, with no client-side "this looks like an error". An amber screen
appears because the server said `checked_in_payment_pending`. I'd rather send a
member to reception than have them stand in front of a screen that disagrees
with the ledger.

# Because it is mounted on a wall

**The camera is app-lifetime and ref-counted.** `getUserMedia` costs one to two
seconds of black screen on iPadOS, and the home screen is re-entered after
every single check-in. Worse, the shell remounts the current screen on every
idle reset (it's meant to), so a per-mount camera stream would tear the
device's camera down and re-acquire it on a timer, blinking the privacy
indicator all day. The stream is a React-free module with a retain count and a
twenty-second grace period, so a route change costs nothing and walking away
turns the camera off.

**QR decoding has two back ends.** The browser's native `BarcodeDetector`
where it exists, `@zxing/browser` dynamically imported everywhere else. Native
is free and far more tolerant of a phone held at an angle. It's also absent on
every iOS browser, and that is most of the tablets this ships on. The native
path is gated on `getSupportedFormats()` and not on the constructor existing,
because a constructor that exists and then resolves `[]` forever is a scanner
that silently never fires.

**The background adapts to the club's photo.** Clubs upload their own splash
background, and a dark photo makes black text invisible. A single whole-screen
light-or-dark decision is wrong somewhere on a real photo (bright wall at the
top, dark floor at the bottom). So the image is sampled once into a small
luminance field, and each cluster of UI reads the slice of the photo behind
itself and themes itself from that. Every colour is a CSS variable, so regions
morph between black and white ink instead of hard-cutting.

# Where the browser ran out

By mid-August the web app was doing its job and the deployment story wasn't.

A tablet in a browser sleeps. It shows a camera permission dialog on page
loads. Its address bar is one tap from becoming a web browser in a public room.
And it has no way to recover from its own renderer dying, which on an always-on
device running a camera stream is a matter of when. These aren't product
problems, but they separate a demo from something that survives a year on a
wall.

So it got a React Native wrapper, on both platforms, rendering
`https://{slug}.checkin.1club.ai` in a full-screen WebView.

It carries no product logic at all. Every screen a member or a staff member
sees comes from the web app, which still deploys from CI on merge.
The wrapper carries the four things a browser can't do:

- **Provisioning.** Because the org comes from the host, the wrapper has to be
  told which one before it can load anything. The setup screen takes either a
  bare slug or a fully allow-listed hostname. The second form lets support
  point a production build at staging without shipping a hidden environment
  switcher. The environment itself is a property of the build, read from the
  update channel, so the internal-distribution profile hits staging and a store
  build hits production, with no code branch and nothing to toggle.
- **A navigation allow-list.** Check-in hosts and the auth host, http(s) only,
  top-level navigations only. Everything else is refused and never handed to
  the system browser, because a kiosk must not become a launcher into Safari.
- **Process-death recovery.** On iOS, `onContentProcessDidTerminate` reloads,
  because the `WKWebView` object survives a jetsam and the current page is
  kept. On Android the view is already dead when `onRenderProcessGone` arrives,
  so `reload()` has nothing to act on and the fix is a key bump that remounts
  it. Get these two backwards and you have a white screen that stays white
  until a human walks past, and on a wall mount that's hours.
- **One camera permission, once.** Android's permission is requested before the
  WebView mounts, which turns the web request into the silent grant path. On
  iOS, `mediaCapturePermissionGrantType="grantIfSameHostElseDeny"` replaces a
  dialog on every page load with the single OS prompt during setup.

Nearly every remaining prop on that WebView matters, and several of them match
their defaults, so they are written down with reasons.
`incognito={false}` is what stops every gym re-authenticating each morning, because
`true` swaps the disk-backed data store for one that's wiped on relaunch.
`textZoom={100}` is there because Android scales WebView text by the system
font-size setting and the check-in shell is a fixed seven-column grid (a break
you will never reproduce on your own device). And the app is deliberately *not*
`scrollEnabled={false}`, because on WKWebView that can break `overflow: auto`
descendants, and the member search results are one of those. `bounces={false}`
gets the same kiosk feel without the risk.

The wrapper does take one thing away, social sign-in. Google returns
`disallowed_useragent` for OAuth started in an embedded WebView as a matter of
policy, and punting to the system browser doesn't help either, because the
token would land in the system browser's storage and never reach the WebView.
The wrapper appends a marker to the user agent, the check-in app passes
`embedded=1` to the auth app, and the auth app renders no social buttons. So
the caller declares it and the auth app doesn't sniff user agents, which keeps
the check on the side that knows about the wrapper.

# The subsystem I deleted eight days after shipping it

The wrapper landed on 9 August with a screen-size orientation lock, and that
lock was the most carefully built thing in the workspace.

The rule was simple to state. Under 8.5 inches of screen diagonal, run
portrait; at 8.5 and above, run landscape. Getting the diagonal is not simple.
On Android you can compute it, because a dp is defined as 1/160 inch and the
density cancels out of the arithmetic. On iOS you can't. Points-per-inch is
163 on iPhones and the iPad mini but 132 on every other iPad, so the naive
calculation puts an iPad mini 6 at 8.47 inches, which is on the correct side of
the line by three hundredths of an inch and only by luck.

So iOS was classified by family instead, using the bound that is adversarial to
the decision: largest iPhone ever shipped, largest mini ever shipped, smallest
non-mini iPad ever shipped. If the decision holds at the bound it holds for
every member of the family. The module imported nothing at all so it could be
unit-tested under plain vitest, and it had 292 lines of tests. It reported a
confidence level and the margin in inches, so that a shaky decision would be
visible.

On 17 August I deleted all of it. Both platforms had withdrawn the ability it
depended on:

- **Android 16 / API 36** ignores `android:screenOrientation`, aspect-ratio
  limits and `setRequestedOrientation()` entirely on displays 600dp and wider.
  That's the hardware class this app targets, so the lock was a silent no-op
  on every Android tablet.
- **iPadOS 26** deprecated `UIRequiresFullScreen` with no replacement, and
  declared orientations are ignored at launch and on rotation whenever the
  device's rotation lock is off. The one alternative Apple's technote points at
  is documented as a preference, not a guarantee.

In hindsight the subsystem had been solving the problem in the wrong place for
a month, and the platforms made that impossible to ignore. A 7-inch tablet
needed forcing into portrait because the layout only worked in landscape above
1024px. With that fixed, there's nothing to force.

So the answer moved into CSS. Orientation isn't a layout input anywhere in the
app now, no `@media (orientation: ...)` and no JavaScript. `orientation: landscape`
means exactly `width > height` and carries no magnitude, so it is equally true
of a 1194×834 iPad and an 852×393 phone, and those two screens need opposite
treatments. That's how the old rule got trapped. Its width half was a proxy for
what mattered, and its orientation half silently switched every landscape phone
back to the portrait layout.

Now every vertical metric is `clamp(min, min(<vw>, <dvh>), max)`, so it can
never outgrow either axis and rotating a device can only ever make it smaller.
The identification pane asks a container query and not the viewport, because
that pane is the viewport minus the header minus the tab strip, and the
viewport can't answer for it. Every clamp cap equals the old desktop value, so
the tablets already on walls render byte-identical to what they rendered before,
while a portrait tablet finally gets the desktop scale instead of the phone one.

What's left on the native side is a deployment checklist: mount the tablet,
rotate it, *then* turn on the device's rotation lock, and enable Guided Access
or screen pinning. Those are OS-enforced and need zero app code. The app follows
the device and renders correctly either way up, so a tablet showing the "wrong"
orientation gets fixed in the device's settings now.

# Two apps out of one page

iOS went to TestFlight in mid-August, Android to the Play Console on the 18th.
Two store listings, one bundle id per platform, one codebase that is a hundred
lines of navigation policy and a WebView.

What takes the most attention is the publishing split. The runtime version
follows the app version, so a JavaScript-only change ships as an over-the-air
update and the version must *not* move. Anything native (a dependency added or
removed, an `app.json` change, an SDK bump) needs a full build *and* a
hand-written version bump. That bump isn't automated, the auto-increment setting
moves the build number and the Android version code only. Get it wrong and you
have a new binary advertising an unchanged runtime version, which makes it
eligible for an already-published bundle that imports a native module the
binary no longer has. That fails before mount, no error boundary catches it,
and the symptom is a permanent white screen on a wall-mounted tablet. The
orientation deletion was this case, two native modules removed, so it went out
as 1.0.1 and a full build and not as an update.

There's a ship gate for the related failure. It is a script that boots the
*embedded* release bundle and counts registered native modules, because Metro
and OTA updates both mask registration failures. The count it checks against is
written down along with what a healthy build produced and when. A threshold
with no provenance would pass vacuously the first time someone changes the
dependency graph.

# The wrappers, added up

Roughly two hundred lines of TypeScript per platform, no product logic, and a
release process I have to think about. For that, the screen never sleeps, the
camera prompt happens once, a dead renderer heals itself in under a second,
flaky gym wifi retries on a backoff ladder instead of sitting on an error, and
the device is pinned inside one app by the operating system and not by hiding
UI.

The two store apps are pretty much mounting hardware. Everything a member sees
is still one Next.js app that deploys on merge like everything else we run.
