Spaces:
Build error
Build error
Plugin System Overview
The PDF-TEI Editor uses two independent plugin systems:
Frontend Plugins (JavaScript)
Location: app/src/plugins/
Frontend plugins extend the browser-based UI using a class or object-based architecture:
- Dependency resolution - Automatic topological sorting ensures plugins load in correct order
- State management - Integration with immutable state system
- Lifecycle hooks -
install,start,shutdown,onStateUpdate - Plugin classes - Modern pattern with automatic state management via
Pluginbase class - Plugin objects - Legacy pattern with manual state tracking
See: Frontend Plugin System Documentation
Backend Plugins (Python)
Location: fastapi_app/plugins/
Backend plugins provide server-side functionality and API endpoints:
- Runtime discovery - Plugins discovered from
fastapi_app/plugins/andFASTAPI_PLUGIN_PATHS - Role-based access - Control plugin visibility and execution by user roles
- Custom routes - Optional FastAPI routes for specialized endpoints
- Frontend integration - Plugins appear in toolbar, return HTML/URLs for display
See: Backend Plugin System Documentation
Key Differences
| Aspect | Frontend Plugins | Backend Plugins |
|---|---|---|
| Language | JavaScript (ES6 modules) | Python |
| Location | app/src/plugins/ |
fastapi_app/plugins/ |
| Registration | Static array in app.js |
Runtime discovery |
| State | Reactive state management | Stateless endpoints with context |
| Dependencies | Topological sort via deps |
No inter-plugin dependencies |
| Lifecycle | install → start → shutdown | Registered at startup |
| Access Control | Client-side (state-based) | Server-side (role-based) |
Development Guides
- Frontend Plugin Development - Practical guide for creating UI plugins
- Backend Plugin Development - Practical guide for creating server plugins
- Frontend Plugin Architecture - Technical architecture details
- Backend Plugin Architecture - Technical architecture details