Monday, May 29, 2023

Blazor I : Blazor Server Getting Started

Blazor is a free and open-source web framework that enables developers to create web apps using C# and HTML developed by Microsoft. Previously creating such apps required the knowledge of JavaScript Libraries/Frameworks like Angular, React, VueJS, JQuery, etc. Now it is possible for .Net developers to use their familiar tools and language (C#) to create compelling UIs. Blazor has different variants like Blazor Server, Blazor Web Assembly, Blazor United aka Full Stack Blazor (.Net 8), etc. In this article we will be concentrating on Blazor Server.

Blazor Server
Blazor Server is a Server Side technology for creating highly responsive Single Page Application (SPA). It uses SignalR web sockets to push the UI udates to browser. A persistent connection between Web Server and Client Browser is required for Blazor Server to work. So it is not possible to create Progressive Web Apps (PWA) with Blazor Server. Since Blazor is a Server Side technology it can access all the server resources including database access. No need of an exta Web API layer. Blazor Server works even on old Browsers.
Prerequisites
.Net (Core) 3 or later is required for building Blazor. Visual Studio is recommended by not mandatory. .Net CLI in combination with any editor can be used for creating Blazor Application which we will see later. .Net Core is platform independent so you can develop Blazor application in any platform you like. I am starting out with Visual Studio Community which is a freeware from Microsoft. I am selecting Blazor Server App as the project template.
L6g47FyqpZpu1hQbMYyZu7oWqKmuuifh_TbAeTzfrsOt5DtYY3pItgKrm5DiDCyvQGQLS7jc4Ie5Yq1dA1xEGxbp98b3MBhHs5jRgL4-ZFnBzyblpjyerLPAhnu72g/s480/Blazor%20New%20Project.png" style="display: block; padding: 1em 0; text-align: center; ">