feat: catalog api#63
Open
sorodrigo wants to merge 20 commits into
Open
Conversation
…eat/catalog-api * 'main' of https://github.com/upbeat-works/provide: Add Advanced Filters panel to indicator selection modal (#54) feat: add /projects/provide page (#53) feat: restyle html-content .btn links to match button design (#52) Add LinkSection to explore and avoid impact pages (#50) Merge Key concepts into Methodology as tabbed Key terms page (#41) Replace Lato with Geist font and update UI type styles (#46) feat: add avoid impacts CTA to explore page (#51) refactor: redesign footer as 3-column layout (#49) fix: align active border indicator styles across nav components (#48) Replace SVG grain filter with PNG texture and soft-light blend (#47) rename Explore label to Explorer (#45) rename: nav label to Case Studies, page hero title to Adaptation (#44) Surface reference context sentence in threshold-levels section (#39) restore indicator filters to avoid page (#38) remove sticky from contact page (#37)
…eat/catalog-api * 'main' of https://github.com/upbeat-works/provide: fix: update hero background tiles SVG paths (#61) fix: remove sticky positioning from filters bar in PageLayout (#60) fix: correct typo in hero CTA button text (#59) refactor: extract scroll-spy logic into reusable createScrollSpy utility (#58) fix: prevent null CMS titles showing in case study side menu (#57) fix: apply theme-stronger colour to contact page heading (#56) fix height issues for modal with filtered list (#55)
* main: feat: use sqlite for cms feat: adds cms
…eat/catalog-api * 'main' of https://github.com/upbeat-works/provide: fix: outro issue feat: strapi docs (#64)
…eat/catalog-api # By Ed Brett (8) and Rodrigo Solís (1) # Via GitHub * 'main' of https://github.com/upbeat-works/provide: feat: add filter bar to case studies landing page (#71) feat: uppercase case study card titles, show topic tag only when present feat: rename Case Study Dynamic display name to Case Study revert: keep case-study-dynamic as-is to avoid losing production data feat: remove unused Strapi content types, rename Case Study Dynamic to Case Study fix: fall back to original image url for non-Cloudinary uploads (#68) feat: redesign case study city page (#67) feat: case studies landing page (#66) fix: cms content # Conflicts: # src/lib/components/controls/ScenarioSelection/ScenarioList.svelte # src/routes/(default)/+page.server.js # src/routes/(default)/adaptation/+page.server.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: convention-driven catalog API (replaces
/meta)Summary
Replaces the hand-curated metadata layer with a convention-driven catalog derived from ixmp4 variable names, served by a new Hono/Cloudflare-Workers + D1 API in
api/. The old/metagod-endpoint is gone — the catalog is split into cost-scoped slices (/geographies,/catalog, curation) that load only on the pages that use them.What changed
API (
api/) — four layers, edges-do-I/O, core-is-pure:routes/*thin HTTP adapters →views/*per-chart resolvers (impact-time,scenarios,unavoidable-risk) →conventions.ts/tabulate.ts/util.ts(pure language) →platform.ts/instances.ts(ixmp4 connection).Indicator | Period | Temporal | Spatial | Value) — no curation.Endpoints (no more
/meta):/geographies(+/geographies/types) — selectable place tree (D1, cheap)/catalog— indicators + parameter dimensions + scenario universe (the expensive ixmp4 scan)/study-locations,/likelihoods— transitional curation/impact-time,/scenarios,/indicators,/tags,/unavoidable-risk(stub)Frontend — the data slices load per section (
impacts,adaptation,methodology/key-terms,embed, and the landing quick-start), not on the global layout, so static pages no longer pay for the ixmp4 scan. Stores read$page.data.geographies/.catalog/.curationvialoadGeographies/loadCatalog/loadCuration.DB migrations — adds
0002_past_blink.sql(geo_idcolumn ongeographies, ISO3 for countries) bridging the name-based catalog to map geo-shapes. Local + remoteprovide-catalogD1 have been migrated through0002and reseeded.Running locally
Prereqs: Node, Bun, and Wrangler (
npm i -g wrangleror vianpx). Thennpm install.1. Environment files
2. Set up the local D1 (new — required)
3. Run the API (pick one)
npm run dev:api→ Wrangler on :8787, local D1. SetVITE_API_URL=http://localhost:8787/api.npm run dev:api:node→server.tson :8080 (usesbun:sqlite, auto-applies migrations on boot, reads.dev.vars). SetVITE_API_URL=http://localhost:8080/api.4. Run the frontend
npm run dev # Vite (mode=staging) on :51735. Tests
Environment variables
Frontend (
.env)VITE_API_URLhttp://localhost:8787/apifor Wrangler,:8080for Bun). What the catalog/geographies/scenarios calls hit.VITE_DATA_API_URLimpact-time,unavoidable-risk,geo-shape,avoiding-*) — still used.VITE_HEROKU_URLVITE_STRAPI_LOCALEen).VITE_MAPBOX_STYLE_*,VITE_APP_URLAPI secrets (
.dev.vars) — consumed by the Worker /server.tsIXMP4_USERNAME/IXMP4_PASSWORDprovide-internalinstance the catalog reads from.Notes / follow-ups
unavoidable-riskis a stub (ensemble data not yet onprovide-internal); GMT band is an interim reuse of the chart's own region (no World region in ixmp4 yet).stories/caseStudiesresolution is dead/legacy and slated for a separate cleanup.