Building the Black Friday-Cyber Monday live dashboard

This post details the technical implementation of a real-time Black Friday-Cyber Monday (BFCM) dashboard. It describes the dashboard's modified polling architecture, where the client polls the server every 10 seconds. Backend optimizations include using a rolling window for expensive queries (querying a 5-minute period instead of the entire dataset) and integrating with Upstash KV to store cumulative counts for total metric calculation. Incremental Static Regeneration (ISR) with a 5-second revalidation period was used to cache server responses and reduce database load. Frontend optimizations focused on creating dynamic visuals by calculating the rate of change of metrics and using `requestAnimationFrame` to animate counter increments, providing a smoother user experience than simple polling updates.