MineAdmin Plugin System β
The MineAdmin plugin system provides powerful extensibility, allowing developers to create reusable functional modules to achieve system modularity and scalability.
Plugin System Architecture β
MineAdmin's plugin system is based on the Hyperf framework's ConfigProvider mechanism, offering complete plugin lifecycle management and automated deployment capabilities.
Core Components β
1. Plugin Loader β
- File:
bin/hyperf.php
(GitHub) - Principle: Automatically loads all installed plugins during application startup via
Plugin::init()
- Implementation: Scans all plugins in the
plugin/
directory and registers their ConfigProvider
2. App-Store Component β
- Repository: mineadmin/appstore
- Functionality: Provides plugin download, installation, uninstallation, update, and other management features
- Configuration: Registers services and configurations via
ConfigProvider
3. Plugin Configuration System β
- Core File:
mine.json
- Principle: Defines plugin metadata, dependencies, installation scripts, and other information
- Loading: Parses and registers into the system during plugin installation
Official Plugins β
MineAdmin provides the following official plugins by default:
Plugin Name | Description | Repository |
---|---|---|
app-store | Application marketplace management plugin, providing plugin download, installation, uninstallation, update, and other management features | GitHub |
Note: Other plugins such as code generators, scheduled task managers, etc., can be obtained from the application marketplace or developed independently.
Plugin Types β
MineAdmin supports three types of plugins:
Mixed (Hybrid Plugins) β
Plugins containing both frontend and backend complete functionalities, providing full business modules.
Backend (Backend Plugins) β
Plugins containing only backend logic, primarily providing API services and business logic.
Frontend (Frontend Plugins) β
Plugins containing only frontend interfaces, primarily providing user interface components.
Getting Started β
Environment Setup β
Developing MineAdmin plugins requires:
Familiarity with the tech stack: MineAdmin and Hyperf framework
Obtaining AccessToken:
- Log in to MineAdmin Official Website
- Go to Personal Center β Settings Page
- Obtain AccessToken
Configuring Environment Variables:
# .env file
MINE_ACCESS_TOKEN=YourAccessToken
2
::: Warning Please keep your AccessToken secure to avoid leakage! :::
Developer Authentication β
- Local Development: No authentication required; free to develop and distribute
- Marketplace Release: Requires developer authentication; contact the MineAdmin team to obtain permissions
Related Documentation β
- Quick Start Guide - Create your first plugin
- Development Guide - Detailed development process
- Plugin Structure - Directory structure specifications
- Lifecycle Management - Installation and uninstallation process
- API Reference - Interface documentation
- Example Code - Practical cases