GithubHelp home page GithubHelp logo

extcore / extcore Goto Github PK

View Code? Open in Web Editor NEW
792.0 89.0 145.0 642 KB

Free, open source and cross-platform framework for creating modular and extendable web applications based on ASP.NET Core

Home Page: http://extcore.net/

License: Other

C# 100.00%
asp-net-core extcore-framework plugin modular dotnet dotnet-core dotnetcore

extcore's Introduction

ExtCore 9.0.0

Join the chat at https://gitter.im/ExtCore/ExtCore

ExtCore logotype

Introduction

ExtCore is free, open source and cross-platform framework for creating modular and extendable web applications based on ASP.NET Core. It is built using the best and the most modern tools and languages (Visual Studio 2022, C# etc). Join our team!

ExtCore allows you to build your web applications from the different independent reusable modules or extensions. Each of these modules or extensions may consist of one or more ASP.NET Core projects and each of these projects may include everything you want as any other ASP.NET Core project. You don’t need to perform any additional actions to make it all work: any ASP.NET Core project can be used as an ExtCore-based web application extension by default. Controllers, view components, precompiled views, static content (added as resources) are resolved automatically. These projects may be then added to the web application in two ways: as direct dependencies (as source code or NuGet packages) or by copying compiled DLLs to the Extensions folder. ExtCore supports both of these options out of the box and at the same time.

Furthermore, any project of the ExtCore-based web application is able to discover the types that are defined inside all the projects (optionally using the predicates for assemblies filtering) and to get the implementations or instances of that types.

Any module or extension can execute its own code during the web application initialization and startup. You can use priorities to specify the correct order of the calls. This feature might be used for configuration, to register services etc.

ExtCore consists of two general packages and four optional basic extensions.

General Packages

ExtCore general packages are:

  • ExtCore.Infrastructure;
  • ExtCore.WebApplication.

ExtCore.Infrastructure

This package describes such basic shared things as IExtension interface and its abstract implementation – ExtensionBase class. Also it contains ExtensionManager class – the central element in the ExtCore types discovering mechanism. Most of the modules or extensions need this package as dependency.

ExtCore.WebApplication

This package describes basic web application behavior with Startup abstract class. This behavior includes modules and extensions assemblies discovering, ExtensionManager initialization etc. Any ExtCore web application must inherit its Startup class from ExtCore.WebApplication.Startup class in order to work properly. Also this package contains IAssemblyProvider interface and its implementation – AssemblyProvider class which is used to discover assemblies and might be replaced with the custom one.

Basic Extensions

ExtCore basic extensions are:

  • ExtCore.Data;
  • ExtCore.Data.EntityFramework;
  • ExtCore.Mvc;
  • ExtCore.Events.

ExtCore.Data

By default, ExtCore doesn’t know anything about data and storage, but you can use ExtCore.Data extension to have unified approach to working with data and single storage context among all the extensions. Storage might be represented by a database, a web API, a file structure or anything else.

ExtCore.Data.EntityFramework

Currently it supports MySQL, PostgreSql, SQLite, and SQL Server, but it is very easy to add another storage support.

ExtCore.Mvc

By default, ExtCore web applications are not MVC ones. MVC support is provided for them by ExtCore.Mvc extension. This extension initializes MVC, makes it possible to use controllers, view components, precompiled views, static content (added as resources) from other extensions etc.

ExtCore.Events

It can be used by the extension to notify the code in this or any other extension about some events.

You can find more information using the links at the bottom of this page.

Getting Started

All you need to do to have modular and extendable web application is:

  • add ExtCore.WebApplication as dependency to your main web application project;
  • call AddExtCore and UseExtCore inside your web application's Startup class;
  • implement the ExtCore.Infrastructure.IConfigureServicesAction and IConfigureAction interfaces in your extensions in order to execute some code inside the ConfigureServices and Configure methods of the web application's Startup class (optional);
  • tell main web application about the extensions (with implicit dependencies or by copying them into the extensions folder).

Samples

Please take a look at our samples on GitHub:

You can also download our ready to use full-featured sample. It contains everything you need to run ExtCore-based web application from Visual Studio 2022, including SQLite database with the test data.

Tutorials

We have written several tutorials to help you start developing your ExtCore-based web applications.

Real Projects

Please take a look at Platformus on GitHub. It is CMS built on ExtCore framework with 3 extensions and 25 projects.

Development and Debug

To be able to debug an ExtCore extension you need to add the explicit project references to all of its projects to the main web application. When development process is complete, you may remove that references and use the extension as the DLL files.

Links

Website: http://extcore.net/

Docs: http://docs.extcore.net/

Author: http://sikorsky.pro/

extcore's People

Contributors

artemb89 avatar bdparrish avatar dmitrysikorsky avatar gitter-badger avatar gorbach avatar iyilm4z avatar kanekt avatar xarkam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

extcore's Issues

ExtCore.Events extension

This extension will allow extensions to raise the events to notify the subscribers about some events.

Add Priority property to the IEventHandler interface

Often we need to execute event handlers with the specific order. So we need to add that property to be able to set the priority or order of the event handlers, so ExtCore.Events extension will be able to sort them before executing.

Option to temporary disabling Extension Loading in config.json

Hi, I was playing around with your nice project, and I thought what if you wanna "disable" or "ignore" loading extensions even if they are referenced or inside your extensions folder ?

What if you wanna to disable a extension without "uninstalling" it, just modifying your config.json.

This will be usefull if you want to disable that extension for a while, for maintenance, or something without deleting the reference or the file inside the extension folder.

I have a pull request with my aproximation ... but is my idea useful ?

Thanks and good work guys !

Sample not running

Hi,

I cannot run the application, I get the following error: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework.

Do you have any tipps?

Question: Is it possible to add some default Controllers to the framework?

We would like to add some default Controllers to a project that uses this so we can enforce standard views/services across all Mvc apps that use this...is this possible and how would we go about doing this? e.g. Create a project that uses this framework, add Controllers for standard REST services and Views for standard items to it, and create a NuGet package out of that so others can use it so that all applications will have those standard Views/Controllers.

Make it possible to set priorities for actions in extensions ConfigureServices and Configure

Sometimes it is important to execute some code in special order in such methods like ConfigureServices or Configure. Now it is not possible, these methods will be called one by one in the order assemblies has been resolved. I think we should change this the same way like we have with routes now:

IDictionary<int, Action> RouteRegistrarsByPriorities { get; }

Key is priority and value is action.

Embeded view are regonised however styles not!

Views embedded in extension are recognized however Styles are not. I disassembled extension assembly and styles are present there in assembly as embedded resource along with view. When I am trying to refer embedded style in extension's view using dot (.) notation i.e. Styles.default.css instead of Styles/default.css view is rendered without styles. What could I have done wrong?

ExtCore and ASP.Net core MVC with default template

Hello,
I am very interested by ExtCore. I understand it is in develop and that the documentation is not complete. But I tried the built in an existing project ASP.net MVC Core 1.0.0, I'm no expert in ASP.net Core, I can not properly configure the Startup because in the documentation, "IHostingEnvironment env" is not present. My explanations may not be clear, but if you have a solution I'm interested, starting from the default MVC template.

I apologize for my bad English.
Thank you for your answers,
Best regards

Decouple ExtCore and MVC

We need to be able to build non-MVC applications based on ExtCore, so we need to decouple ExtCore and MVC. MVC should be moved to the separate extension.

Extension To Register New Service?

Say I have an extension which has it's own service

ISomethingService ... SomethingService

And I want to use it in my extensions controllers via DI... Can I register it within the Plugin itself? like

services.AddTransient<ISomethingService, SomethingService>();

Also what about other services which are registered with the IOC at startup in the web project? Will I have access to those services in my plugin controllers?

Add logging

We need to have good logs, to write there info about loaded extensions and assemblies, errors etc. But we shouldn't add any concrete logger, just try using one from the DI if it is provided.

Make it possible to use Identity with ExtCore.Data

Now StorageContext is inherited from EntityFrameworkCore's DbContext, and it is not possible to change that without need to rewrite the full ExtCore.Data.EntityFramework.Implementation project. We need to think about how to make it possible to use Identity without rewriting the whole project.

Implement transactions support

The IStorage interface should contain methods for working with transactions. Now it is not possible to manage them in normal way.

Development Work Flow

Hi,

How is the development work flow when using extcore, do we need to run gulp task to copy the extension dll to main extension everytime we build the extension project and how to debug the extension since extension does not run on its own.

I'm using visual studio code.

Thanks.

Extension with controller having dependency injected through constructor

I have following scenario:

  1. Container MVC application where multiple extensions are plugged in.
  2. Various modules are being developed as extensions and plugged into container application mentioned in step 1.
  3. Extensions are created with "ASP.Net Core Web Application" template. (Not library but application). Idea here is I should be able to run extension as independent application. Whenever I need to plugin this extension into container I compile it with "emitEntryPoint=false" option.
  4. Above setup works fine (except one scenario mentioned in pt. 5 below) and I am able to run extension as independent application as well as plugin it in container and that works too.
  5. Now Extension is having some controllers with dependency injected through controller's constructor. Dependencies are registered in Startup.cs of Extension. If I build extension and drop it in "Extensions" folder of container application it fails to create instance of such controller with following error.
    Unable to resolve service for type 'ILeadDashboardService' while attempting to activate 'Lead.Controllers.HomeController'
    I understand this error is because its not able to find dependency registrations which are registered using Extension's Startup.cs. When I manually add missing registrations in Container's Startup.cs it works fine. However its not good solution as everytime I need to add new plugin I will have to add extension's dependencies in container's startup.cs.
    Any pointer how I can solve this problem without adding dependency registrations in Container's startup.cs?

The view 'Index' was not found

I noticed that when I set the output path of an assembly, the views no longer load.

Steps to reproduce:

  1. Download the ready to use sample at http://extcore.net/files/ExtCore-Sample-1.0.0-alpha16.zip
  2. Change line 3 in ExtCore-Sample\src\WebApplication.ExtensionA\project.json from
    "buildOptions": { "embed": [ "Styles/**", "Views/**" ],
    To:
    "buildOptions": { "embed": [ "Styles/**", "Views/**" ], "outputName": "Something.ExtensionA"},
  3. Remove WebApplication.ExtensionA.dll from the Extensions folder of WebApplication
  4. Move Something.ExtensionA.dll from the output folder of the WebApplication.ExtensionA project into the Extensions folder in WebApplication

You should receive an error like this:
InvalidOperationException: The view 'Index' was not found. The following locations were searched:
/Views/ExtensionA/Index.cshtml
/Views/Shared/Index.cshtml

StartUp.Configure Not Suitable method to override

 public override void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {} 

I was forced to change to:

   public override void Configure(IApplicationBuilder app)
        {} 

Meaning that startup does not provide a constructor accept IHostingEnviroment and IloggerFactory.

So what if we add to: https://github.com/ExtCore/ExtCore/edit/master/src/ExtCore.WebApplication/Startup.cs


  public virtual void Configure(IApplicationBuilder applicationBuilder, IHostingEnvironment env, ILoggerFactory loggerFactory)
    {
            loggerFactory.AddConsole();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
      foreach (Action<IApplicationBuilder> prioritizedConfigureAction in this.GetPrioritizedConfigureActions())
      {
        this.logger.LogInformation("Executing prioritized Configure action '{0}' of {1}", this.GetActionMethodInfo(prioritizedConfigureAction));
        prioritizedConfigureAction(applicationBuilder);
      }
    }

Support VS 2017

ExtCore does not work with the newest .NET Core templates in VS 2017.

I noticed you have todo: add error logging

So I noticed you have exception handlers todo: implement error logging. What technology are you thinking to implement for error logging? ELM, Nlog? Let me know, and I can start something of that nature as a pull.

Partial view on two extensions

Hello,
I would like to know if there was a way to load via Html.PartialAsync a page of extension 2 to extension 1 ?
I think this may be complicated, or impossible, but I came to have confirmation.

I apologize for my bad English.
Thank you for your answers,
Best regards.

roadmap and help needed

HI, I like what you guys started here. Do you have a roadmap or list of things you need help with?

Need explanation

I'm not quite sure what this framework does. So here is my question:

?- Using this framework am I able to make an ASP.NET Core web app that supports plugins (modules)? (Modules that are written by me or third party to extend or change the functionality of the application)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.