Skip to content

Releases: abdullah85/metallictrends

v0.3.0 — Package restructure, backfill reliability fix, and landing page polish

Choose a tag to compare

@abdullah85 abdullah85 released this 19 Jul 06:03

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 via maybe_backfill(), instead of relying
    solely on a manual CLI run, throttled to at most 1 attempt per day spaced across the day.
  • error_detail column on backfill_attempts and a new github_sync_log table 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 (formerly db_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-backup console-script entry points.

Changed

  • Restructured the project into a src/metallictrends/ package layout (ingestion/, sync/, api/),
    replacing the flat top-level modules.
  • needs_backfill tolerates 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_github and homepage backfill attempts are both capped at 1 attempt per day; corrected the
    default GITHUB_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_origin falls back to checking the Referer header's origin when Sec-Fetch-Site is
    absent, fixing legitimate same-origin requests that were incorrectly rejected with a 403.
  • fetch_timeseries raises a clear MetalsApiError on a null/empty rates payload from metals.dev,
    instead of crashing downstream with a bare AttributeError — previously hit on every homepage load
    whose catch-up window included today.

v0.2.0 — Interactive chart & server-rendered landing page

Choose a tag to compare

@abdullah85 abdullah85 released this 09 Jul 17:35

Landing page rebuilt around a single interactive, multi-range price chart and served directly
from FastAPI with server-rendered live data, replacing the earlier React portfolio-tracker
prototype.

Added

  • web/index.html — self-contained landing page built around a single interactive price chart:
    metal selector (gold/silver/platinum/palladium), preset and custom date ranges, a USD/₹ unit
    toggle, permanent x/y axis labels with gridlines, and a speech-bubble-style hover readout showing
    the price and date for any point on the line.
  • api.py/api/metals, /api/prices/{metal}, /api/fx/{currency}, and /api/widget/{metal}
    HTTP endpoints serving data from the SQLite store.
  • GET /api/prices/{metal} accepts start/end date-range params (uncapped) alongside the capped
    days window, powering the landing page's full-history range picker (1W through ALL).
  • GET /api/fx/{currency} — daily FX rate history (uncapped start/end), so the site can convert
    the full price history to INR using each day's actual rate instead of one approximated rate.
  • GET / is now a proper FastAPI route (Jinja2, api.py's _latest_meta) instead of a static file:
    the hero ingot's price, batch date, "last update" date, and the trust-strip's day count are
    computed straight from the database at request time, so the page never carries a placeholder
    value for them.
  • web/assets/style.css, web/assets/script.js, web/assets/hero-preview.png — the page's CSS,
    JS, and hero screenshot, previously inlined into index.html (including as base64 data URIs for
    fonts and the hero image), extracted into their own linked files. Cut index.html from ~210KB to
    ~44KB.
  • render.yaml for deploying the API to Render.

Changed

  • Locked /api/metals, /api/prices, and /api/fx to same-origin requests.
  • INR prices now use the real daily USD→INR rate for each date, instead of a single rate derived
    from the latest day and applied across the whole history.
  • index.html now declares a proper <!DOCTYPE html>/<html>/<head>/<body> document structure
    with a charset and viewport meta tag, instead of a bare fragment with neither — the missing
    viewport tag meant mobile browsers were rendering the page at desktop width and scaling it down.

Removed

  • frontend/ — the React + Vite portfolio tracking tool (buy/sell logging, CSV import/export against
    spot price) and its built output web/portfolio/, along with the inline modal used to open it from
    the landing page and the GET /api/prices/{metal}/on/{on_date} endpoint that only existed to
    support it. Simplifies the product surface for the current go-to-market plan.

Fixed

  • Added UNIQUE constraints on schema tables and reused init_db in tests to prevent duplicate rows.

v0.1.0 — Initial Release

Choose a tag to compare

@abdullah85 abdullah85 released this 01 Jul 04:05
db404df

MetallicTrends v0.1.0 — Initial Release

The first release of MetallicTrends: a resumable data ingestion pipeline for
daily precious metals prices (gold, silver, platinum, palladium) from the
metals.dev API, stored in a local SQLite database.

Highlights

  • metals.dev API client — fetches daily timeseries price data, automatically
    respecting the API's 30-day-per-request window limit (#1, #7)
  • SQLite database layer — stores metal prices and FX rates, with per-window
    checkpoint tracking (#3, #6)
  • Resumable backfill orchestrator — splits any date range into 30-day chunks
    and resumes from the last successful window after an interruption, without
    re-fetching data (#2, #8)
  • Backup & export utility — timestamped SQLite backups and CSV export of
    price records for portability (#4)
  • Test suite — unit tests for the client, database layer, and backfill
    orchestrator using mocked HTTP responses, so no API quota is consumed (#6, #7, #8)
  • Docs — setup instructions, usage examples, and sample query output in the README

What's included

  • client.py — metals.dev API client
  • db.py — SQLite persistence layer
  • run.py — backfill orchestrator / CLI entrypoint
  • backup.py — database backup and CSV export CLI
  • queries/ — example SQL queries
  • tests/ — unit test suite

Full Changelog: https://github.com/abdullah85/metallictrends/commits/v0.1.0