A tiny, playful naming-contest web app. Vote for your favorite name and watch the leaderboard update in real time.
Uses Twilio Verify to send a one-time code to each voter's phone, so a phone number can only vote once.
- A voter clicks "Vote" on a name and enters their phone number.
- The server calls
verifyService.verifications.create()to send a one-time code via SMS. - The voter enters the code, and the server calls
verifyService.verificationChecks.create()to confirm it. - If the code is valid, the vote is recorded and that phone number is marked as having voted.
The core integration lives in lib/verify.js — two small functions that
wrap the Twilio Verify API.
-
Create a Twilio account and a Verify Service in the Twilio Console.
-
Copy
.env.exampleto.envand fill in your credentials:cp .env.example .env
TWILIO_ACCOUNT_SID= # found on your Twilio Console dashboard TWILIO_API_KEY= # create one at console.twilio.com/us1/account/keys-credentials/api-keys, starts with "SK" TWILIO_API_SECRET= # shown once when you create the API key — copy it then TWILIO_VERIFY_SERVICE_SID= # found on your Verify Service page, starts with "VA"On Replit, add these as Secrets instead of a
.envfile.
npm install
npm startThen open http://localhost:3000.
- Express server with in-memory storage (
server.js) - Twilio Verify for phone number verification (
lib/verify.js) - Static HTML/CSS/JS frontend (
public/) - No database, no user accounts — just names, vote counts, and a set of verified phone numbers