DashboardPlain descriptionData sources
The big picture
The whole thing is one file — a single Cloudflare Worker (server-side JavaScript). It has no build step, no framework, and no dependencies. When someone visits the page, the Worker fetches data from eight public APIs, runs a transparent scoring model, and returns a finished HTML dashboard.
- Ingest — fetch eight external feeds in parallel. Each one can fail on its own without breaking the others.
- Model — combine the data into a 10-component risk score, each component capped and labelled.
- Render — build the HTML dashboard and send it back.
The data sources
Eight external feeds, all free, plus a CSV the operator can upload. Full detail including endpoints and signup links is on the data sources page.
| Source | Provides | Key? |
|---|---|---|
| UN Comtrade | Trade flows by HS code | No |
| World Bank WITS | Import tariff rates | No |
| GDELT | Disruption news | No |
| IMF PortWatch | Port disruption | No |
| US EIA | Feedstock prices | Free key |
| NOAA / NWS | Gulf Coast weather | No |
| ECB / Frankfurter | USD FX rates | No |
| FRED | Demand & logistics stress | Free key |
The risk model
The score is plain arithmetic — ten components, each with a hard cap, added together and clamped to 0–100. No machine learning, no opinion. Every component is tagged by where its data came from, so the score always explains itself. One component (chemical demand) can be negative, which stops the tool overstating risk when the market is soft.
The honesty rule
Every value the tool shows is labelled: measured (official
statistics), signal (news monitoring — attention, not proof),
user (uploaded data), or sample (a placeholder used
only when a live feed fails). Mixing hard facts with noisy sentiment is the
trap that kills supply dashboards — the labelling is what avoids it.
How to rebuild and deploy it
You need a free Cloudflare account. No terminal required.
worker.js. Click Deploy./, this page at /explain.Optional setup (all in the Worker's Settings tab)
- Free API keys — under Variables and Secrets, add
EIA_API_KEYandFRED_API_KEYto enable the feedstock and macro panels. The app works without them. - KV storage — under Bindings, add a KV namespace bound
as
PG_INTEL_KVso uploaded data persists across restarts. - Access control — add an
ADMIN_TOKENsecret to lock the upload and refresh endpoints on a public deployment.
Changing the commodity
The default is propylene glycol (HS code 290532). Add
?hs=CODE to any URL, or set the HS_CODE variable, to
track a different traded good.
Where the source code lives
The complete tool is the single worker.js file plus a short
README and a sample CSV. Anyone with that file can paste it into their own
Cloudflare account and have an identical, independent copy running in
minutes. Nothing is locked to the original deployment.