Skip to content

seo: surface live GitHub / PyPI / Docker community counts#101

Merged
smaramwbc merged 1 commit into
mainfrom
seo-live-credibility-counts
May 25, 2026
Merged

seo: surface live GitHub / PyPI / Docker community counts#101
smaramwbc merged 1 commit into
mainfrom
seo-live-credibility-counts

Conversation

@smaramwbc
Copy link
Copy Markdown
Owner

@smaramwbc smaramwbc commented May 25, 2026

Summary

External SEO audit (Section 3 #7) asked for GitHub stars, PyPI download count, and Docker Hub pulls as credibility signals. PR #98 substituted internal CI metrics (tests / evals / benchmark); this PR adds the literal audit ask, plus npm (the audit forgot `@statewavedev/sdk`, but if PyPI / Docker count then npm does too).

Where the counts surface

After in-flight feedback (hero was feeling like a data dump with four metadata lines under the CTAs), the counts live only on `/about` as a 4-up tile grid, not in the hero. The hero keeps the existing "Proven in CI: 680 / 55 / 8-8" CI row and nothing more.

Surface Treatment
HomePage hero (unchanged after fix — only the CI row)
AboutPage `AdoptionStatsRow` 4 clickable tiles: GitHub stars (+ forks in label), Docker pulls, PyPI version (+ /mo downloads), npm version (+ /mo downloads)
`fetched_at` footnote Visible on /about so the staleness is honest

Each tile drops out individually if its source field is null — a transient rate-limit never blanks the whole row.

Design: refresh out-of-band, ship the snapshot

  • `scripts/refresh-credibility-stats.mjs` fetches six public endpoints (GitHub repo, Docker Hub repo, PyPI JSON, pypistats.org recent, npm registry, npm-downloads). Best-effort per source — on failure (rate limit, network, schema drift) the previous value is preserved rather than blanked.
  • `src/lib/credibility-stats.json` is committed. Production builds never hit a third-party API and never block on one. Operators run `npm run refresh:credibility` manually after a release (or on a cron).
  • `src/lib/credibility-stats.ts` is the typed import wrapper, plus a `formatCompactCount` helper (`2744 → "2.7k"`).

Current snapshot (refresh ran 2026-05-25)

  • 212 GitHub stars · 8 forks
  • 2,744 Docker pulls (`statewavedev/statewave`)
  • statewave v0.10.0 on PyPI · 442 downloads/month
  • `@statewavedev/sdk` v0.9.0 on npm · 598 downloads/month

Bundle / DOM effect

before after
`dist/index.html` (homepage) 21,366 B ~21,500 B (no change — hero row reverted)
`/about` chunk (lazy) grows by ~3 KB raw for the AdoptionStatsRow
New runtime deps none
Build-time external API calls none (operator-run refresh script only)

Test plan

  • `npm run refresh:credibility` runs cleanly, captures all six fields including npm
  • `npm run build` succeeds; `dist/index.html` no longer contains "Adopted in the open" (hero clean)
  • `npx vitest run` — 282 + 1 skipped
  • `npm run lint`, `npm run typecheck` — green
  • CI green
  • After deploy: visit `https://www.statewave.ai/about\` — Adoption section shows 4 tiles linking to GitHub / Docker Hub / PyPI / npm with current numbers

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
statewave-web Ready Ready Preview, Comment May 25, 2026 3:33pm

Request Review

External SEO audit (Section 3 #7) asked for GitHub stars, PyPI download
count, and Docker Hub pulls as credibility signals on the homepage. The
earlier PR #98 substituted internal CI metrics; this PR adds the literal
audit ask alongside, so AI quality raters and answer engines see the
adoption numbers they actually look for.

Design: refresh out-of-band, ship the snapshot.
  * scripts/refresh-credibility-stats.mjs fetches three public APIs
    (github.com/api, pypi.org/pypi, hub.docker.com/v2), writes the
    result to src/lib/credibility-stats.json. Every source is
    best-effort — on failure (rate limit, network, schema drift) the
    previous value is preserved rather than blanked, so a transient
    upstream blip never wipes the row.
  * src/lib/credibility-stats.json is committed. Production builds
    never hit a third-party API and never block on one. Operators run
    `npm run refresh:credibility` manually after a release (or on a
    weekly cron) to keep the numbers current.
  * src/lib/credibility-stats.ts is the typed import wrapper, plus a
    small formatCompactCount helper (2744 → "2.7k") so the hero row
    stays terse on mobile.

UI:
  * HomePage HeroSection — new CommunityCountsRow under the existing
    "Proven in CI" line. Renders inside the prerendered shell from
    #95 + #96, so AI crawlers see the live numbers in the initial
    HTML response, not after JS mount. Each segment renders only if
    its source field is non-null.
  * AboutPage — new AdoptionStatsRow under the existing 4-up CI proof
    grid. Slightly fuller treatment (clickable tiles linking to the
    source: GitHub repo, Docker Hub repo, PyPI project) plus a
    "Counts last refreshed YYYY-MM-DD" footnote.

Initial snapshot (refresh ran 2026-05-25):
  * 212 GitHub stars
  * 8 GitHub forks
  * 2,744 Docker pulls (statewavedev/statewave)
  * statewave v0.8.0 on PyPI
  * pypi_downloads_month: null (pypistats.org rate-limited on the
    first run; will fill in on the next refresh)

Anti-drift: numbers will go stale between refreshes — that's the
trade for build determinism. The fetched_at field is exposed on the
About page so the staleness is visible.

Bundle / DOM effect on the prerendered homepage:
  * dist/index.html: ~21.4 kB → ~22.0 kB (+~0.6 kB; well under the
    SSR floor and immaterial vs the 5 kB gz transfer).
  * No new dependencies.
@smaramwbc smaramwbc force-pushed the seo-live-credibility-counts branch from 75af92f to 3cc00fb Compare May 25, 2026 15:33
@smaramwbc smaramwbc merged commit 3f07932 into main May 25, 2026
6 checks passed
@smaramwbc smaramwbc deleted the seo-live-credibility-counts branch May 25, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant