Back to Projects

You Only Live Once人醒着不过一万多天

Keepsake cards and a live card wall for YOLO by Dior Music Pop Up Event (Dior 大颖) at Starhill Piazza, Bukit Bintang, Kuala Lumpur, 16–18 October 2026.

ReactTypeScriptVinextTailwind CSSPythonFastAPISQLAlchemyNeon PostgresVercel

Overview

LIFE IN DAYS was the interactive experience for the three-day pop-up. Visitors scan a QR code, enter their name and birthday, and answer one question: what is the bravest thing you have done? The site works out how many days they have been alive, prints them a keepsake card with an animation, and lets them save the card as two PNG images.

A few seconds later, the same card drops onto a big screen at the venue, where it joins a wall of cards from everyone else. I built the full stack, from the phone flow to the live wall and the staff console.

User Flow

  1. 1Enter your details

    Name, birthday, and the bravest thing you have done.

  2. 2Choose a colour

    Pick the colour that feels like you today; confirming submits the card.

  3. 3Printing

    A 2.6-second printing animation plays while the card is saved.

  4. 4Your keepsake

    The days you have been alive, ready to save as PNG.

Architecture

Phone and screen frontend
React 19, TypeScript, Vinext (Next.js App Router API on Vite), Tailwind CSS 4, Base UI
Backend
Python, FastAPI, SQLAlchemy 2 (no handwritten SQL)
Database
Neon serverless Postgres, Singapore region
Hosting
Vercel, frontend and Python functions, Singapore region

There are four surfaces: the phone flow for visitors, a screen page that shows the live wall, a staff console, and a staff page that shows the entry QR code.

On the phone

  • The day count is calculated on the server in Malaysia time, so a visitor's phone clock or timezone cannot change the number. The birthday is used only for this and is never stored.
  • The waveform moves with the music without the Web Audio API, because on an iPhone, routing audio through Web Audio lets the silent switch mute the song. A loudness envelope is computed ahead of time (about 16 KB, 60 frames per second) and read in step with audio.currentTime.
  • The card is drawn on a canvas and exported as PNG, so visitors keep a real image file instead of a screenshot.

How a Card Reaches the Big Screen

This was the hardest part, and the core of the project.

  1. 1

    Submit

    When the visitor taps Confirm, the phone starts the printing animation and sends the card at the same time. The server usually saves it within 0.3 to 1 second.

  2. 2

    Polling, not WebSockets

    The screen asks the backend for its state once per second. Venue networks are unreliable, and with a stateless request every second the screen recovers by itself after a dropped connection or a reload. With one screen polling, the load is tiny.

  3. 3

    The server decides, under a lock

    Each poll fills free slots inside one database transaction that locks a settings row (SELECT ... FOR UPDATE). Even with the screen open in two tabs, the wall never shows more cards than the limit set in the console.

  4. 4

    A 3-second settle

    A card could appear on the screen while the phone was still printing it, which spoiled the moment. The backend now takes a card only once it is at least 3 seconds old on the database clock, so phone clocks play no part. Normally the card reaches the wall 0.7 to 2.4 seconds after it reaches the phone.

  5. 5

    Spotlight queue

    Each new card first fills the screen alone (88% of the screen height, 10 seconds by default), then shrinks into its place on the wall. New cards wait in submit order, and staff can see the queue length and the estimated wait.

  6. 6

    Replace the oldest

    When the wall is full, a new card pushes out the card that has been showing longest, but only after that card has landed and stayed visible for at least 5 seconds.

  7. 7

    Placement

    The wall is a grid whose cells match the card's shape. Each new card goes into the free cell farthest from the cards already showing, so the wall fills evenly. Cards drop in with a random motion (straight, slanted, spinning, or bouncing) at a random speed.

  8. 8

    Built for broadcast

    The screen background is pure #00ff00 for chroma keying, and wall cards have no shadows or see-through edges, so the keyer cuts them out cleanly.

Running It Live

Live controls

Almost every wall behaviour can be changed from the staff console during the event: cards on screen, display time, drop speed, spotlight length and size, brightness and colour strength, opening hours, and hiding or deleting cards.

Scan to play

Staff phones show a QR code that changes every 5 minutes; opening it gives a 20-minute pass. Codes are HMAC-signed and nothing is stored, so any number of staff phones show the same code at the same time.

Free-tier aware

The screen and console stop polling when their tab is hidden, so the serverless database can scale to zero when no one is watching.

Safe changes on event days

Before each change, I recorded the current commit, the production deployment IDs, and the exact rollback command, so any change could be undone in seconds. Backend and frontend were deployed in an order that kept the API compatible.