How apache/apisix-dashboard works
1. Manager API (backend) – Located in the "api" directory. This component is written in Go and provides the REST APIs. It is responsible for parameter validation, configuration changes (including writing to etcd), and for interacting with Apache APISIX. Its structure (with subdirectories like internal/core, handler, filter, storage, etc.) suggests a modular design with clearly separated concerns, similar to standard MVC or layered architecture models.
2. Frontend Dashboard (web) – Found under the "web" directory. This part is the user interface implemented using modern web technologies (React with TypeScript, as evident from the file types and structure). It includes various UI components, pages, and integration tests (using Cypress, Jest), which indicate a dynamic, component-based architecture. It communicates with the backend APIs to drive the dashboard functions.
A. Main Components:
• Frontend (Dashboard UI):
• Represented by the "web" directory.
• Contains pages (Consumer, Route, SSL, etc.), components (ActionBar, HeaderDropdown, Plugin UI, etc.), and helper utilities.
• Includes extensive testing (e.g., Cypress tests under web/cypress) which you might include as ancillary details.
• Manager API (Backend):
• Represented by the "api" directory.
• Contains modules for configuration (conf), routing (handler), core logic (internal/core), server functionalities, filters (authentication, CORS, etc.), persistence/storage (etcd interactions), and testing.
• This component validates inputs from the frontend and interacts with etcd.
• Data Store (etcd):
• Although not part of the repository, it is a critical external dependency that stores the current configuration for Apache APISIX.
• Apache APISIX (Data Plane):
• The backend ultimately manipulates Apache APISIX resources. It can be shown as the target system that receives configuration updates.
• CI/CD & Deployment:
• Elements such as Dockerfile, GitHub Actions workflows, Makefile, and other build/deployment scripts as supporting infrastructure.
• Supporting Elements:
• External integrations such as APISIX Ingress Controller (not directly represented but can be annotated) and testing frameworks.
B. Relationships and Interactions:
• Where applicable, add connections showing data validation and routing logic inside the API (for instance, from various “handler” modules to “core” and “storage” components).
C. Architectural Patterns and Design Principles:
• Separation of concerns between the API and web UI.
• Modularity within the API (modules for authentication, routing, plugins, storage, etc.) and the careful use of REST APIs to facilitate clean separation.
• The use of configuration files (e.g., YAML files for GitHub workflows and API configurations in “conf”) can be noted as part of infrastructure as code principles.
• Demonstrate how testing is incorporated (with unit tests and end-to-end tests) by noting test directories in both API and web parts.
• For a full-stack application like this, represent the backend and frontend as separate but communicating components.
• Rectangles for both frontend and backend.
• UI → Manager API (HTTP/REST)
• Manager API → etcd (configuration storage)
• etcd → Apache APISIX (configuration applied)
E. Diagramming Guidelines:
1. Top-level components: Frontend (web) and Manager API (api).
2. External systems: etcd and Apache APISIX.