Blazor Project structure / best practices

So I was diving into looking for more example projects and I came across a SPA Server Side Dapper application (https://www.c-sharpcorner.com/article/create-a-blazor-server-spa-with-dapper/). From what I can gather there, here, and everywhere else I look, adding a separate project for handling just CRUD operations seems to be more trouble than it's worth.

I will implement something along the lines of what is in that link and see how it goes. If anyone else is looking for some inspiration, there's some good examples here:

https://github.com/AdrienTorris/awesome-blazor#sample-projects

FWIW, every example seems to follow this path, just seems to go about it in slightly different ways (ORM use, folder names, etc.). This means I will need to add a lot more services (at least 20 in total), but if it's a complicated business application I just suppose that's the nature of the beast.

Happy coding!


While working with three tier architecture, I see business layer will grow and some point of time become very messy and tightly couple.

I would recommend try Onion Architecture, its very popular and very similar to Clean Architecture.

I am sure you are looking some sample application to see how to keep each and every layer separate, what is best practices and best libraries.

Try below link, you will get lots of video on youtube.

Asp.net boilerplate

ABP Framework

Since Blazor Web Assembly still in preview, I start my personal website migration from asp.netcore 2.0 to blazor client side and Azure function for server side.

Here is my application structure

enter image description here

I hope it will help!


I just created a new ASP .NET Core 3.1 project with 3 web apps: MVC, Razor Pages and Blazor.

NetLearner: https://github.com/shahedc/NetLearnerApp

I’m developing all 3 in parallel so that you can see similar functionality in all of them. I’ve extracted common items into a Shared Library for easy sharing.

The shared library includes:

  • Core items (Models and Services)
  • Infrastructure items (Db context and Migrations)

Here’s the corresponding blog writeup, which will be followed by an A-Z weekly series, which will explore 26 different topics in the next 6 months.

  • blog post: https://wakeupandcode.com/netlearner-on-asp-net-core-3-1/

Hope the current version is useful for what you’re asking for. Stay tuned and feel free to make suggestions or provide feedback on the project structure.

NetLearner architecture