The game is simple. Five questions, two options each. Pirates or Ninjas. Coffee or Tea. Mountains or Ocean. You pick, and immediately see the global percentage split. That is the whole thing.
The design constraint that shapes everything else: the entire game must fit in one viewport. No scrolling. All five questions, the header, the share bar — one screen, whatever the device.
Why No Scroll
The virality mechanism depends on the game feeling instant. You see the question, you tap your answer, the percentages reveal. If the game requires scrolling, there is friction. Friction breaks the rhythm. The rhythm is the game.
So the layout is built around 100dvh with a flex column that divides available height equally across the five question rows. Every component in the chain declares either shrink-0 (fixed height, doesn’t compress) or flex-1 min-h-0 (takes what’s left, can compress). Emoji and label text use clamp() with dvh units so they scale vertically rather than overflowing. The cards get smaller on a short phone. They never push outside the screen.
dvh rather than vh, because vh on mobile includes the browser’s address bar in its calculation. On iOS Safari this means the bottom of the page disappears behind the bar. dvh is the dynamic version that excludes it. This is the kind of thing you discover when you test on an actual phone rather than a browser with the device toolbar open.
The Daily Questions
The original model was a scheduled question set: create a row in the database for each calendar date, assign five questions, done. This works fine until you want to add more questions retroactively, or change the rotation without rewriting the schedule.
The current model is a question pool. All questions live in the same table. Each day, five are selected by a deterministic seeded random number generator — the same five for every player worldwide, with no server coordination required.
The seed comes from the date string. A djb2 hash converts it to a 32-bit integer. A Mulberry32 PRNG is seeded with that integer. Fisher-Yates shuffles the pool. The first five IDs are today’s questions. Both the questions API and the votes API call this function independently and always agree on which five questions are active, without talking to each other.
The old scheduled rows still exist in the database. They just join the pool. Existing vote data is unaffected.
Counting Votes Without Racing
The vote table is the raw record of individual choices. The stats page cannot query it directly at scale — COUNT(*) FILTER (WHERE choice = 'a') across millions of rows is a table scan. So there is a question_stats table with one row per question: total_votes_a and total_votes_b, kept in sync by the vote API.
Every POST /api/vote handles one of three cases. New vote: insert with an increment. Same choice again: no-op. Changed choice: a single UPDATE that decrements one column and increments the other in the same statement. The arithmetic happens in the database in a single operation, so there is no read-modify-write window for concurrent requests to corrupt the count. No transaction needed.
The stats page reads from question_stats. One row per question, always consistent, always fast.
Share Text as Gameplay
The share button appears after all five choices are made. The text it generates looks like this:
💥 THIS OR THAT: DAILY SHOWDOWN 💥
🏴☠️ Pirates (Chosen by 62%)
☕ Coffee (Chosen by 88%)
🏔️ Mountains (Chosen by 45%)
🐶 Dogs (Chosen by 71%)
🦉 Night Owl (Chosen by 33%)
Play now: https://thisorthat.baudypositive.com
The percentages are in the share text. Someone who hasn’t played sees the results before they know the questions. The natural response is to wonder what they would have chosen. This is the loop.
Share priority is: native share sheet on mobile, clipboard copy on desktop, WhatsApp deep link always present. The game generates a dynamic OG image via @vercel/og on Vercel’s edge network so the link preview shows the results card rather than a generic site image.
Challenge Mode
There are two variants, added after the core game was working.
The first is PREDICTION, or Mind Reader. You predict what a specific person will choose across the five questions, generate a link, and send it to them. They play normally. The results page scores your predictions against their actual choices.
The second is PROVOCATION, or Soul Searcher. You lock in your own daily choices, generate a link, and challenge someone to guess what you picked. Same comparison logic, different framing.
Both use a single UUID in the database as the link between the two sessions. No shared tokens, no auth handoff. The UUID is the access key. The question text is embedded in the challenge row at creation time, so the challenge remains valid after the daily question set rotates.
Each completed attempt gets its own permanent results URL. The share from the results page links to the scorecard rather than the play link, so the recipient can share their score without the recipient’s recipient immediately replaying it.
The Stack
Next.js 15. Neon Serverless Postgres with Drizzle ORM. Neon’s HTTP driver makes each query over HTTPS with no persistent TCP connections, which on a serverless platform means no connection pool, no PgBouncer, and no “too many connections” error when something gets unexpectedly popular.
NextAuth.js for Google sign-in. JWT sessions rather than database sessions — the user’s Neon profile UUID is baked into the signed cookie, so authenticated requests require no database lookup to establish identity. Framer Motion for card animations and the reveal sequence. canvas-confetti, as always.
Sign-in is optional. Guests play fine. Authenticated users get their vote history saved to their profile and appear on the leaderboard.
RESULT
It’s live at thisorthat.baudypositive.com. The single-screen layout holds across the phones it has been tested on. The seeded daily selection means everyone is playing the same game. The challenge mode works. The share text does its job.
The most useful architectural decision in retrospect was the stats summary table. It costs one extra write per vote and saves a potentially expensive query on every stats page view. For a game built to be shared, the stats page is not incidental traffic.
Five questions. No scrolling. Pirates, obviously.