SYSTEMS & DATA2026-11 · TECHNICAL CASE

Mobile Bio-Link Hub & Real-Time Giveaway Engine

High-performance mobile-first platform on an optimized serverless tier built for live broadcasts and events. Features multi-channel routing, Contentful headless CMS, and real-time live giveaways powered by Convex and Provably Fair cryptography.

Astro 7React 19ConvexContentfulCloudflare PagesCloudflare TurnstileTailwind CSS v4TypeScript

[!NOTE] Confidential Visual Assets: In compliance with non-disclosure brand agreements governing live broadcast events and commercial sponsorships, internal UI screenshots displaying corporate logos and partner branding are withheld from public display.

Executive Summary: Problem, Solution & Engineering Impact

Dimension Project Insight
Business Problem Standard bio-link tools crashing or lagging under sudden live streaming traffic surges, lacking real-time interactivity and transparent giveaway verification.
Engineering Solution Ultra-lightweight SSG architecture in Astro with interactive React islands, serverless reactive backend in Convex hosted on Cloudflare Pages, Turnstile anti-bot gates, and HTML5 Canvas digital passes.
Measurable Impact Zero fixed server costs ($0), sub-second mobile page loads (LCP < 0.9s), verified resilience for 1,000+ concurrent mobile registrants during streaming peaks, and full editorial autonomy for operations staff.

1. Context: Live Events, Mobile Traffic & Sudden Surges

A live event production agency and creator network (Pulse Live Media) faced a recurring issue during broadcasts: during festivals, conferences, and streams on TikTok and YouTube Live, more than 95% of viewers joined via mobile devices by scanning QR codes on stage or tapping links in video bios.

Traditional bio-link services (like Linktree) were never designed for this workflow:

  1. No real-time interactivity: They couldn’t run concurrent live giveaways for hundreds or thousands of viewers without timing out.
  2. Audience skepticism: Standard web picker tools are slow, feel opaque, and offer no proof of fairness.
  3. Constant developer dependency: Updating links, brand sponsors, or campaign rules for each new venue required manual code edits.

I was brought on as an independent freelance full-stack engineer and cloud architect to design a mobile-first platform on a strict $0 infrastructure budget, engineered to absorb sudden traffic surges in seconds, provide the production team with complete editorial autonomy, and execute live giveaways with verifiable mathematical fairness.


Production Engineering Stack & Tooling

Arquitectura de Software
Astro
Astrov7.4.4

Ultra-lean Static Site Generator (SSG) delivering <20 KB initial HTML bundles with sub-second paint times (LCP < 0.9s).

React
Reactv19.3.1

Dynamic interactive islands powering the reactive registration form and live operator control panel.

Redis
Convexv1.49.0

Reactive cloud backend featuring persistent bi-directional WebSockets, serializable ACID mutations, and native server scheduled jobs.

Contentful
Contentfulv11.12.10 SDK

Headless CMS providing decoupled editorial governance for social accounts, event venues, and dynamic form validation rules.

Cloudflare
Cloudflare Pages & WAFEdge CDN

Global perimeter distribution with zero cold-start latency, Layer 3/4 DDoS absorption, and $0 hosting overhead.

Cloudflare
Cloudflare Turnstilev0 API

Invisible, friction-free anti-bot CAPTCHA validation engineered specifically for mobile handheld devices.

Tailwind CSS
Tailwind CSSv4.3.3

Ergonomic mobile-first layout with thumb-optimized touch targets (minimum 48px height) and accessible contrast.

#
TypeScriptv5.9.3

End-to-end type safety unifying Contentful schemas, Astro page props, and Convex backend functions.


2. Decoupled Editorial Architecture with Contentful CMS

To eliminate developer dependencies whenever brand partners changed or event agendas shifted, I architected a decoupled publishing engine integrating Contentful’s Content Management and Delivery APIs:

[Production Team / CMs]
           │ (Publishes changes)
           ▼
[Contentful Headless CMS]
           │ (Build webhook)
           ▼
[Cloudflare Pages: Astro 7]
(Static HTML / CLS = 0)

Editorial Data Models

  • CanalSocial & SubEnlace: Dynamic aggregators centralizing access across multi-platform handles (dedicated TikTok channels, live stream rooms, community WhatsApp groups, merchandise stores). Each link supports numerical ordering, brand accents, status tags (Live, New), and icons.
  • EventoActivacion: Configuration engine for each giveaway or brand activation. Form fields balance identity verification with operational flexibility:
    • nombreCompleto: Mandatory (first and last name).
    • documentoIdentidad: Canonical unique identifier to prevent duplicate submissions and verify winner identity at prize pickup.
    • telefono: Instant mobile contact for prize delivery notifications.
    • Conditional field flags (pedirCI, pedirRU, pedirCarrera): Enables toggling input requirements per venue directly from Contentful without touching code.
    • Prize inventory, product imagery, legal rules, and Operator PIN credentials.
  • ModulosInformativos: Structured modular sections covering agendas, itineraries, and FAQs with multi-state approval workflows (Draft, Ready for Review, Published).

Every Contentful publication triggers an automated webhook deployment to Cloudflare Pages, delivering static HTML in milliseconds with zero layout shift (CLS = 0) from the nearest edge node.


3. Reactive Real-Time Giveaway Engine with Convex

During live streams with thousands of concurrent viewers or in-person venues where hundreds scan a QR code in a 3-minute window, traditional SQL databases suffer from table lock contention and polling overhead.

