Source for www.openspending.org: the OpenSpending website and its catalog of fiscal datasets.
It's a Next.js site built with PortalJS components:
- Content: the blog, stories, help and about pages are Markdown in
content/, indexed at build time with MarkdownDB. - Datasets: dataset pages (
/@<org>/<project>) are generated at build time from GitHub repos listed inorgs.json(e.g. theos-dataorg).
Requires Node.js 22.
npm install
GITHUB_PAT=<a GitHub token> npm run devGITHUB_PAT is read in next.config.js and used to fetch dataset repos from the GitHub API at build time. Without it you'll quickly hit GitHub's unauthenticated rate limit.
Other scripts:
The site is deployed on Vercel (Datopian team, project portaljs-openspending), which serves www.openspending.org and openspending.org. A push to main deploys to production; other branches get preview deployments. GITHUB_PAT is set in the Vercel project's environment variables.
This code lived in datopian/portaljs as examples/openspending until October 2026, when it moved here. The last version there is datopian/portaljs@59d816c.
Changes made during the move:
- Lint during builds:
next.config.jssetseslint.ignoreDuringBuilds, so lint errors don't block a deploy. Inside the monorepo, lint didn't run against this code. - ESLint config:
.eslintrc.jsonpointedno-html-link-for-pagesat a staleexamples/simple-example/pages; it now points atpages.
Known lint issues to fix: two conditional useQuery calls in components/FlatUiTable.tsx (react-hooks/rules-of-hooks), and an unescaped apostrophe in components/Hero.tsx.
MIT
