Package restructured into a src/ layout, a recurring metals.dev backfill crash tracked down and
fixed, structured observability added for backfill and GitHub sync attempts, and the landing page's
brand mark and B2B section reworked.
Added
- Landing page favicon (
web/assets/favicon.svg/.png) and a matching header wordmark — a single
inline SVG reading "MT MetallicTrends" in a gold gradient, avoiding raster-scaling artifacts. - "Chart" link in the footer nav, alongside Pricing and Webmasters.
GET /auto-backfills stale metal prices on each load viamaybe_backfill(), instead of relying
solely on a manual CLI run, throttled to at most 1 attempt per day spaced across the day.error_detailcolumn onbackfill_attemptsand a newgithub_sync_logtable recording the outcome
of every DB-to-GitHub sync, so failures are diagnosable from the DB itself instead of only server logs.sync/github.py(formerlydb_sync.py) pushes the SQLite DB to GitHub after writes and restores it
on startup — a persistence workaround for Render's free-tier disk, which is otherwise wiped on every
redeploy.metallictrends-backfill/metallictrends-backupconsole-script entry points.
Changed
- Restructured the project into a
src/metallictrends/package layout (ingestion/,sync/,api/),
replacing the flat top-level modules. needs_backfilltolerates a 1-day gap between the latest stored date and today, and
backfill_recent's catch-up window now ends on yesterday rather than today — metals.dev may not have
published the latest day's data yet.push_db_to_githuband homepage backfill attempts are both capped at 1 attempt per day; corrected the
defaultGITHUB_BRANCH.- Reworded B2C/Pricing landing-page copy to match the chart's actual current features instead of
unbuilt ones. - Broadened the B2B section from a "jewellery store" framing to "webmasters" running any site relevant
to gold/silver/other metal rates (jewellery, bullion, finance/investment) — renamed the nav/footer
link, plan card, and section heading accordingly.
Fixed
_require_same_originfalls back to checking theRefererheader's origin whenSec-Fetch-Siteis
absent, fixing legitimate same-origin requests that were incorrectly rejected with a 403.fetch_timeseriesraises a clearMetalsApiErroron a null/emptyratespayload from metals.dev,
instead of crashing downstream with a bareAttributeError— previously hit on every homepage load
whose catch-up window included today.