DEV Community

Cover image for Face Day: Pick your team
Sigireddy Viswesh
Sigireddy Viswesh

Posted on

Face Day: Pick your team

Presage SmartSpectra SDK Challenge Submission

This is a submission for the Presage SmartSpectra SDK Challenge

What I Built

I built a cool card trading game that takes human vitals like HRV and breathing, the kind of hospital-graph stuff I probably shouldn't judge, and turns them into something playful. It's a creative experiment, and it runs in a few phases.

Core Gameplay

  • Home: You'll see two cards. One asks for your consent; the other is a questionnaire.
  • Chamber of Trials: Sounds like the Chamber of Secrets, but it's not. We scan your face here, then send you to either Team Thor or Team Doom based on what we perceive from you.
  • The Cover: Once we've had a good look at your face and vitals, we assign you a team: the Thunder team or the Hell-Calling team. We also check how close you are to the golden ratio, generate a heat map of your face, and add a face reading (not accurate, btw). You can share the result to your X handle.

The Opposing Sides

  • ⛈️ Team Thor (The Hammer / Nothing Left to Lose): Calm, composed, and finally taking things seriously. Deep breathing, solid recovery, and a nervous system that refuses to panic. He's not looking for trouble, but he's certainly not backing down.
  • 👹 Team Doom (The Mask / Latveria's Last Standing): Lost everything, has nothing left to prove, and absolutely refuses to lose again. Running on calculated aggression, relentless focus, and enough determination to make therapy look like a side quest.

Key Features

  1. Physical Card Anatomy: Collector numbering (#001/050), rarity tiers (RARE, ULTRA-RARE, LEGENDARY FOIL), dynamic comic flavor quotes, and a 3D interactive holographic foil tilt with specular glare.
  2. 1-Click Share & Download: High-res PNG card download and instant sharing to X (Twitter).
  3. Astral Mirror (Doctor Strange Thermal Face Reading): A mystical facial heat map visualizer with trait chips (Third Eye forehead heat, Vascular Qi cheeks, Temple Zen, and Jaw Tension).
  4. Golden Ratio (Phi = 1.618) & Aesthetic Radar: Craniofacial symmetry, dermal clarity score, hydration, and iris metrics. A green spinning steel ball visualizes the score.
  5. The Warbird: Rocket's ship serves as a floating, interactive reactor pod that triggers 7 full-page, reality-warping comic particle effects. (The app says "Warbid", which is a typo in the app. I fixed it here.)
    • Thanos 50% ash disintegration with Time Stone rewind
    • Loki Yggdrasil world-tree branches
    • Doctor Strange sling-ring portal
    • Bifrost rainbow beam
    • Scarlet Witch Chaos Hex
    • Spider-Verse chromatic glitch
    • Cosmic Singularity

Demo

This is my face, done in one take. It will look odd, trust me.

Try it out: https://frontend-133.sea1.zerops.app/

Code

Here's the repo where I mercilessly shipped AI-generated code: https://github.com/Viswesh934/Face-Day. Nobody is reading all that slop, so here's a short architecture overview.

And yes, I ran --dangerously-skip-permissions a few times while building this. The flag is literally named "dangerously", and I treated it like a suggestion. Somewhere in this repo, an agent had full access to my machine and my trust, and all it did was build a Thor vs Doom trading card. Honestly, a very responsible use of unlimited power.

Tech Stack

  • Frontend: TypeScript, Vite 6, HTML5 Canvas 2D
  • Styling: Custom comic-book CSS, SVG illustrations, Google Fonts
  • Biometrics: Presage SDK (@smartspectra/node-sdk v3.5.0), native C-API/FFI
  • Backend: Node.js, WebSockets (ws), HTTP health checks
  • Audio & Effects: Web Audio API, Canvas particle engine, canvas-confetti
  • Storage: Browser localStorage
  • Deployment: Zerops (I tried Cloudflare and AWS App Runner; this worked better)
  • Tooling: Presage MCP server with OAuth 2.1 PKCE

How It Responds to Human Signals

TL;DR: I bundled the live signals and the SmartSpectra SDK integration into this single section so you don't have to hunt across tabs. Since modern attention spans are shorter than a 30-second measurement window anyway, here's the quick breakdown. The deep architectural specs and code are in the README.

1. The Live Presage Signals & Real-Time Response

Instead of boring clinical charts, a 30-second camera scan pipes your biometrics into a retro comic duel:

  • Pulse Rate (BPM): A steady resting pulse (≤ 69 BPM) drafts you into Team Thor (calm and endurance); an elevated pulse (≥ 74 BPM) drafts you into Team Doom (tactical vigilance).
  • Breathing Rate (/min): Deep diaphragmatic breaths give you Thor points and high Agility (AGI); rapid breaths feed Doom's calculation.
  • HRV (RMSSD) & Stress Index: High HRV resilience maps to Endurance (END); high tactical stress maps to Willpower (WIL). Peak readings upgrade your card to a Legendary Foil.
  • Live HUD Feedback: SmartSpectra guidance codes trigger real-time comic reticle alerts on screen (TARGET LOCKED, STEP INTO THE MIRROR, HOLD STEADY).
  • Doctor Strange Thermal Radar: Maps facial composure zones (Third Eye cognitive calm, cheek vascular warmth, jaw tension).

2. SmartSpectra SDK Integration (How It Works)

  • Native Node SDK (@smartspectra/node-sdk v3.5.0): Runs in the backend bridge (local-runner/bridge.mjs / server/index.mjs) via native C-API/FFI.
  • WebSocket Pixel Streaming: The browser captures camera frames via getUserMedia, downsamples the RGBA buffers, and streams them over a local WebSocket (ws://127.0.0.1:8765) to the SDK.
  • Strict 30-Second Credit Guard: Presage meters 1 credit per 30-second run. An automatic 30,000 ms watchdog calls sdk.stop(), guaranteeing exactly 1 credit per trial with zero accidental burn.
  • Dual-Engine Edge Fallback: On serverless edge (Cloudflare Pages) without native C libraries, an in-browser optical rPPG fallback (src/optical-vitals.ts) keeps the app 100% playable for judges with zero setup.

Prize Categories

I think of weird technical stuff every single day, but this month I took the creative track, because what's the worst that could happen?

With comic movie hype brewing again (and because I desperately miss good Marvel movies), I wanted to settle the classic Civil War "picking teams" debate with hard, irrefutable biological evidence. If your resting heart rate is chill, Thor claims you. If you're caffeinated and plotting tactical chaos, Doom gets you. No boring medical squiggles, just a mint 1980s holographic trading card.

Getting it to run was its own multi-phase boss fight:

  • GitHub Codespaces: Cried immediately at native C++ libraries.
  • AWS App Runner: Worked, but was actively preparing to bill me a kidney.
  • The Lifesaver: Remembered I had unused Zerops credits lying around like loose change in the couch cushions.

I pivoted the backend there, and boom: pure chaotic delight.

Consent and Data Handling

Feel free to skip this section: We take literally nothing from you. No cloud storage, no creepy databases, no ad trackers. But because the lawyers (and judges) need to hear it, here's the breakdown.

  • Explicit Consent First: You can't start the trial without clicking "Accept" on the Phase 1 consent modal. If you hate cameras, you can skip it entirely and play via the 4-question scenario quiz ("The Overseer's Inquiry"). Yes, the app demands explicit permission from you, and I built it with --dangerously-skip-permissions. Do as I say, not as I did.
  • 100% In-Memory & Local: Video frames and biometric signals exist strictly in temporary RAM during your 30-second trial. No video or face meshes are sent to any remote server or cloud database.
  • Deck Saved on Your Machine: Your minted trading cards live exclusively in your browser's localStorage. Clear your browser cache and they vanish.
  • Zero Medical Claims: This is a comic book trading card game built for fun. It does not diagnose, treat, prevent, or evaluate any health condition. Don't use your Mjolnir card to replace your doctor!

In Summary

Face Day takes contactless sensing (pulse, breathing, HRV, and facial composure) and swaps sterile hospital dashboards for a chaotic, retro 1980s comic trading card duel. It's not cutting-edge, but it's accurate. Thirty seconds of looking into your webcam, and your own biology mints your allegiance to Team Thor or Team Doom on an authentic holographic canvas card.

A Parting Thought

Tech can be suffocatingly serious. Every demo these days is about enterprise efficiency, revenue multipliers, or clinical diagnostics.
And that stuff matters, sure. But every once in a while, it's okay to build something purely weird, odd, and unapologetically playful. You don't always need a pitch deck. Sometimes you just need to measure your heart rate to see if you're worthy enough to wield Mjolnir.

spidermannn

Thanks for reading, ship it!!

Top comments (0)