Urgent.News

What's breaking now, across thousands of outlets.

Tech

I updated our drug profile to 563-drug harm-reduction library in 9 languages on Cloudflare's free tier — here's the stack

Every year, millions of people Google things like "what does fentanyl look like" or "can you mix Xanax and alcohol" — and land on forum speculation. I built plugreports to fix that: a free harm-reduction library with 563 plain-language drug profiles, 61 mixing-danger guides, verified hotlines across nine regions, and an identification video library — in nine languages. The interesting part (this…

Every year, millions of people turn to online searches for information about drugs, such as what fentanyl looks like or if it's safe to mix Xanax and alcohol. This often leads them to speculation instead of reliable information. To address this issue, I created plugreports – a free, harm-reduction library containing 563 plain-language drug profiles, 61 guides on dangerous mixing, verified hotlines in nine regions, and an identification video library – all available in nine languages. This entire setup runs on Cloudflare's free tier, offering an efficient solution.

The architecture is based on static generation, but it is flexible with a content management system (CMS). A simple Python script (build.py) processes plain data files and generates approximately 1,100 static HTML pages containing drug profiles, guides, comparisons, and data pages. Each page includes full JSON-LD (MedicalWebPage, FAQPage, BreadcrumbList), accurate lastmod, sitemaps, and bidirectional hreflang clusters.

Notably, this entire setup runs without any additional frameworks or complex build steps; it simply requires running python3 build.py.

The admin CMS is powered by a KV-backed service on Pages Functions, allowing for easy editing and updates. A PIN-protected /admin panel, secured via HMAC-token authentication against a Pages Function, enables editing all collections directly into a Cloudflare KV namespace. Routes serving static files are given priority, but any admin edits are instantly incorporated at runtime using a small hydrate.js file.

For items not present statically, they are rendered client-side. This ensures that any changes made by an admin are always reflected in the displayed content.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Wednesday 30 September →