Zero-Cookie Global Visitor Map Built with Cloudflare Edge and Supabase
A developer describes building a public, real-time world map of site visitors on a static Next.js website without using cookies. The approach reads a visitor's country code from Cloudflare's edge trace endpoint and discards the raw IP address immediately, so no IP data is stored. Visit counts per country are aggregated through an atomic PostgreSQL function in Supabase, which prevents race conditions during traffic spikes. A localStorage check keyed to the current date limits each device to one logged visit per day, and a headless layout component records visits from search landing pages. The map itself is a compact SVG grid that animates updates live via Supabase Realtime.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in