How I built a countdown & days-since tracker with React 19, Supabase and Vercel
I wanted a place to count down to things – a trip, a birthday, a deadline – and to count up from things, like the day I started a habit. Most countdown sites I tried were full of ads or wanted an account before I could type a date. So I built my own: CountMyDays. It's a solo side project, and this post is about how it's put together and a few things that bit me along the way. The stack React 19 +…
I wanted a way to count down to events like a vacation or birthday, or count up from days since starting a new habit. Existing countdown websites were annoying with ads or requiring an account, so I created my own: CountMyDays. This post explains how it's built and some challenges I faced. The stack includes React 19, Vite, TypeScript for the front end, Supabase for PostgreSQL, magic-link authentication, Realtime, Vercel hosting, Tailwind styling, and a service worker for offline functionality.
The key aspects are how data moves between guest and signed-in users and keeping the timer accurate. Guests can start creating countdowns immediately, with their data stored in localStorage under a single key. After signing in, guest data is transferred to the Supabase countdowns table. Normalization and fallbacks handle schema changes.
Local storage is cleared only after the data insert succeeds. The timer is accurate because it's based on date math instead of intervals, using requestAnimationFrame to update the display only when the second changes. When a countdown reaches zero, it switches from counting down to showing elapsed time. Countdowns can be shared via a public link, and shared pages update instantly when the owner edits the countdown.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.