PluginCore
🔌 ASP.NET Core lightweight plugin framework | ASP.NET Core 轻量级 插件框架 - 一分钟集成 | Vue.js frontend | JavaScript SDK
Install / Use
/learn @yiyungent/PluginCoreREADME
English | 中文
<!--  -->🔌
ASP.NET Corelightweight plugin framework | ASP.NET Core 轻量级 插件框架 - 一分钟集成 | Vue.js frontend | JavaScript SDK
Introduce
🔌 ASP.NET Core lightweight plugin framework | ASP.NET Core 轻量级 插件框架 - 一分钟集成 | Vue.js frontend | JavaScript SDK
- Simple - Agreement is better than configuration, with minimal configuration to help you focus on your business
- Out of the box - Automatic front-end and back-end integration, two lines of code complete the integration
- Dynamic WebAPI - Each plug-in can add a Controller and have its own routing
- Plugin isolation and sharing - Perfect plugin isolation and type sharing
- Front and back ends of the plug-in are separated - You can place the front-end files (index.html,...) under the plugin
wwwrootfolder, and then visit/plugins/pluginId/index.html - Hot swap - Upload, install, enable, disable, uninstall, and delete without restarting the site; you can even add the
HTTP request pipeline middlewareat runtime through the plug-in, and there is no need to restart the site - Dependency injection - You can apply for dependency injection in the construction method of the plug-in class that implements IPlugin. Of course, dependency injection can also be used in the controller construction method
- Modular - Process modularization, full dependency injection, can be implemented by replacement to customize the plug-in mechanism
- Easy to expand - You can write your own plug-in SDK, then reference the plug-in SDK, write extension plug-ins-custom plug-in hooks, and apply
- Plugin dependency tree - Declarative dependencies, automatically establish the correct loading order according to the dependencies between plugins
- Life cycle - Controllable plug-in life cycle, perfect event distribution
- Widget - You can bury extension points in the front end, inject widgets through plug-ins, widgets have perfect HTML/CSS/JavaScript support, and elegant event dispatch
- No database required - No database dependency
- 0 intrusion - Nearly zero intrusion, does not affect your existing system
- Little reliance - Only rely on a third-party package (
SharpZipLibfor decompression) - Globalization - Thanks to the internationalization implementation of
i18n, it provides multi-language switching support
Online demo
- https://knifehub.onrender.com
- Username: admin Password: ABC12345
- Online demo, use KnifeHub, empty data from time to time
- Not the latest version
Tech Stack
- Backend: .NET/C#: .NET Standard & .NET Core & .NET & ASP.NET Core
- Frontend: Vue.js & vue-i18n & Vue Router & Vuex & Element UI
- Frontend: babel & mockjs & sass & autoprefixer & eslint & axios & npm
Related Online Products:
- https://120365.xyz
- Online Tools Collection
- Data Analysis Visualization
- Time Management
- Efficiency Toolbox
Screenshot




One minute integration
Recommended Use NuGet, Execute the following commands in the root directory of your project. If you use Visual Studio, then click Tools -> NuGet Package Manager -> Package Manager Console, make sure "Default project" It is the item you want to install, enter the command below to install it.
ASP.NET Core Project
PM> Install-Package PluginCore.AspNetCore
Modify the code in your ASP.NET Core application
Startup.cs
using PluginCore.AspNetCore.Extensions;
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
// 1. Add PluginCore
services.AddPluginCore();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseHttpsRedirection();
app.UseRouting();
// 2. Use PluginCore
app.UsePluginCore();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
Now visit https://localhost:5001/PluginCore/Admin to enter PluginCore Admin https://localhost:5001 Need to be changed to your address
Notice
Please log in to PluginCore Admin, and for safety, modify the default user name and password in time:
App_Data/PluginCore.Config.json
{
"Admin": {
"UserName": "admin",
"Password": "ABC12345"
},
"FrontendMode": "LocalEmbedded",
"RemoteFrontend": "https://cdn.jsdelivr.net/gh/yiyungent/plugincore-admin-frontend@0.1.2/dist-cdn"
}
After the modification, it will take effect immediately, no need to restart the site, you need to log in to PluginCore Admin again
Docker experience
If you need to experience PluginCore locally, then here is an example(/examples)
docker run -d -p 5004:80 -e ASPNETCORE_URLS="http://*:80" --name plugincore-aspnetcore3-1 yiyungent/plugincore-aspnetcore3-1
Now you can visit http://localhost:5004/PluginCore/Admin
add:
If you useDocker Compose, you can refer todocker-compose.ymlin the root directory of the warehouse
add:
Useghcr.iodocker run -d -p 5004:80 -e ASPNETCORE_URLS="http://*:80" --name plugincore-aspnetcore3-1 ghcr.io/yiyungent/plugincore-aspnetcore3-1
Use
- Detailed Documentation(/docs) Document is under construction
- API Docs automatic update
- See examples(/examples)
Add plugin hook and apply
- For example, custom plug-in hook:
ITestPlugin
using PluginCore.IPlugins;
namespace PluginCore.IPlugins
{
public interface ITestPlugin : IPlugin
{
string Say();
}
}
- Apply the hook where it needs to be activated, so that all enabled plug-ins that implement
ITestPluginwill callSay()
using PluginCore;
using PluginCore.IPlugins;
namespace WebApi.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class TestController : ControllerBase
{
private readonly PluginFinder _pluginFinder;
public TestController(PluginFinder pluginFinder)
{
_pluginFinder = pluginFinder;
}
public ActionResult Get()
{
//var plugins = PluginFinder.EnablePlugins<BasePlugin>().ToList();
// All enabled plugins that implement ITestPlugin
var plugins2 = _pluginFinder.EnablePlugins<ITestPlugin>().ToList();
foreach (var item in plugins2)
{
// transfer
string words = item.Say();
Console.WriteLine(words);
}
return Ok("");
}
}
}
Custom frontend
PluginCore supports 3 front-end file loading methods
FrontendModein the configuration fileApp_Data/PluginCore.Config.json
- LocalEmbedded
- By default, embedded resources and front-end files are packaged into dll. In this mode, it is not easy to customize the front-end files. You need to modify the source code of
PluginCoreand recompile. It is not recommended
- LocalFolder
- In the ASP.NET Core project that integrates
PluginCore, create a newPluginCoreAdmin, and put the front-end files into this folder
- RemoteCDN
- To use remote CDN resources, you can specify the url through the
RemoteFrontendin the configuration file
Note:
After updatingFrontendMode, the site needs to be restarted for the changes to take effect
Additional Information
Additional Information
To develop plugins, you only need to add a reference to the
PluginCore.IPluginspackage (plugin SDK),Of course, if you need
PluginCore, you can also add a reference
Specifications
- Plugin SDK
Plugin interfaces should be located in the
PluginCore.IPluginsnamespace. This is a convention, not mandatory, but it is recommended to do so,The assembly name does not have to be the same as the namespace name. Y
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
