Blazor

Blazor is Microsoft's front-end web framework for web applications that can be run either from a web server or directly in the browser. With Blazor, you can create applications for both desktop and mobile without having to distribute them through an App Store. Best of all, the functionality can be coded in C#.

What is Blazor?

A traditional website is built using HTML for content, CSS for styling and layout, and JavaScript for functionality. With Blazor from Microsoft, you can instead create functionality in C#. This means that you have the opportunity to make your code object-oriented, structured and type-strong. These are things I value very highly in the code I write.

Blazor Server Application

Blazor applications can be created either as a Server application or as a WebAssembly (WASM). In a Server application, all the code (e.g. C#) is executed on the web server and the resulting web page is transferred to the user's browser via a SignalR connection. Don't worry though, it's all neatly packaged and works well and efficiently without you having to do much yourself. When the code is executed on the server, there are a lot of security issues that are not as much of a challenge as if it was JavaScript. This is because the user/browser does not have access to the code on the server at all.

Blazor WebAssembley

Unlike a server application, the code in WebAssembley runs in the web browser. Web browsers contain a virtual machine that can run .NET code (C# under WASM). It can be a little heavier to start up the first time because there is a lot of code to transfer before the application can start up. On the other hand, the application can subsequently be run without a connection to a web server etc. This means that in practice you can distribute applications, e.g. to a mobile phone, without having to go through an app store.

Components that can be reused

In Blazor, you can create components (large or small parts of a user interface) that can be reused in multiple places, either in the same project or a completely different project. Over time, you can build up a library of the functionalities you use over and over again, saving development time.

The components are made like Razor components. A Razor component is a variant of a Razor Page, which in turn comes from Microsoft ASP.NET Core.

Another option is to use 3rd party component libraries. I've really enjoyed using the component library from Syncfusion. It's a very comprehensive library of beautiful UI components, it's well thought out and well implemented. Syncfusion can be used with a community license, which costs nothing as long as your annual revenue is under $1 million. It's ok to start with.

Projects

I have used Blazor to create the Online Booking product. I also used Syncfusion's component library in this project. This has meant that I have an application that can both run in a browser on a large screen and at the same time can be viewed on a mobile phone or tablet. The user interface automatically adapts to the screen size used, the solution can also be included in an existing website.

Online Booking