BigHam / NETCoreBlockly

.NET Core API to Blockly - generate from WebAPI, Swagger, OData, GraphQL =>

Home Page:https://netcoreblockly.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NETCore2Blockly

All Contributors

Build Status GitHub license NuGet Generate Thanks Outdated Licenses

What it does

NETCore2Blockly generates Blockly blocks for each of your controller actions.

Demo at https://netcoreblockly.herokuapp.com/ ( play with the links from the bottom)

Demo Video at https://www.youtube.com/watch?v=GptkNWjmCzk

Sample Project is TestBlocklyHtml from this repository

Contributors welcome! - please send email to email or see issues tab.

How to install NETCore2Blockly in a .NET Core 3.1 WebAPI / MVC application in 3 steps + run application

Step 1:

Install https://www.nuget.org/packages/NetCore2Blockly/ by running the following command in the Package Manager Console:

Install-Package NetCore2Blockly

Step 2:

Modify Startup.cs by adding

public void ConfigureServices(IServiceCollection services)
        {
            //last line
            services.AddBlockly();
        }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env){
        //if you plan to use as html, do not forget app.UseStaticFiles
        //last line
        app.UseBlockly(); 
}

Step 3:

To see the UI , please add

public void Configure(IApplicationBuilder app, IWebHostEnvironment env){
       
       app.UseBlocklyUI(); // you can customize (with BlocklyUIOptions argument )header name, start blocks, others... 
       //you can add  storage like local storage or sqlite 
       //app.UseBlocklyLocalStorage();
       //app.UseBlocklySqliteStorage() ; // other nuget package
       app.UseBlockly();
}

Run application

Run the application from VS and browse to /blockly.html

That's all !( 3 steps + run )

Advanced usage remote data

For Remote Swagger ( CORS activated )

app.UseBlocklySwagger("petstore", "https://petstore.swagger.io/v2/swagger.json")

You can see demo at https://netcoreblockly.herokuapp.com/ ,colapse category local function, expand category Swagger.

See link 25 from https://netcoreblockly.herokuapp.com/

For ODATA ( local or remote - CORS activated if remote)

app.UseBlocklyOData("OdataV4", "https://services.odata.org/TripPinRESTierService/");

You can see demo at https://netcoreblockly.herokuapp.com/ ,colapse category local function, expand category OData.

For GraphQL (local or remote - CORS activated if remote)- Work In progress

app.UseBlocklyGraphQL("localGraphql", "/graphql");

You can see demo at https://netcoreblockly.herokuapp.com/ ,colapse category local function, expand category GraphQL.

See link 32,33 from https://netcoreblockly.herokuapp.com/

For authentication - JSON Web Tokens

See links 22 for JWT and 31 for Auth0 from https://netcoreblockly.herokuapp.com/

Also, it works with Active Directory enabled - see Authentication category.

For adding headers to Http requests

See links 22 for JWT from https://netcoreblockly.herokuapp.com/

For exporting data as CSV

See link 2 from https://netcoreblockly.herokuapp.com/

For exporting data as image

See link 1 from https://netcoreblockly.herokuapp.com/

Making a simple CRUD ( create ,read, update , delete ) application

See link 6,7,8,9, from https://netcoreblockly.herokuapp.com/

Adding your blocks

Please see how I add CustomBlocksForUI below

app.UseBlocklyUI(new BlocklyUIOptions()
            {
                StartBlocks = StartBlocksForUI,
                HeaderName = "Demo test for .NET Core WebAPI To Blockly ( demo site with Blockly +  swaggers + odata loaded + graphql)",
                CustomBlocks = CustomBlocksForUI
            });

More information

Download the source code, run the TestBlocklyHtml project ( in the test folder ).

See there

region blockly needed

and

region blockly optional

and follow the code.

All other code is just boilerplate for Swagger, OData,GraphQL that are mandatory for demo'ing the application, not for Blockly2NetCore itself.

Testing

There is a integration testing at \IntegrationTesting that tests the UI. Generates images and verifies " program complete " textbox.

There are 42 tests that you can also click the demo at https://netcoreblockly.herokuapp.com/ ( see links on the bottom of the page)

Contributors ✨

Thanks goes to these wonderful people (emoji key):

If you want to contribute, that is plenty of work to be done -see issues tab .


Cosmin Popescu

πŸ’»

Adrian Nasui

πŸ“–

Tudor Iliescu

πŸ’»

robertszabobv

πŸ’»

Noah Andrews

πŸ’»

Rene Escalante

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

About

.NET Core API to Blockly - generate from WebAPI, Swagger, OData, GraphQL =>

https://netcoreblockly.herokuapp.com/

License:MIT License


Languages

Language:JavaScript 67.1%Language:C# 21.2%Language:HTML 11.1%Language:CSS 0.4%Language:PowerShell 0.2%Language:Dockerfile 0.1%