Why Did You Vote
An exploration to understand why people vote for the candidates they do and to understand what unites us by seeing the other sides positions without the social media noise.
Problem
Back in November 2024 half the US was sure Trump would lose, the other half were sure he would win. There was no room on either side to understand why one candidate would vote one way or another. Whenever people asked in Reddit groups, on Twitter, etc they would just get hate, spam, or just ignored. I love this country, I love my community and I want us to not hate each other. I felt powerless and needed to do something with my nervous energy.
Solution
I decided understanding is one way to fix the division. By letting people post the reason they voted in a website isolated from the social media noise. Just a stream of hopefully honestly reasons why someone voted they way they did. What I ended up with was the now defunct: www.whydidyouvotetrump.com
Approach
I didn't have grand plans for making this the next Facebook so I wanted to keep it small, and use what I knew. to that end I went with the following stack:
Core Framework
- Node.js (v20) with ES Modules
- Express.js - Lightweight web framework
- EJS Templates - Server-side rendering for SEO benefits and simplicity
- Better-SQLite3 - Synchronous SQLite database driver
- SQLite - Chosen for simplicity, portability, and zero-configuration deployment
Styling and UI
I wanted to keep it simple but clean. I wanted to get this up quickly after the election so I relied on Tailwinds and some basic vanilla JS for the front end.
Content Moderation
While I had modest goals for this project I knew it could easily get out of hand if I am letting anyone post without an account. I didn't want to hold posts in moderation before approving so I reached out to Google and got access to their Google Perspective API to build in some automated checking. I can set different levels of moderation based on scores across the following:
- Toxicity
- Severe toxicity
- Identity attacks
- Threats
- Profanity
- Sexually explicit content
I kept it pretty open and used a 90% safety core, and if it was borderline then I set up a queue to review it myself.
Geolocation
At the time there were ALOT of bots posting to X, Threads etc and there were rumors they weren't American and I didn't want anyone not in the US to post to this. If you weren't in America I made an assumption you weren't American. I realize of course American's can live outside of the US, but this was a small personal site looking to gain perspective in why candidates voted the way they did.
To lock this down I used Cloudflare with the following security settings enforced:
- Cloudflare IP Geolocation - US-only submission enforcement
- Development mode bypass for testing
- Worldwide read access
- Cloudflare Turnstile - CAPTCHA alternative
- Seamless user verification
- Bot and spam prevention
Admin Panel
I made a pretty basic admin, I wanted to spend at little time in there as possible. It featured the following:
- HTTP Basic Authentication
- Post moderation interface
- Filtering by status (pending/approved/rejected)
- Content analysis score visualization
- Bulk moderation actions
Security Measures
Working in corporate America I am VERY aware of security concerns so I implemented the following features to help lock this down:
- Input sanitization at multiple levels
- Rate limiting per IP address
- CAPTCHA protection via Turnstile
- Geo-restriction for submissions
- Content moderation via Perspective API
- Admin authentication for moderation panel
- SQL injection prevention via parameterized queries
- Daily backup preparation
- Notifications push notifications to Home Assistant
Reflection
While the project wasn't a raging succeeding in re-uniting the country and helping everyone understand each other views it was a good insight into opposing views.
Key Takeaways
- Finding conservative partners could have helped increase this projects reach
- "Why Did You Vote" was a very crowded space after the election and it was had to find SEO traction
- SQLite is more than adequate for most side projects
- Google Perspective API is surprisingly effective for content moderation
- Sometimes simple tech choices (EJS + Express) are the right choices
Project Stats:
- Build time: 3 weeks
- Monthly cost: $10/mo
- Active period: Nov 2024 - July 2025
I didn't really have analytics so I don't know much about visitor numbers, wasn't really a goal for me.
I have made the code public, but I have not cleaned it up in any way. You can find the repo here: Why Did You Vote.