Skip to content

Repository files navigation

Trilemma Data

Find actively maintained, authoritative datasets and test whether they can power a focused microproduct.

Choose a Dataset. Build a Microproduct.

Host: data.trilemma.foundation
Stack: Next.js + TypeScript + Vercel
License: MIT (application/code)

Security issues should be reported privately as described in SECURITY.md.

The dataset files themselves are not redistributed or relicensed. This app stores metadata and links to the original authoritative source.

Core experience

Each dataset includes searchable metadata, authoritative source links, practical access instructions, a copyable Python example, and a small project for testing a useful product signal.

The catalog optimizes for beginner clarity, contribution simplicity, and dataset quality — not catalog size.

Architecture

Public GitHub repo
        │
        ├── YAML dataset metadata
        ├── vocabulary, collections, and maintainer registries
        │
        ▼
TypeScript validation (Zod)
        │
        ▼
Next.js static export
        │
        ▼
Vercel → data.trilemma.foundation

No database, authentication, admin panel, backend service, or dataset storage. Generated Colab notebooks for beginner, no-key guides are committed under public/notebooks and must be produced by npm run generate-notebooks, never edited by hand.

Brand contract

Trilemma Data is a product extension of the main Trilemma Foundation website, not a separate brand. The main website is the canonical visual reference. The versioned design contract records its source revision, tokens, interaction rules, and checksums.

  • Ghost-white #F1F1F9 reading and catalog surfaces with navy #1E1E44 feature areas
  • Ink #0A0A14 text, periwinkle #8E8ECD primary actions, and peach #FFC999 secondary actions
  • Azure #5858C8 links and light-surface focus; amber #FF9940 dark-surface focus
  • Roboto typography, 10px controls, 16px cards, and 44px minimum interactive targets

Data renders only its local header (Datasets, Build Paths, Contribute), with sticky offsets measured from its actual height. The shared Foundation footer remains. Run npm run check:design when updating the vendored contract.

Editing content

