Numeric Citizen Polls: a small polls app of my own

6 min read

Every now and then I want to ask readers a simple question. Do you still use an RSS reader every day? Which Mac are you writing on? For years the obvious tool was PollDaddy, now Crowdsignal. It works, but it is one more account, one more set of trackers and one more look that is not mine. So I built my own: polls.numericcitizen.me.

This post documents what it does, how it is built and how it came together over four days with Claude Code.

What it does

The app is deliberately small. There is one admin (me), and readers never need an account.

For readers

  • Single-choice and multiple-choice polls. One vote per browser.
  • Results are shown always, after you vote, or only once the poll closes. I choose per poll.
  • A public archive at the root of the site lists every poll, with Open and Closed filters and 5 polls per page.
  • Once you have voted, you can share the poll to Mastodon or Bluesky, or copy its embed code.
  • It follows your system’s light or dark mode, and it was designed for phones first.
  • An RSS feed lists new polls, so they can show up alongside everything else on feeds.numericcitizen.me.

Embeds on my three blogs

My writing lives in three places: Ghost (numericcitizen.me), Micro.blog (blog.numericcitizen.me) and Scribbles (blips.numericcitizen.me). Each one accepts embeds differently, so a poll can be embedded three ways:

  • a plain iframe whose height is computed for the poll, so it never shows a scroll bar;
  • a small script that resizes the iframe to fit;
  • oEmbed, so on Ghost I can paste the poll’s link into an Embed card and it just works.

Every poll page also has Open Graph tags and a generated preview image, so a shared link looks right on Mastodon, Bluesky and elsewhere.

For me, the admin

  • Create, edit, close early, reopen and delete polls. Anything destructive asks for confirmation.
  • Save a poll as a draft, preview it, then publish it. Readers never see drafts.
  • Closing is either automatic, on a date (Montreal time), or manual.
  • A dashboard with a few stats, a search box and filters.
  • When I am signed in, the public archive shows a small admin panel on each card, so I can manage polls in place.

Privacy

There are no reader accounts and the app never stores a raw IP address. To limit duplicate votes, it combines a cookie with a salted, per-poll fingerprint that cannot be turned back into an address. Those fingerprints are deleted within a day of a poll closing. The privacy page explains it in plain words.

It is a blog poll, not an election. Someone determined can vote twice by switching browsers and networks. That trade-off is fine for questions like “Which Mac are you writing on?”

How it is built

  • Next.js (App Router) and TypeScript, hosted on Vercel.
  • Neon Postgres for the data, with Drizzle as the ORM.
  • One scheduled job runs once a day to close polls that have reached their date and to clean up old fingerprints.
  • Public pages are cached and refreshed the moment something changes (a vote, an edit, a poll closing), so the site stays fast even when the database has been asleep.
  • Vercel’s firewall rate-limits the vote and sign-in routes.

The type is Inter for text and Manrope for headings, to match the blog. There is a single accent colour, and the open and closed badges use green and red without relying on colour alone: they also say “Open” and “Closed”.

How it came together

I did not write this app line by line. I wrote a specification and built it with Claude Code, Anthropic’s coding agent, over a series of focused sessions.

The spec came first. Before any code, I wrote a document describing every screen, every rule and every route: what happens when a poll closes, how results are rounded, what a reader sees when results are hidden, what the privacy page says. Mockups of each screen, in light and dark mode and on a phone, came with it. The spec is the source of truth. When a decision changes, the spec changes in the same session.

Then eight build sessions, each with a narrow scope:

  1. Foundation: the project, the database and an empty page live on the domain
  2. Admin sign-in and poll creation
  3. The poll page, voting and results
  4. Embeds
  5. Sharing and preview images
  6. The dashboard, with close, reopen and delete
  7. The public archive, the RSS feed, the privacy page and caching
  8. Polish

A logbook kept everything on track. Each session ends by running the tests, the type check and the build, then adding an entry to a progress file: what was built, what was decided outside the spec and what is left. The next session starts by reading it. That file is the reason a fresh session never has to guess what came before.

A short rule book applies everywhere. The project has a few rules that every session follows. Logic such as rounding, open or closed, duplicate votes and stats lives in small, pure functions with tests (146 of them today). Colours only come from a shared set of variables, so every screen works in light and dark mode. Touch targets are at least 44 pixels, form fields use 16-pixel text so iPhone Safari does not zoom, and interface text is plain and short.

After version 1

Once the eight sessions were done, smaller changes followed:

  • A favicon and web manifest, so the site looks right in tabs and on a home screen.
  • A look closer to the blog’s: Manrope headings and the same site name style.
  • Status badges: a slowly blinking green dot for open polls and a red “Closed” pill. The dot stays still for anyone who has asked their device to reduce motion.
  • Draft polls, with preview and publish.
  • Pagination on the archive.
  • Some quiet motion: result bars grow into place after you vote, archive cards fade in when you change the filter or page, and buttons ease between states. Again, none of it moves when reduced motion is on.

A few lessons

  • Write the spec before the code. Most of the time saved came from decisions already made on paper, not from typing speed.
  • Keep a logbook. A progress file read at the start of each session works much better than hoping the context carries over.
  • Mind the order of database changes and code. Preview deployments each get their own copy of the database. When I added draft polls, a preview failed because its copy had been made before the new column existed. The rule now: change the production database first, then ship the code that needs it.
  • Free tiers have edges. The database plan allows a limited number of branches, and preview copies were piling up. A small automated job now deletes a preview’s database copy when its branch is deleted.

What’s next

A few ideas are parked for later: exporting results as an image, and a way to update older blog posts that still point to Crowdsignal. For now, the app does what I need: I ask, you answer, and everyone can see where readers landed.

Go vote: polls.numericcitizen.me.