<p align="center">
<img src="docs/docs/.vuepress/public/images/logo.png" alt="PluginCore">
</p>
<h1 align="center">PluginCore</h1>
English | [ä¸æ](README_zh.md)
> ð `ASP.NET Core` lightweight plugin framework | ASP.NET Core è½»é级 æ件æ¡æ¶ - ä¸åééæ | Vue.js frontend | JavaScript SDK
[![repo size](https://img.shields.io/github/repo-size/yiyungent/PluginCore.svg?style=flat)]()
[![LICENSE](https://img.shields.io/github/license/yiyungent/PluginCore.svg?style=flat)](https://github.com/yiyungent/PluginCore/blob/main/LICENSE)
[![CodeFactor](https://www.codefactor.io/repository/github/yiyungent/plugincore/badge)](https://www.codefactor.io/repository/github/yiyungent/plugincore)
[![downloads](https://img.shields.io/nuget/dt/PluginCore.svg?style=flat)](https://www.nuget.org/packages/PluginCore/)
[![QQ Group](https://img.shields.io/badge/QQ%20Group-894031109-deepgreen)](https://jq.qq.com/?_wv=1027&k=q5R82fYN)
[![Telegram Group](https://img.shields.io/badge/Telegram-Group-deepgreen)](https://t.me/xx_dev_group)
<!-- ![hits](https://api-onetree.moeci.com/hits.svg?id=PluginCore) -->
[![CLA assistant](https://cla-assistant.io/readme/badge/yiyungent/PluginCore)](https://cla-assistant.io/yiyungent/PluginCore)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fyiyungent%2FPluginCore.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fyiyungent%2FPluginCore?ref=badge_shield)
## 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 `wwwroot` folder, 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 middleware` at 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 (`SharpZipLib` for decompression)
- **Globalization** - Thanks to the internationalization implementation of `i18n`, it provides multi-language switching support
## Online demo
- [https://knifehub.onrender.com](https://knifehub.onrender.com)
- Username: admin Password: ABC12345
- Online demo, use [KnifeHub](https://github.com/yiyungent/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
> å
³è线ä¸äº§å:
> - [https://120365.xyz](https://120365.xyz)
> - å¨çº¿å·¥å
·é
> - æ°æ®åæå¯è§å
> - æ¶é´ç®¡ç
> - æçå·¥å
·ç®±
## Screenshot
![](screenshots/1.png)
![](screenshots/2.png)
![](screenshots/3.png)
![](screenshots/4.png)
## One minute integration
Recommended Use [NuGet](https://www.nuget.org/packages/PluginCore), 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
```bash
PM> Install-Package PluginCore.AspNetCore
```
> Modify the code in your ASP.NET Core application
>
> Startup.cs
```C#
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`
```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)](https://github.com/yiyungent/PluginCore/tree/main/examples)
```bash
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 use `Docker Compose`, you can refer to `docker-compose.yml` in the root directory of the warehouse
> add:
> Use `ghcr.io`
>
> ```bash
> docker run -d -p 5004:80 -e ASPNETCORE_URLS="http://*:80" --name plugincore-aspnetcore3-1 ghcr.io/yiyungent/plugincore-aspnetcore3-1
> ```
## Use
- [Detailed Documentation(/docs)](https://yiyungent.github.io/PluginCore "Online Documentation") Document is under construction
- [API Docs](https://yiyungent.github.io/PluginCore/docs-api/api/index.html "API Docs") automatic update
- [See examples(/examples)](https://github.com/yiyungent/PluginCore/tree/main/examples)
### Add plugin hook and apply
> 1. For example, custom plug-in hook: `ITestPlugin`
```C#
using PluginCore.IPlugins;
namespace PluginCore.IPlugins
{
public interface ITestPlugin : IPlugin
{
string Say();
}
}
```
> 2. Apply the hook where it needs to be activated, so that all enabled plug-ins that implement `ITestPlugin` will call `Say()`
```C#
using PluginCore;
using PluginCore.IPlugins;
namespace WebApi.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class TestController : ControllerBase
{
private readonly PluginFinder _pluginF
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
PluginCore-main.zip (520个子文件)
.babelrc 108B
add-header-batch.bat 388B
.env.cdn 80B
PluginsController.cs 28KB
PluginCoreStartupExtensions.cs 18KB
ZipHelper.cs 17KB
PluginFinderV2.cs 12KB
PluginFinderV1.cs 12KB
PluginApplicationBuilder.cs 11KB
DebugController.cs 10KB
LogUtil.cs 8KB
GitHubController.cs 7KB
AppCenterController.cs 7KB
PluginPathProvider.cs 7KB
DependencySorter.cs 6KB
FileUtil.cs 6KB
NupkgService.cs 6KB
DemoModeMiddleware.cs 6KB
PluginSettingsModelFactory.cs 6KB
IServiceProviderExtensions.cs 6KB
PluginCoreAdminUIMiddleware.cs 6KB
PluginServiceProvide.cs 6KB
NuGetController.cs 5KB
PluginContextPackV1.cs 5KB
PositivePluginLoadContext.cs 5KB
PluginContentFilterMiddleware.cs 5KB
AccountManager.cs 5KB
UserController.cs 4KB
LazyPluginLoadContext.cs 4KB
HexoPlugin.cs 4KB
PluginTimeJobBackgroundService.cs 4KB
PluginInfoModelFactory.cs 4KB
WebSocketDemoPlugin.cs 4KB
PluginWidgetController.cs 4KB
DateTimeUtil.cs 3KB
DateTimeUtil.cs 3KB
PluginCoreAdminUIBuilderExtensions.cs 3KB
PluginConfigModelFactory.cs 3KB
PluginCoreAdminUIRemoteFileProvider.cs 3KB
Startup.cs 3KB
PluginContextManager.cs 3KB
PluginCoreAuthenticationHandler.cs 3KB
AspNetCorePluginManagerV1.cs 3KB
IPluginFinder.cs 3KB
PluginCoreAdminUIOptions.cs 3KB
PluginCoreHostingStartup.cs 2KB
AspNetCorePluginManager.cs 2KB
PluginControllerManager.cs 2KB
PluginApplicationBuilderManager.cs 2KB
PluginCoreConfigFactory.cs 2KB
WebSocketController.cs 2KB
PluginStartupXMiddleware.cs 2KB
Startup.cs 2KB
HelloWorldPlugin.cs 2KB
BasePlugin.cs 2KB
WebSocketConnectionManager.cs 2KB
SayHelloMiddleware.cs 2KB
Startup.cs 2KB
HomeController.cs 2KB
PluginCoreAdminAuthorizationHandler.cs 2KB
IPlugin.cs 2KB
PluginHttpStartFilterMiddleware.cs 2KB
PluginHttpEndFilterMiddleware.cs 2KB
GitHubApiPlugin.cs 2KB
PluginManager.cs 2KB
PluginContextPack.cs 2KB
PluginInfoModel.cs 2KB
PluginReadmeModelFactory.cs 2KB
TestTimeJobPlugin.cs 1KB
DemoModePlugin.cs 1KB
NuGetPackageItemModel.cs 1KB
WeatherForecastController.cs 1KB
WeatherForecastController.cs 1KB
WeatherForecastController.cs 1KB
LanguageMiddleware.cs 1KB
SettingsModel.cs 1KB
PluginFinder.cs 1KB
HomeController.cs 1KB
HomeController.cs 1KB
WeatherForecastController.cs 1KB
IStartupXPlugin.cs 1KB
WeatherForecastController.cs 1KB
CollectibleAssemblyLoadContext.cs 1KB
PluginCoreConfig.cs 1KB
HomeController.cs 1KB
PluginActionDescriptorChangeProvider.cs 1KB
NatashaPluginContext.cs 1KB
IStartupPlugin.cs 1KB
Md5Helper.cs 1KB
TimeBackgroundService.cs 1KB
Program.cs 1KB
ExamplePlugin.cs 1KB
PluginConfigModel.cs 1KB
Program.cs 1KB
PluginRegistryResponseModel.cs 1KB
PluginCoreAdminAuthorizeAttribute.cs 995B
Program.cs 980B
Program.cs 976B
IPluginContext.cs 973B
Program.cs 960B
共 520 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
疾风铸境
- 粉丝: 669
- 资源: 95
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- js-leetcode题解之141-linked-list-cycle.js
- js-leetcode题解之140-word-break-ii.js
- js-leetcode题解之139-word-break.js
- js-leetcode题解之138-copy-list-with-random-pointer.js
- js-leetcode题解之136-single-number.js
- js-leetcode题解之135-candy.js
- js-leetcode题解之134-gas-station.js
- 基于tensorflow的道路桥梁裂缝检测应用源码
- 多台设备循环控制仿真和代码protues仿真
- 多台设备循环控制原理图
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功