Architecture
analytics.svrbc.org is a static page on GitLab Pages that draws its own
charts. Its numbers come from PostHog, where every SVRBC site sends its
visits and clicks without cookies: CI asks PostHog for them when it
publishes the site, and writes them beside the page as
data.json. The page never talks to PostHog itself.
Dashed arrow: what CI publishes. Colored outline: what serves this site.
-
The page is
site/index.htmlandsite/app.js: hand-drawn SVG charts, and every filter (site, host, range) applied in the browser todata.json. The filters are in the URL, so a link can open on one site. -
It is a PWA: it installs from the browser, and works
offline with the numbers it last fetched. Its service worker
(
sw.js) fetches pages anddata.jsonfresh when it can, and keeps everything else until a release replaces it. -
The numbers come from
scripts/fetch_data.py, which asks PostHog’s query API with a personal API key that can only read (a protected CI variable). A visitor is counted once a day: the sites set no cookies, so PostHog tells visitors apart by a hash that resets daily. -
A release is a merge request that bumps
VERSION. Once it merges, CI tags it, and the tag’s pipeline publishes//:sitewith fresh numbers (Releases). - Every 3 hours, a scheduled pipeline republishes the latest release with fresh numbers. It publishes the release’s code, never unreleased work, so only a release changes the page.
-
The domain: a CNAME from
analytics.svrbc.orgtosvrbc.gitlab.io, in svrbc.org’s zone (Domains). - Source: gitlab.com/svrbc/analytics.svrbc.org. What sites count, and how: Sites.