Architecture
ADP follows a strict layered architecture where each layer has clear responsibilities and dependencies flow in one direction.
Layers
1. Kernel
The core engine. Framework-independent — depends only on PSR interfaces and generic PHP libraries. Manages:
- Debugger — Lifecycle management (start, collect, flush)
- Collectors — Gather runtime data via CollectorInterface
AppDevPanel\Kernel\Collector\CollectorInterfaceDebug data collector responsibility is to collect data during application lifecycle. - Storage — Persist debug data (JSON files by default) via StorageInterface
AppDevPanel\Kernel\Storage\StorageInterfaceDebug data storage responsibility is to store debug data from collectors added - Proxies — Intercept PSR interfaces transparently
2. API
HTTP layer built on PSR-7/15. Provides:
- REST endpoints — Fetch debug entries, collector data
- SSE — Real-time notifications for new entries
- Inspector — Runtime inspection endpoints (config, routes, database schema, etc.)
- MCP — AI assistant integration via Model Context Protocol
- Ingestion — Accept debug data from external (non-PHP) applications
3. Adapters
Framework bridges. Each adapter:
- Registers proxy services in the framework's DI container
- Maps framework lifecycle events to Debugger
AppDevPanel\Kernel\DebuggerClass Debugger.::startup()/::shutdown() - Configures collectors and storage with framework-appropriate settings
- Registers API routes (
/debug/api/*,/inspect/api/*) - Serves the debug panel frontend at
/debug - Implements framework-specific inspector providers (config, routes, database schema)
4. Frontend
React 19 SPA with:
- Material-UI 5 design system
- Redux Toolkit for state management
- Module system (Debug, Inspector, LLM, MCP, OpenAPI, Frames)
Dependency Graph
┌────────────────────────────────────────────────────────┐
│ Dependency Direction │
│ │
│ Adapter ──▶ API ──▶ Kernel │
│ │ ▲ │
│ └───────────────────┘ │
│ │
│ Cli ──▶ API ──▶ Kernel │
│ │
│ Frontend ──▶ API (via HTTP only) │
└────────────────────────────────────────────────────────┘- Kernel depends on nothing (PSR interfaces only)
- API depends only on Kernel
- Cli depends on Kernel and API
- Adapter depends on Kernel, API, and the target framework
- Frontend communicates via HTTP — no PHP dependencies
Dependency Rules
The core principle: common modules must never depend on framework-specific code.
| Module | Can depend on | Cannot depend on |
|---|---|---|
| Kernel | PSR interfaces only | API, Cli, Adapter, any framework |
| API | Kernel, PSR interfaces | Adapter, any framework |
| Cli | Kernel, API, Symfony Console | Adapter, any framework |
| Adapter | Kernel, API, Cli, framework packages | Other adapters |
| Frontend | Nothing (HTTP only) | Any PHP package |
WARNING
Adapters must not depend on other adapters. Each adapter is an independent bridge between the Kernel and a specific framework.
Abstractions
Storage and serialization remain behind interfaces to ensure pluggability:
Data Flow
- Target app runs with an Adapter installed
- Adapter registers proxies that intercept PSR interfaces
- Proxies feed data to Collectors
- On request completion, Debugger flushes collector data to Storage
- API serves stored data; SSE notifies the frontend
- Frontend renders the data
See Data Flow for the full lifecycle details.
Frontend Module System
The frontend uses a module system where each module implements ModuleInterface:
interface ModuleInterface {
routes: RouteObject[];
reducers: Record<string, Reducer>;
middlewares: Middleware[];
standalone: boolean;
}Current modules: Debug, Inspector, LLM, MCP, OpenAPI, Frames.
Creating a New Adapter
When creating an adapter for a new framework:
- Create
libs/Adapter/<FrameworkName>/ - The adapter must depend on app-dev-panel/kernel
app-dev-panel/kernelView on Packagist - The adapter may depend on app-dev-panel/api
app-dev-panel/apiView on Packagist(for route and inspector registration)
- The adapter may depend on app-dev-panel/cli
app-dev-panel/cliView on Packagist(for CLI commands)
- The adapter must not depend on other adapters
- The adapter must not modify Kernel or API code — only wire into them via configuration
Adapter Responsibilities
Reference Implementations
| Adapter | Framework | Pattern |
|---|---|---|
| Symfony | Symfony 6.4–8.x | Bundle + Extension + CompilerPass |
| Yii2 | Yii 2 | Module + BootstrapInterface |
| Yii 3 | Yii 3 | Config plugin + ServiceProvider |
| Laravel | Laravel 11.x–12.x | ServiceProvider (register + boot) |
Minimal Checklist
composer.jsonwith app-dev-panel/kernelapp-dev-panel/kernelView on Packagist+ app-dev-panel/api
app-dev-panel/apiView on Packagistdependencies
- Lifecycle event mapping → Debugger
AppDevPanel\Kernel\DebuggerClass Debugger.::startup()/::shutdown() - Register Kernel PSR proxies as service decorators (logger, events, HTTP client)
- Wire FileStorage
AppDevPanel\Kernel\Storage\FileStorageClass FileStorage. with a framework-appropriate path - Register API controller routes
- Create a playground for testing and demo