Using the Blockly visual programming editor to call a .NET Core WebAPI
I like to showcase interesting and cool open source projects that need more attention! Go give our friend a star on GitHub! NetCoreBlockly on GitHub is clever and fun!
Blockly is a JavaScript library for building visual programming editors. If you've used languages like Scratch you've seen block-style programming environments. The picture below shows you a demo of calling a .NET Core WebAPI using Blockly code!
Remember that once you have a WebAPI you can make it available in a number of ways. The "projection" of the methods that the WebAPI makes available can be presented visually, as Swagger/OData/GraphQL, however you like. Another project is WebAPI2CLI that lets you call WebAPI endpoints easily from a CLI (Command Line Interface) that is more high fidelity than curl or wget.
What .NET Core Blockly is doing is looking at the projection/interface of your WebAPI and generating Blockly blocks! That means that anyone (business users, student, tester, whatever) could try out your WebAPI with a simple drag and drop interface in their browser!
You can pull in Swagger, OData, or GraphQL interfaces.
- 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
I love seeing fun projects like this that make the web (and .NET code) easier to use! Go give them some stars and get involved!
Sponsor: Upgrade from file systems and SQLite to Actian Zen Edge Data Management. Higher Performance, Scalable, Secure, Embeddable in most any programming language, OS, on 64-bit ARM/Intel Platform.
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
It will work with any Swagger or OData or GraphQL ( this is work in progress, though) - if you pin to the right url.
You can test it at https://netcoreblockly.herokuapp.com/ - see Swaggers and OData categories from blocks .
The code is :
app.UseBlocklySwagger("petstore", "https://petstore.swagger.io/v2/swagger.json");
app.UseBlocklyOData("OdataV4", "https://services.odata.org/TripPinRESTierService/");
I ask when the developer team brings such a tool up for consideration:
"How much does it cost?"
"How much time will it save us for this release?"
"Has it been updated with meaningful changes and not just a look and feel reskin in the last year?"
"How many developers work on it?"
"How many commits have been made to its code base in the last 6 months?"
"Is there commercial support available?"
"What is the time needed for a new developer/QA tech to learn the product and write one test case?"
"Will it add custom build steps to our pipeline?"
"Will it send its output to our build pipeline?"
"Does it require any other software to be installed which we do not already have installed?"
"Can I hire developers with experience in the tool?"
"Does it require yet another language to be learned?" Custom scripting language, language to do queries when SQL would work better.
"To use it, do I have to create many extensible custom code modules?"
These are all TCO from a software business perspective and intrinsic to having well run computer systems.
Software systems are like cars, you do not just add modifications to them or install parts built by one guy in his garage bought off ebay. This should be self-evident for such complex systems as software solutions.
Our company has multiple development teams; each team picks its on set of pet tools and over time we have 50+ different development tools being used. One or more of those tools is end of lifed, no longer supported, obsolete due to Visual Studio upgrade at all times
We do not have time nor budget to fire fight the continual battle against each team using tools which will become broken maintenance problems in 2 years.
Inherit a few existing large systems code base before responding.
Comments are closed.
Would it only work with .NET core API's or with any OData or Swagger documented WebAPI interfaces?