Skip to content

Migrate the Adopt-a-Pet weekly analytics into Evermore #339

Description

@ckrough

The weekly adoption-profile analytics run today as a standalone local project outside this repo:

  • aap_pet_stats.py logs into the shelter's Adopt-a-Pet account with Playwright and reads the Individual Pet Stats report, read-only (the login POST is the only write). It writes an append-only weekly snapshot and a rolling history.json with 7-day, 30-day, and all-time hits, views, and CTR per pet.
  • build_dashboard.py renders a self-contained HTML dashboard from that history: CTR as the hero chart, views and search appearances, weekly Monday-anchored trend with estimated gap weeks marked, and a printable per-pet appendix.
  • backfill_from_dashboard.py is a one-time import of two weeks parsed from emailed PDFs.
  • run_weekly.sh runs extract then build by hand each week, and deploy_dashboard.sh direct-uploads the single HTML file to Cloudflare Pages behind Cloudflare Access.

Moving it into Evermore puts the weekly run on a schedule, stores the history org-scoped instead of in a local JSON file, and serves the dashboard from the stack.

Related: #306 (Adopt-a-Pet feed/API read adapter) reads the same source for listing compliance; #47 (time-online outcome metric).

Acceptance Criteria

  • Weekly per-pet Adopt-a-Pet stats are pulled on a schedule with no manual run, read-only against Adopt-a-Pet
  • Shelter credentials are held as secrets, never logged or stored in the database
  • Snapshot history lives in Supabase, org-scoped under RLS, observed values only (estimates computed at render, never stored)
  • The existing history.json weeks, including the two backfilled PDF weeks, are imported
  • The dashboard renders in Evermore with the current charts and the printable per-pet appendix, restricted to the owning org
  • The standalone scripts and the Cloudflare Pages deploy are retired once the Evermore version has run one week

Activity

  1. added theissue type on Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions