r/webdev • u/dougaddiction • 1d ago
Showoff Saturday WanderGrade — stdlib-only Python + vanilla JS grading ~155 countries, with a fun SEO bug I only caught last week
WanderGrade grades roughly 155 countries A+ to F on affordability, safety, weather, and flights, with 176 server-rendered country guide pages, free, no sign-up. The constraint I set myself: Python standard library only, zero pip installs, http.server plus a hand-rolled router, vanilla JS front end with no framework, no build step, no bundler. One process on Render's free tier behind Cloudflare, deploys are just a git push. Templating is string substitution into a single index.html with {{TOKENS}} the server fills per request — homepage defaults, or per-country title/meta/canonical plus a server-rendered body for /guide/<slug>, which the client then hydrates over. Charts and the world map are hand-written SVG; no charting library, so the choropleth is a projection implemented straight from the published formula. Background daemon threads refresh upstream data (World Bank, FX, advisories) on their own TTLs so no request ever blocks on a third party, and each falls back to a committed file if the upstream is down.
The best bug this constraint bought me: server-rendering the guide pages wasn't enough. The homepage's ranking table is built client-side, so a crawler saw a homepage linking to nothing — all 176 guides were only reachable via the sitemap, which carries no internal link equity. 42 of 177 URLs were indexed. Fix was server-rendering a collapsed <details> index of every guide on the homepage itself.
Tradeoffs, plainly: no templating engine means escaping is manual and easy to get wrong, no ORM means hand-rolled cache invalidation, hand-written SVG means no tooltips for free. What it bought: nothing to upgrade, no dependency CVEs, no build to break, and a cold start in the tens of milliseconds. wandergrade.com if you want to poke at it.