Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
API Services Portal provides a multi-tenant frontend integrating API Gateway and Authorization services from Kong CE and Keycloak.
The API Services Portal is a multi-tenant frontend from BC Government that lets API providers manage the lifecycle of their APIs and developers discover and access them, pairing a React/Next.js web application with Kong Gateway and Keycloak for authorization.
The API Services Portal is an open-source web application that functions as a frontend for API providers to manage the lifecycle of their APIs and for developers to discover and access those APIs. It runs alongside the Kong Community Edition Gateway and Keycloak IAM solution, and is built with React, Next.js, KeystoneJS V5, and the Chakra UI component library. The repository is maintained by BCGov, the British Columbia government's GitHub organization, and is licensed under an open-source license.
src/lists/* using KeystoneJS lists, covering namespaces, products, services, consumers, and authorization profiles.src/nextapp/*, uses TypeScript, and follows the BC Government Web Design System via a custom Chakra theme with variants for core components.src/authz centralizes access rules based on UMA Namespace resources and Permissions from a Requesting Party Token (RPT) held in the KeystoneJS session.src/batch/feedWorker.js) pulls content from external sources, with supported feeders for CKAN, Kong, and Prometheus.queries.types.ts in src/nextapp/shared/types.npm run storybook.npm run mock-server) provides fake data for development and testing, though it does not replicate the production API 1-to-1.GatewayConfig.Publish permission.Namespace.Manage or ownership.The portal is split into six components: the KeystoneJS data model, the Next.js UI, OAuth2-Proxy authentication, the authorization engine, an ingestor, and feeders. Locally, docker compose spins up Postgres, Keycloak, OAuth2-Proxy, the Gateway Admin API (gwa-api), and Kong Gateway, exposing the portal at http://oauth2proxy.localtest.me:4180 with test users janis@idir and local.
It uses React with the Next.js framework for the frontend, KeystoneJS V5 for the backend data model, and Chakra UI for components. The client-side app is written in TypeScript, and GraphQL types are generated automatically in development mode.
Clone the repo, build the Gateway Admin API from the gwa-api repo, then run docker compose build and docker compose up. The portal will be available at http://oauth2proxy.localtest.me:4180, and you can log in with the test credentials listed in the README.
Keycloak provides identity and access management. It is initialized with a master realm (configuration in local/keycloak/master-realm.json) and a realm user local with admin privileges. Keycloak issues tokens that OAuth2-Proxy exchanges for the portal's authentication flow.
No, the mock server is designed to fake data via GraphQL for development and testing. It replicates requests and confirms expected behavior, but a 1-to-1 replication of the production API is not its goal. When Keystone-level types change, you must manually update the mock server schemas.
