Clean Architecture Solution Template for Blazor WebAssembly

This week I released a new solution template to support creating Blazor WebAssembly applications hosted on ASP.NET Core and following the principles of Clean Architecture. With this new template, my primary goal was to be able to go from a new project to production in 45 minutes. To this end, the template includes workflows built using GitHub Actions to support CI/CD, Bicep templates to support rapid deployment to Azure, and documentation so that you can get it working in your environment.

In this post, I’ll show you how to install the new template, create and run a new app using the template, and then I’ll share some recommended resources. Let’s get started!

Getting started

You will need to install the .NET 6.0 SDK and the new template before you can create a project. Once .NET 6 is installed, open a new console window and run the following command to install the template:

dotnet new --install JasonTaylorDev.CleanArchitectureBlazor

After the template has been installed successfully, you can create a new project using the following command:

dotnet new ca-blazorwasm-sln --output AwesomeBlazor

The new project will be created inside an AwesomeBlazor folder. Run the console app with the following commands:

cd AwesomeBlazor/src/WebUI/Server
dotnet run

Please note that the template is currently configured to use SQL Server Express LocalDB for development and Azure SQL once deployed. I understand this will be difficult for some developers and will look at other options in the near future.

Deployment

The project can easily be deployed to Azure using the included GitHub Actions workflows and Bicep templates. Review the Deployment instructions to learn how.

Issues

Please consider this version of the template an early preview. I have a backlog of items to work through in the coming week, so expect many changes to the template. If you are having problems or would like to suggest an improvement, please let me know by creating an issue.

Next steps

In this post, I showed you how to install the new template, create and run a new app using the template. I hope you find the template useful! If you do, please give it a star on GitHub. To learn more, review the following resources:

Please note that this is only an early version of the template. You can expect a lot of exciting changes in the coming months! Do you have any suggestions on how to improve this template? I’d love to hear from you!

Thanks for reading, please feel free to post any questions or comments below.