How kong/kong-manager works
Project Type and Purpose
• Kong Manager OSS is an open-source, frontend-based application built with Vue that provides a UI for interacting with Kong Gateway’s admin API. It does not contain its own backend database but relies on Kong Gateway to store and manage configuration.
• The project’s purpose is to allow users to view, edit, and manage Kong Gateway resources (like services, routes, plugins, certificates, etc.) by acting as a user-friendly layer on top of the admin API.
Identifying Main Components
• Frontend Application:
– Located mainly within the “src” directory. Components include files like App.vue, the layout in index.html, and Vue-based pages (e.g., pages for ca-certificates, certificates, services, consumers, plugins, etc.).
– The “src/services/apiService.ts” module indicates the application’s dedicated layer for interacting with the Kong admin API.
– Vue composables (in “src/composables”) and a well-structured organization of pages and components demonstrate adherence to modern SPA architectural patterns.
• External Service – Kong Gateway:
– The actual Kong Gateway instance is external (or can be run locally via the quickstart instructions). It is the target for all admin API requests made by Kong Manager OSS.
– The README emphasizes that the UI requires a running Kong Gateway instance (version 3.4+).
• Testing and CI Pipeline:
– There is an extensive “tests” directory with Playwright end-to-end tests indicating how the UI is validated against expected behavior.
– CI/CD configuration files in “.ci” and “.github” indicate automated tests, building, docker image creation, and deployment procedures.
• Build and Dependency Management:
– The project uses pnpm (as seen in package.json and pnpm-lock.yaml), Node.js (version 18+ in README), and Vite (vite.config.ts) for building and serving the application.
Relationships and Interactions
• Clients (browsers/users) access the static assets (index.html, public assets) that are served by a web server. These assets compile the Vue-based frontend.
• The UI application makes REST API calls to the Kong Gateway admin API through the API service layer.
• Data flows from the Kong Gateway to the UI and vice versa. The API service abstracts the HTTP calls, transforming configuration data for display and modification.
• CI/CD pipelines (using GitHub Actions and custom scripts in “.ci”) run tests (Playwright specs) and build/deploy the application. These pipelines are connected to the repository’s structure as indicated by the organized workflow and configuration files.
Architectural Patterns and Technology Usage
• The UI follows a component-based and modular architecture using Vue with components, composables, and Vue Router (src/router.ts) to manage state, navigation, and business logic.
• Separation of concerns is evident between the presentation layer (components/pages) and the communication layer (src/services/apiService.ts) that handles API interactions.
• The project uses modern JavaScript/TypeScript practices with configuration files (tsconfig.json, eslint.config.mjs, etc.) and utilizes Vite for module bundling and development server purposes.
• CI/CD and testing are highly automated, with Docker, GitHub Actions workflows, and Playwright tests ensuring the integration between the UI and Kong Gateway remains reliable.
– Ensure each component is clearly labelled. For instance, “Vue Components / Pages”, “API Service Layer”, “Router & State Management”, etc.
• Data flow: Browser → Kong Manager OSS (UI served) → Kong Admin API.
• CI/CD & testing flows that run builds, tests, and deployment procedures.