Blazorboilerplate
Blazor Boilerplate / Starter Template with MudBlazor
Install / Use
/learn @enkodellc/BlazorboilerplateREADME
<img src="https://github.com/enkodellc/blazorboilerplate/blob/master/docs/images/logo-title.png" alt="Blazor Boilerplate" style="max-wdith:100%"/>
*Note The current master branch is now fixed and working with net7.0
Blazor is a web framework designed to run in the browser on a WebAssembly-based .NET runtime. Blazor Boilerplate aka Blazor Starter Template is a SPA admin template that is able to run both WebAssembly (Core-Hosted) and Server-Side Blazor with a .NET Core 6.0 Server. Default mode for BB is Server Side. To switch to Webassembly log in as Admin and go to settings. Read more here
Repository Notes
- Yes, I did not update this repository for a couple of years. During this time I was the CTO of a mid-size software company. We used BB as the base of our application. It was fairly successful. It was a SAAS app with about 1,200 daily users.
- Read the news below to stay up to date on the repo. We will try to keep the latest major changes on a different branch and have the more stable / tested version on the master branch.
- There are several people who use this as a base for a production app. If you do so please donate. Gio and Enkode have thousands of hours of coding and support into BB. Show your support by contributing or donating.
- The main roadblock after the project is running is learning Breeze for Entity Framework. We have some examples and will put out a few more. IAmTimeCorey has a great video for new users of EF.
Goals
- This repository is community driven. It is not and never will be controlled by a corporation. It's success is dependent on people using it, reviewing it, offering suggestions and most importantly contributing. Please join the gitter discussion
- To create a boilerplate with Blazor / Razor components that includes the most common functionality to start a real world application quickly.
- Avoid many external components & libraries which can make it difficult to maintain, update, track down code, learn code and issues.
- Minimal Javascript. Currently only using js for MudBlazor / Material Design. We may use components with JS in them but so far no Javascript has been written specifically for anything in the repository.
Live demo
- Blazor Boilerplate - CSB/WASM - Kick the tires. *Note Firewall does block some foreign IP addresses. Swagger UI to view the server API https://blazorboilerplate.com/swagger/index.html.
Prerequisites
Don't know what Blazor is? Read here
Complete all Blazor dependencies.
- The latest .Net 7.0 SDK
- Install the Visual Studio 2022 + with the ASP.NET and web development workload selected.
- Entity Framework Core on the command-line tools: dotnet tool install --global dotnet-ef
How to run
- Install the Visual Studio 2022 (v17.0.1 at minimum)
- Clone or download.
- Review / Update appsettings.json - DefaultConnection.
- Open the solution in Visual Studio and press F5.
- To view the API using Swagger UI, Run the solution and go to: http://localhost:53414/swagger/index.html. Live example: https://blazorboilerplate.com/swagger/index.html
Publish on IIS - What works for me on my Windows Server 2016 & SQL Server 2014 (Enkodellc)
-
Publish BlazorBoilerplate.Server project to your IIS website folder.
-
Install your SSL. Make sure your SSL is in the WebHosting Certificate Store, and in Linux My Certificate Store.
- A free certificate from Let's Encrypt will work.
- For steps 2 & 3 the utility win-acme installs the certificate on your server, performs renewal and configure your IIS Website Bindings to have https binding with the SSL certificate set and Port 443 for default.
-
Configure your IIS Website Bindings to have https binding with the SSL certificate set and Port 443 for default. Enable WebSockets for SignalR.
-
Configure / create appsettings.production.config. Set Connection String. If you are using Sql Server then make sure your connection string contains MultipleActiveResultSets=true, Set Thumbprint / SSL. Thumbprint example: 143fbd7bc36e78b1bcf9a53c13336eaebe33353a
-
Login with either the user [user | user123] or admin [admin | admin123] default accounts.
Thanks To
Contributing
Please star, watch and fork! We'd greatly appreciate any contribution you make. I am very open to updates and features, though most feature requests will be depending on how much community support exists.
Disclaimer / About the Author
I (Enkodellc) started this repository as I was frustrated with the examples out there that people were charging money for and were in my opinion incomplete or closed source. I paid for 4-5 of these solutions with an Angular front-end / .Net Core back-end and none of them were what I was looking for. This is my attempt to create something that developers can start a Blazor project with several great features to build from. I have a lot of experience with ASP.Net webforms an new to .NET Core and Blazor. This code is not meant to be perfect or follow every best practice. It though is my ambition to learn and get feedback on what best practices can be implemented. I will be migrating a Webforms app to Blazor so this is my opportunity to learn, share, grow, and get feedback on what hopefully will be a great Blazor Starter Kit.
I have taken small solutions from other repositories and will do my best to recognize those contributions. I am very open to ideas and suggestions. I am not a great developer, but I try. So please take this into consideration when using this repository. If you wish to hire me for consulting or as a contractor please reach out via email or https://gitter.im/enkodellc. I have taken well over 1,000 hours to create, maintain, and answer questions. Please donate to support my efforts.
Completed
- Basic Login / User Creation
- Admin Theme using Material Design / MudBlazor - 12/1/2021 Switched from MatBlazor
- Swagger UI API visualizer - View the live API
- Log Files using Serilog
- Choose between SQL Lite File or MS SQL Database or Postgres
- Email Confirmation of Registered Users
- Forgot Password Functionality
- ISoftDelete Interface for Models - Allows for "trash / restore" of data IsDeleted property
- IAuditable Interface for Models - Allows for CreatedOn, CreatedBy, ModifiedOn, ModifiedBy properties
- Api Audit Trail / Middleware to log Api Requests and Responses
- Api Response Class to maintain consistent Api Requests and Responses
- Todo List CRUD Example with N-Tier Layers Not just some fluff that most others do
- Seed Database & Database Migrations
- Forum chat and notification system - Thanks <a href="https://github.com/ajgoldenwings" target="_blank">ajgoldenwings</a>
- Drag and Drop Examples - <a href="https://chrissainty.com/investigating-drag-and-drop-with-blazor/" target="_blank">Chris Sainty Blazor Blog</a>
- Docker Container Support
- Dual Mode (CSB / SSB) - Client Side / Webassembly & Sever Side. Thanks MarkStega
- Error Log to Database with Serilog & SQL. Thanks np-at
Road map
License
This project is licensed under the terms of the MIT license.
Problem Solving Tips
- If you get compile errors after updating your EF Models, delete the obj and bin folders from your project and then rebuild.
- If you are having issues with authentication or any other strange behavior try using Incognito mode / different browser.
- Make sure you have all pre-requisites installed.
- Keep It Simple Stupid: If you are running into issues with SQL / connection string. First CHECK both appsettings.json (appsettings.production.json for production) and (appsettings.development.json for development).
- If still failing get on Gitter BlazorBoilerplate for Blazor Boilerplate or Gitter aspnet/Blazor
Related Skills
diffs
334.1kUse the diffs tool to produce real, shareable diffs (viewer URL, file artifact, or both) instead of manual edit summaries.
openpencil
1.5kThe world's first open-source AI-native vector design tool and the first to feature concurrent Agent Teams. Design-as-Code. Turn prompts into UI directly on the live canvas. A modern alternative to Pencil.
ui-ux-pro-max-skill
49.6kAn AI SKILL that provide design intelligence for building professional UI/UX multiple platforms
ui-ux-pro-max-skill
49.6kAn AI SKILL that provide design intelligence for building professional UI/UX multiple platforms

