HomeCase StudiesInteractive Poll System with Real-Time Vote Aggregation
Backend ArchitectureTechnology & Digital Platforms

Interactive Poll System with Real-Time Vote Aggregation

Passive content gets scrolled past. We needed a post type that asks users to do something, not just read.

The Challenge

Polls needed live results without extra network round trips — fetching a post, then its options, then its votes, then checking whether the current user already voted, would mean four requests per poll in a feed of many. Vote counts also had to stay accurate under concurrent voting, and each user had to be limited to one vote per poll.

Solution & Architecture

Modeled polls as a first-class post type with time-bound duration, and folded the entire poll payload — question, options, all votes, and the viewer's own vote — into the same single query that builds the feed. One request returns a fully renderable poll, so results and percentages display instantly with no follow-up calls. Votes are written through server-side routines that enforce one vote per user and let poll posts be filtered as their own category on both the feed and the map.

Technologies & Tools Used:

SupabasePostgreSQL FunctionsReal-Time Aggregation