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=YourAccessToken2
::: 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