VAR was supposed to fix football. It didn't. It just made the arguments slower and the fans angrier. Now, a new submission for the Sanity Challenge, Path Two: Vibe-Code Something Strange, hands the final say to the people. VARdict, built by developer henkisch, is a web app that lets a simulated crowd vote to uphold or overturn real Premier League VAR decisions. It’s not just a football toy; it’s a masterclass in building complex, stateful applications with Sanity Workflows and the App SDK, all while keeping the codebase lean enough to fit on a free tier.

The Architecture: Sanity Workflows as the Referee

The core of VARdict is Sanity Workflows, which acts as the state machine for the voting process. The developer avoided the common pitfall of trying to use Scheduled Functions for timing, noting that on the Free plan, they run at most daily. Instead, they implemented an idempotent /api/tick route that closes voting windows whenever called by the screens or the bot crowd. This ensures the 60-second vote windows stay accurate without relying on cron jobs that might miss a beat. The workflow handles the logic: if over 55% uphold, the call stands; if under 45%, it’s overturned. Anything in between triggers extra time and a sudden-death penalty.

Vibe-Coding with Claude Code

Henkisch built the entire app using Claude Code over a week and a half, steering the agent primarily from a smartphone. The process wasn't smooth sailing. Early plans failed because the App SDK requires a login, which would have blocked public access to the stadium view. The solution was splitting the architecture: Next.js 16 for the public screens and the App SDK for the private 'VAR Room' dashboard. Another major hurdle was handling video clips. The agent initially tried to use YouTube oEmbed, only to find FIFA blocked embedding for many official clips. The developer had to manually curate Premier League-specific clips and use YouTube storyboard thumbnails as contact sheets to verify content, proving that even with AI agents, human oversight on media assets is non-negotiable.

Scaling Down to Fit the Free Tier

A critical part of the build was a cost review that caught an agent-generated leak. The initial design stored every bot vote as a separate Sanity document. With 60 bots per round and five incidents, this would have hit the 10,000-document cap on the free plan after just 25 runs. The fix? Switching to atomic increments on the referendum document for bot votes, while keeping human votes as documents to enforce one-vote-per-phone via unique IDs. This shift from document-heavy storage to counter-based aggregation is a practical lesson for any developer trying to build high-volume voting or polling apps on limited infrastructure.

Key Takeaways

  • Sanity Workflows are ideal for multi-step, time-bound processes like voting, but require careful handling of timing logic on free tiers.
  • AI coding agents like Claude Code can handle complex logic but struggle with media verification and platform-specific constraints like login walls.
  • Atomic increments are a viable alternative to document-based storage for high-volume, low-fidelity data like simulated user votes.
  • The 'App SDK' is best reserved for private, authenticated dashboards, while public-facing UIs should stick to standard web frameworks like Next.js.

The Bottom Line

VARdict is a brilliant hack that proves you don't need a massive budget to build a complex, interactive experience. It’s a reminder that the best dev tools are often the ones that force you to think critically about state management and cost efficiency, even when you're just letting the mob decide if a red card should stand.