PortalJS
repository·main·Indexed 25 days ago
https://github.com/datopian/portaljsAn AI-native framework for data teams to build and ship data portals. PortalJS provides agentic skills to advise on architecture and scaffold editable Next.js code, supporting various backends including static files, lakehouses, CKAN, and GitHub-backed catalogs.
What's inside portaljs
- The Flowershow default template is a starter application template designed for building websites. It is built using a modern web stack consisting of Next.js, Tailwind CSS, and MDX (Markdown with JSX).
Overview of the International Aid Transparency Initiative (IATI)
mainThe International Aid Transparency Initiative (IATI) is a technical standard launched in 2011 that allows aid donors to publish data about their activities and finances in a standardized format. Unlike traditional centralized databases, IATI follows open data principles, allowing information to flow between organizations via feeds. This enables a distributed ecosystem where donors, governments, and software providers can access and consume aid data through various applications.
Key Characteristics:
- Fiscal Scope: Covers revenue, spending, and off-budget information.
- Project Aims: Focuses on publishing better data, getting feedback to policy makers, and enabling data analysis.
- Technology: Primarily web-based, utilizing data visualization, maps, and standardized formats.
- Geographical Coverage: International.
- Primary Users: Donors, parliaments of developing countries, and private companies/foundations.
Overview of PortalJS Task-Oriented Guides
mainPortalJS provides task-oriented guides for common data portal requirements. Each guide offers two implementation methods that result in the same editable code:
- The AI path: Using an agentic command (a "skill") to automate the task.
- The by-hand path: Performing the manual code edits yourself.
Note: These guides assume you have already scaffolded a portal using the
portaljs-new-portalskill. If you are starting from scratch, refer to the Get started and Quickstart documentation first.Overview of the Fiscal Data Package specification
mainThe Fiscal Data Package is a lightweight, user-oriented format designed for publishing and consuming fiscal data. It is built to be open, modular, and extensible, allowing it to work with data as it currently exists without forcing publishers to restructure their files.
Key characteristics include:
- Universal Components: Can be produced using ordinary spreadsheet software and used in any environment.
- Non-opinionated: Does not dictate which datasets or fields must be published, focusing instead on how to package and convey the meaning of existing data.
- Extensible: Allows for gradual implementation, making it easier to improve data quality over time.
- Standard-based: Based on the Tabular Data Package v1.
Note that this specification is accompanied by two specific fiscal taxonomies for standardized publishing:
- The Budget Fiscal Data Package Standard
- The Spending Fiscal Data Package Standard
Overview of the UK Departmental Spending data project
mainThe UK Departmental Spending project is a collaboration between OpenSpending and data.gov.uk designed to address the patchy nature of government expenditure reporting. It provides a data cleansing and validation toolkit to make spending data available at regular intervals and helps identify departments that fail to meet HM Treasury reporting guidelines.
Key features include:
- A tool to list public bodies registered as data publishers on data.gov.uk.
- Detailed reporting on compliance with HM Treasury guidelines.
- Availability of reported data for search and analysis via the OpenSpending platform or through bulk downloads.
What is PortalJS and how is it organized
mainPortalJS is an agentic skills framework designed to help data teams build and ship data portals along with the underlying data infrastructure. It operates across three distinct layers:
- Decision Layer: Uses advisory skills (e.g.,
/portaljs-architect) to recommend an architecture based on your specific needs (storage, compute, catalog, access, and hosting). - Build Layer: Scaffolds and wires the chosen stack using generative skills and four core pluggable contracts.
- Presentation Layer: The user-facing portal, which consists of three surfaces: Home, Catalog, and Showcase.
- Decision Layer: Uses advisory skills (e.g.,
Overview of @portaljs/ckan capabilities
mainThe
@portaljs/ckanlibrary is designed for use with a CKAN backend and provides three main functional areas:- CKAN API Object: A client for making API calls to your CKAN instance.
- Types: TypeScript definitions that map to CKAN API objects.
- Components: Pre-built UI components common to data portals, such as searching, pagination, and listing components.
Overview of OpenSpending Next tools
mainOpenSpending Next is a suite of tools designed for visualizing, analyzing, and publishing budget and spending data based on the Fiscal Data Package standard. The core toolset includes:
- OS Packager: Maps fiscal data to the standard and creates Fiscal Data Packages from CSV files for upload to the OpenSpending API.
- OS Viewer: Provides tools to create and customize visualizations (Treemaps, pie charts, bar charts, geolocation, line charts, tables) from budget data.
- OS Explorer: A tool for discovering and exploring existing fiscal datasets.
- OS DataMine: An analytical tool built on re:dash for performing deep queries on fiscal data.
- OS API: A V3 API (based on Babbage) that includes a backwards-compatible implementation of the OpenSpending V2 API.
Explore awesome data collections by subject
mainPortalJS provides access to 'awesome collections', which are curated groups of datasets from DataHub and the web organized by subject. You can explore these collections to find specific types of data for your projects.
Available collections include:
- Economic data: A summary of all available economic indicators.
- Reference data: Datasets that include instructions for use across various tools and programming languages.
- Demographics: Population data and data analytics.
- Stock market data: Ready-to-use datasets for market analysis.
To browse all available collections, visit: https://datahub.io/awesome
Understand the PortalJS Catalog Template structure
mainThe PortalJS Catalog Template is designed for dynamic routing and managing large datasets. The architecture relies on a central manifest and specific file patterns to handle data and routing:
datasets.json: The manifest file acting as the single source of truth for the entire catalog.lib/datasets.ts: Contains typed loaders (getDatasets,getDataset,datasetHref) and definesNAMESPACE_TYPE.pages/index.tsx: The landing page featuring a hero section, search CTA, and suggested chips.pages/search.tsx: A searchable list of datasets that reads the manifest viagetStaticProps.pages/[owner]/[slug].tsx: A dynamic route for dataset showcases, using the pattern/@<namespace>/<slug>.public/data/: Contains bundled sample CSVs. Note that larger formats like Parquet or PMTiles are hosted externally on R2 (e.g.,data.portaljs.com).components/Table.tsx: An interactive component providing search, sort, and pagination functionality.
Benefits of connecting data portals to AI assistants via MCP
mainUsing an MCP server to connect data portals to AI assistants enables several high-value capabilities for end-users:
- Natural Language Querying: Ask questions like "Show me environmental datasets from 2020" instead of navigating complex UI filters.
- Instant Summarization: Get summaries of complex datasets without manual browsing.
- Relationship Discovery: Identify connections between datasets across different organizations.
- Metadata Access: Retrieve and understand resource metadata through conversational interfaces.
- Workflow Integration: Bring data discovery directly into existing AI-driven workflows.
Get started with PortalJS
mainPortalJS is an AI-native framework designed for building data portals (sites that list datasets and render them via tables, charts, or maps). It combines a lightweight Next.js + Tailwind + React template with a set of agentic skills (Claude Code commands) that allow an AI assistant to perform the assembly of your portal.
Key features include:
- Agentic Assembly: Use specific commands to scaffold portals, add datasets, charts, maps, connect to CKAN, or deploy.
- Plain, Editable Code: Everything the AI assistant writes is standard Next.js code. There is no proprietary runtime or lock-in; you can hand-edit any file directly at any time.
- Decoupled Architecture: It follows a 'bring-your-own-stack' philosophy, providing a template that is easy to customize.