A self-updating dashboard of U.S. macroeconomic data, built for embedding in Canvas course pages. Students see current data every time they open the course.
Live site: https://bryancutsinger.com/canvas-macro-dashboard/
| Indicator | FRED series | Shown as |
|---|---|---|
| Unemployment rate | UNRATE | percent of labor force |
| Real GDP growth | A191RL1Q225SBEA | annualized quarterly rate |
| CPI inflation | CPIAUCNS | 12-month change (NSA — matches the headline number) |
| PCE inflation | PCEPI | 12-month change (the Fed's target measure) |
| Federal funds rate | DFF (tile) + FEDFUNDS (trend line) | effective rate |
| Recession dates | USREC | NBER dates (in the data file; not currently displayed) |
The page shows one card per indicator: the current value, the change from the prior period, and a two-year trend line that reads out past values on hover (or with the arrow keys).
- A GitHub Actions workflow runs twice each weekday (after the 8:30 a.m. ET data releases, and again in the afternoon).
scripts/build_data.pypulls each series from the FRED API, asserts that the series metadata still matches expectations, computes the transformations, cross-checks them against FRED's own transformations, and writesdocs/data/dashboard.jsonplus a provenance line per series inlogs/provenance.jsonl.- The workflow commits the new data and deploys
docs/to GitHub Pages. - The page (
docs/index.html) is fully static — plain HTML/CSS/JS, no frameworks, no build step, no API keys in the browser.
If a series fails to update, its last good data is carried forward and labeled stale, the site still deploys, and the workflow fails so GitHub emails a notification. If the data is more than 4 days old for any reason, the page itself shows a yellow warning banner — students and instructor both see it.
- Create two repository secrets (Settings → Secrets and variables →
Actions → New repository secret):
FRED_API_KEY— your FRED API key.PAT_PUSH— a fine-grained personal access token (Settings → Developer settings → Fine-grained tokens): repository access = only this repo, permissions = Contents: Read and write. Pick the longest expiration offered and note the date. Why: GitHub disables cron workflows in public repos after 60 days without repository activity, and commits made with a real user token unambiguously count as activity.
- Enable Pages: Settings → Pages → Source = GitHub Actions.
- Turn on failure emails: github.com → your profile → Settings → Notifications → Actions → check "Only notify for failed workflows".
- Run it once: Actions → "Update dashboard data" → Run workflow. Confirm the live site renders.
- Embed in Canvas: copy the contents of
canvas-embed.htmlinto the Canvas Rich Content Editor's HTML view (</>button). Save, reopen, and confirm the iframe survived.
- Yellow banner on the page / failure email: open Actions, look at the latest "Update dashboard data" run. Most failures are transient (FRED down); click "Re-run all jobs".
- "Scheduled workflow disabled" email from GitHub: open Actions, select the workflow, click "Enable workflow".
- PAT expired (pushes start failing): create a new fine-grained token
(step 1 above) and update the
PAT_PUSHsecret. - A series' metadata changed (rebasing, renamed series): the run fails
with a clear message. Update the expected values in
scripts/series_config.pyto the new metadata once you have confirmed the change is legitimate.
FRED_API_KEY=... python3 scripts/build_data.py # rebuild docs/data/dashboard.json
python3 -m unittest discover -s tests # run the tests
python3 -m http.server -d docs 8000 # preview at localhost:8000
Standard library only — nothing to install.