Content has two explicit sources of truth:

  • Shared application, navigation, accessibility, and SEO copy lives in src/content/site-copy.ts. Non-description text uses Chicago Title Case; descriptions and other body copy stay in sentence case.
  • Dataset descriptions and beginner guides live with their metadata in the corresponding data/datasets/*.yaml file.

Each dataset selects one broad catalog theme. Domain and task tags are normalized through data/vocabulary.yaml: aliases stay searchable and keep old filter URLs working, while only filterable canonical terms appear in the catalog drawer.

Curated build paths live in data/collections and maintainer ownership in data/maintainers.yaml. Those files are maintainer-owned editorial surfaces, not part of an ordinary dataset pull request.

Write in direct, practical language. Lead with the microproduct use or decision the data could support, define provider-specific terms, and state the limitation that matters most. Avoid hype, unsupported claims, and generic encouragement. Shared copy is typed; dataset copy is validated by the existing YAML schema and validation commands.

Local development

Prerequisites: Node.js 22 and Python 3. Python is used by dataset validation to syntax-check the beginner examples.

npm install
npm run dev

npm run dev uses port 3000 when that localhost port is free. If it is busy, the next free port is used instead.

Useful scripts:

npm run validate-datasets          # policy + guide copy + Python syntax + live page identity
npm run validate-datasets:offline  # policy + guide copy + Python syntax, no network
npm run validate-providers         # bounded live provider contract checks
npm run generate-notebooks         # rewrite committed beginner/no-key Colab notebooks
npm run generate-notebooks:check   # fail if committed notebooks drifted
npm run maintenance-report         # live URL checks + Markdown/JSON report; exits 1 after writing artifacts if URLs fail
npm run maintenance-report:offline # editorial buckets only, no network, exit 0
npm run validate-python-runtime    # allowlisted live Python canaries (not used in PRs)
npm run lint                       # Next.js and TypeScript lint checks
npm test                           # Vitest unit tests
npm run test:coverage              # 100% statement/branch/function/line coverage for src/lib
npm run build                      # static export to out/
npm run test:e2e                   # browser tests against the built export

This project uses Next.js static export (output: "export"). After npm run build, serve the out/ directory with any static file server (for example npx serve out). next start is not used.

The browser suite starts that static server automatically. It also reads each built dataset guide HTML file and checks that the YAML copy, source links, Python example, first project, and JSON-LD are present. Install the Playwright browsers once with npx playwright install chromium firefox webkit, then run the build and suite:

npm run build
npm run test:e2e

The browser checks report and enforce separate JavaScript, CSS, HTML, static RSC, compressed-code, analytics, landing, and notebook-asset budgets, plus automated WCAG checks for the catalog, collection/theme landings, contribute, and dataset guides. Raise a budget or accessibility exception only with a documented reason and intentional review.

Pull-request validation is deterministic and credential-free: it checks schema, vocabulary/collection/maintainer integrity, the 90-day maintenance policy, guide copy, Python syntax, notebook determinism, controlled provider fixtures, lint, 100% src/lib coverage, and the static application. It does not execute contributed Python. After pushes to main, every Monday, and on manual dispatch, GitHub Actions runs configured provider-contract checks in the dataset-validation job and runs npm run maintenance-report in a separate live-maintenance job so URL checks do not share a 15-minute clock with provider contracts. The report performs the live source and data-terms URL pass, writes reports/maintenance-report.*, and fails only after those artifacts exist. Weekly and manual runs also execute a small allowlisted Python runtime canary that cannot fail the pull-request gate. Dataset URLs must use HTTPS without embedded credentials. Live validation rejects private or link-local destinations and revalidates every same-host redirect before requesting it.

Adding a dataset

See CONTRIBUTING.md. Short version:

  1. Fork
  2. Copy data/datasets/_template.yaml
  3. Rename to <dataset-id>.yaml
  4. Fill in metadata and the beginner getting_started guide
  5. Open a PR

No application code changes required.

Catalog

The catalog currently contains 159 operational datasets spanning natural hazards, weather, water, climate, flood risk, drought, space weather, global disaster alerts, public health, clinical research, cybersecurity, package graphs, legislation, sanctions screening, government spending and procurement, transit, labor and international markets, trade, nutrition, scholarly research, biodiversity, forced displacement, demographics, corporate filings, electricity, petroleum inventories, prediction markets, geospatial analysis, places, broadband, bridges, EV charging, consumer finance, education, K-12 directories, housing prices, rents, food and product recalls, elections, European statistics, live transit feeds, aviation, provider directories, drinking water, preprints, pageviews, agriculture, tropical cyclones, crime, companies, occupations, global forecasts, live OSM, food products, nursing homes, LEI, euro-area statistics, patents, vital statistics, mortgages, OECD and national statistics, Mauna Loa CO2, sea ice, caselaw, lobbying, Certificate Transparency, public GitHub activity, wastewater surveillance, discrete water-quality samples, building permits, workplace severe-injury reports, global electricity mix, UNESCO education indicators, global air-quality monitors, EU law, and Vancouver property, licensing, civic-service, urban-forest, zoning, council, parking, and road-closure data. The YAML files in data/datasets are the source of truth for the current list.

Deploy to Vercel

  1. Push this repository to GitHub
  2. Import the repo in Vercel (framework preset: Next.js)
  3. Use the Next.js framework preset and npm run build; leave the Output Directory at Vercel's framework default
  4. Add custom domain data.trilemma.foundation in the Vercel project settings
  5. Create the DNS record Vercel shows (usually a CNAME) at your DNS provider

Static export is configured via output: "export" in next.config.ts.

Shared Foundation design

See the versioned design contract and the implementation, route coverage, and visual evidence.

About

Find data to build your next microproduct

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Used by

Contributors

Languages