I implemented a reactive serverless backend using Convex:

[Attendee Smartphone]
         │ (Turnstile Token)
         ▼
[Convex ACID Mutation]
         │ (Validate + Sanitize)
         ▼
[Composite Unique Index]
         │
         ├─► [WebSocket Sync] (Push state to clients)
         └─► [Native Scheduler] (Sub-second cutoff)

3.1 Atomic Deduplication Without Duplicate Records

During streaming spikes with high submission volume, the system guarantees zero duplicate entries or identity spoofing:

  • Composite database indexes bind the event identifier with national IDs and phone numbers (by_sede_and_telefono, by_sede_and_ci).
  • If multiple concurrent requests submit duplicate credentials within the exact same millisecond, the first mutation commits atomically while subsequent requests are safely rejected without table locks or latency spikes.

3.2 Real-Time WebSocket Synchronization

Room state is pushed instantly to every connected device. When the operator triggers a countdown or closes registration from the admin console, attendee smartphone forms update immediately without manual page refreshes.

3.3 Authoritative Cloud Cutoff via Scheduled Functions

Rather than relying on client device timestamps or external cron jobs:

  • The backend schedules the exact closing millisecond internally using _scheduled_functions.
  • At the scheduled cutoff, the room transitions to closed automatically.
  • Every submission validates against authoritative cloud server clocks, preventing late entries even if a user manipulates their phone time.

4. Provably Fair Deterministic Drawing Algorithm

In live broadcasts before thousands of viewers, standard pseudo-random number generators (Math.random()) inevitably trigger doubts regarding algorithmic fairness. To guarantee absolute mathematical transparency, I implemented a Provably Fair drawing engine:

  1. Roster Freezing: Ten minutes before the live broadcast begins, the registration pool is sealed in an immutable state in Convex. No further additions or modifications can occur.
  2. Public Live Audience Seed: During the live stream, broadcast viewers are invited to supply an unpredictable public input in the chat (e.g., closing market stock values or a collective phrase agreed upon in real time). This input cannot be anticipated prior to the stream.
  3. Cryptographic SHA-256 Computation: We implemented a self-contained SHA-256 hashing algorithm inside Convex that combines the sorted participant roster with the live public seed:
    Seed   = Sealed_Roster + Live_Public_Seed
    Hash   = SHA-256(Seed)
    Winner = Integer(Hash) mod Total
    The Convex backend mathematically validates that the submitted winner ID matches this exact cryptographic calculation before permitting the record to be written to the immutable audit table.

5. Client-Side Digital Passes (ticketCanvas.ts)

To avoid cloud storage fees and egress bandwidth when generating individualized entry passes:

  • Upon successful registration, a client-side service renders a high-definition digital pass (800x1120 px) directly onto an HTML5 Canvas element.
  • The ticket integrates the unique participation code, official QR barcode, attendee name, and event terms.
  • Attendees can immediately save the image or share it to WhatsApp/Instagram stories without consuming any server storage or outbound bandwidth.

6. Perimeter Defense & Anti-Fraud Gates

[Incoming Mobile Traffic]
           │
   [Layer 1: Edge WAF] ───> Cloudflare Pages (Volumetric DDoS mitigation)
           │
   [Layer 2: Anti-Bot] ───> Cloudflare Turnstile (Frictionless client challenge)
           │
   [Layer 3: Backend Action] ───> Server-side Turnstile token validation against Cloudflare API
           │
   [Layer 4: Sanitization] ───> Strict regex validation (canonical mobile numbers, IDs)
           │
   [Layer 5: Anti-Brute Force] ───> Exponential backoff lockout table for Operator PIN
           │
   [Convex Database]
  • Mandatory Identity Validation & Canonical Sanitization: Identity credentials are strictly normalized and validated server-side with regex patterns before indexing to ensure singular registration integrity per attendee.
  • Operator PIN Brute-Force Protection: The dedicated bloqueos_operador table tracks failed authentication attempts when accessing the giveaway control panel, applying progressive exponential lockouts on repeated failures.

7. Stress Testing & Concurrency Benchmarks

The platform is currently in the pre-launch and event planning phase. Prior to deployment, I built an automated stress testing harness (scripts/test-stress-sorteo.mjs) to certify system resilience under extreme live conditions:

  • Concurrency Validation: The simulation confirmed that atomic mutations in Convex prevent duplicate entries and race conditions during simultaneous form submissions.
  • Peak Traffic Simulation: Concurrent participants submitting forms concentrated in the final minutes before event cutoff.
  • Strict Boundary Evaluation: Testing requests near the deadline threshold to ensure the scheduler closes submissions reliably.
  • Race Condition Audit: Multiple parallel threads attempting to submit duplicate credentials simultaneously to verify Convex transactional consistency.
  • Results: Rapid entry logging and dependable deduplication in the database with zero record collisions.

8. Key Takeaways

  • Handling traffic spikes for $0: Pairing static edge hosting (Cloudflare Pages) with a reactive cloud database (Convex) showed that you can absorb sudden spikes from thousands of concurrent visitors without spending a dime on infrastructure.
  • Editorial autonomy: Modeling clean data structures in Contentful gave the production team the freedom to change links, sponsors, and event copy without involving engineering.
  • Verifiable live trust: Replacing Math.random() with a Provably Fair seed algorithm gave the audience transparent proof that drawings were genuinely tamper-proof.