filpgf.io
Filecoin Public Goods Funding — the public site at www.filpgf.io.
Built with Astro and Tailwind CSS v4, deployed to Cloudflare Workers (filpgf-site).
Every page is prerendered except /, /kernel and /revenue-development, which
read the GAP API and are cached at the Cloudflare edge for 1 hour (plus /edit
and /api/editor/* which always run uncached). The only client-side JavaScript
is the header: menu behaviour and the light/dark theme toggle.
Commands
| Command | Action |
|---|
pnpm install | Install dependencies |
pnpm dev | Dev server at localhost:4321 |
pnpm build | Type-check (astro check) and build to dist/ |
pnpm preview | Serve the production build locally |
pnpm cf:dev | Run the Cloudflare Worker locally (wrangler) |
pnpm cf:deploy | Deploy the Worker (wrangler deploy) |
pnpm format | Format with Prettier |
Structure
src/
data/ Site content and figures (see "Data seam" below)
components/ Presentational components; kernel/ and revdev/ hold page-specific ones
layouts/ BaseLayout — head tags, header, footer, program accent
pages/ Routes: /, /kernel, /rnd, /revenue-development, /blog
sanity/ Sanity schema (the blog post document type)
styles/ global.css — design tokens and shared utilities
public/ Static assets served as-is (favicons, robots.txt, CNAME)
sanity.config.ts Sanity Studio, served at /studio
Blog
Posts live in Sanity, not in the repo. Editors sign in at /studio with the
account they were invited with (sanity.io/manage → Members) and publish from
there; publishing triggers a Sanity webhook (repository_dispatch with
sanity-publish) that rebuilds and deploys via GitHub Actions.
The build reads published posts through the blog content collection
(src/lib/sanity-blog.ts). It needs PUBLIC_SANITY_PROJECT_ID and
PUBLIC_SANITY_DATASET (see .env.example). Drafts never reach the build:
Sanity only returns published documents.
scripts/migrate-blog-to-sanity.ts is the one-off that moved the original
Markdown posts across; it needs an editor token in SANITY_WRITE_TOKEN.
Live data
Two of the landing-page headline stats are read from the Karma GAP API at
build time (src/lib/karma.ts), so pages stay static and ship no client
JavaScript. A scheduled rebuild is what keeps them fresh.
| Stat | Source |
|---|
| Total Projects | distinct projectUID across /communities/filecoin/grants |
| Checkpoints cleared | completed milestones ÷ total, truncated to a whole percent |
| Committed to date | supplied by the programme team, by round (see FINANCIALS) |
| Funding Initiatives | static (Kernel, Revenue Development, R&D) |
The API can never break a build: any failure falls back to FALLBACK_COUNTS
and logs a warning. Update those constants when the real numbers move, so a
fallback build is never far off.
Known discrepancy: app.filpgf.io shows 98/195 where this computes 98/197.
The completed count matches exactly; the totals differ by two, so the two are
reading the same data with a slightly different filter. Worth reconciling.
Data seam
Every figure on the site is static. Headline stats, Kernel SLA percentages,
the function inventory, and program metrics all live in src/data/*.ts as typed
exports transcribed from the published design.
Components import only those types, so moving to live data means replacing the
exports in src/data/ with API reads — no component or page changes required.
The relevant modules are landing.ts, kernel.ts and programs.ts.
Held back pending live data
Per review feedback, some built sections are deliberately not rendered yet:
- Kernel inventory and metrics —
Inventory.astro, MetricGrid.astro and
their data are intact; src/pages/kernel.astro just does not render them.
Re-add both sections, their nav entries and the "See the function inventory"
button to switch them back on.
- Objective card figures —
initiatives and amount stay in
src/data/landing.ts but are not rendered by ObjectiveCard.astro.
- Health & impact metrics — the card shows "Coming soon" instead of a link,
via an optional
href on ReportCadence.
Known data gaps