Build a Full-Stack .NET Multi-Tenant CRM Web App From Scratch Step by Step - From Zero to SaaS Software as a Service
Learn how to build a full-stack .NET web application from scratch in this step-by-step tutorial series! 🎯 We’ll cover everything from project setup to building a multi-tenant CRM, using C#, ASP.NET…
- 526 likes on YouTube
- 147.2K views
Created by WeCodersNL on YouTube
What you'll learn
- Software Architecture • Multi-layer solution structure
- ASP.NET Core • Identity setup and dependency injection
- Blazor • MudBlazor setup
- ASP.NET Core • Email configuration and sending
- ASP.NET Core • Sending email with Gmail SMTP
- ASP.NET Core • JWT token generation and validation
- C# / .NET • Entity Framework Core migrations
- C# • Centralized logging with Serilog
Explore related topics
Course content
01Build a Full-Stack .NET Multi-Tenant CRM Web App From Scratch – Episode 1: Project Setup & StructurePreview40:56
This chapter opens a series on building a full-stack, multi-tenant CRM web app with .NET 9. The presenter explains the goals of the series, which include clean solution structure, API design with JWT and authentication, Unit of Work and Repository patterns, Blazor, unit testing, microservices, a .NET MAUI mobile app, and Azure deployment with GitHub Actions. The episode starts with version control: a local Git repository is created, and a new branch is made for each episode so learners can follow along.
- Software Architecture • Multi-layer solution structure
- ASP.NET Core • Web API setup and Swagger
- Entity Framework Core • Migrations and code-first database
- ASP.NET Core • Identity setup
- Blazor • Calling an API with HttpClient
- Git • Branching per episode and committing changes
02Secure Your CRM! Episode 2: ASP.NET Core Identity & Authentication | .NET Multi-Tenant CRM series!Preview36:20
This chapter of the multi-tenant CRM series sets up user authentication with ASP.NET Core Identity. The presenter starts a new Git branch, then creates an AuthenticationController in the Identity area of the API project, using GitHub Copilot to generate much of the boilerplate. A new IAuthenticationService interface and AuthenticationService class are built in the service layer. The code is organized into three model types: database models (IdentityModels) for migrations, ViewModels for data sent to clients, and InputModels for incoming data with validation attributes. Response types are temporarily simplified to bool, and the Register and Login methods are made async. Errors are handled by returning a generic 500 response, so detailed information is not leaked to clients.
- ASP.NET Core • Identity setup and dependency injection
- ASP.NET Core • UserManager and SignInManager
- Software design • Input, view, and database model separation
- Security • Error handling and hiding details from clients
- Security • Email confirmation before login
- Tooling • Copilot, Visual Studio refactoring, and Azure Data Studio
03Enhance your Frontend CRM for a Better User Experience - Episode 3 | .NET Multi-Tenant CRM seriesPreview46:05
This episode of the .NET Multi-Tenant CRM series improves the frontend of a Blazor Web App. The presenter installs MudBlazor, a Material Design component library for Blazor, following the manual NuGet route. Setup includes adding the package to imports.razor, adding its CSS and JavaScript to App.razor, enabling InteractiveServer render mode in the app and in Program.cs, and choosing a Functional layout in MainLayout.razor. Both the Blazor front end and the API project must run together, so both are set to start automatically.
- Blazor • MudBlazor setup
- Blazor • Dark and light mode with local storage
- Blazor • Localization and culture switching
- Blazor • JavaScript interop
- Blazor • Custom validation attributes
- Blazor • Login and Register pages
04Implement Password Reset & Email Verification in Your CRM - Episode 4 | .NET Multi-Tenant CRMPreview1:14:55
This chapter of the multi-tenant CRM course builds the account-management side of the app: email confirmation, password reset, and a cleaner Blazor structure. It starts by updating NuGet packages, including ASP.NET Core Identity, which had a security warning. The email settings (sender name, address, SMTP server, port, username, and password) are stored in appsettings.json, while the sensitive values go in User Secrets. A reusable EmailConfiguration model sits in the Utility project, and an EmailSender class sends HTML emails built from a template file with placeholders for values such as the full name and verification code.
- ASP.NET Core • Email configuration and sending
- ASP.NET Core • Email confirmation with verification codes
- ASP.NET Core Identity • Forgot password and reset password
- Blazor • Components, parameters, and imports
- Blazor • Internal services and separation of logic
- Software design • Shared base models and refactoring
05Send Emails in .NET Core Using Gmail SMTP | Easy Setup with App Passwords (2025) | Follow-Up to Ep 4Preview04:06
This chapter is a follow-up to Episode 4 of a full-stack .NET CRM series. Episode 4 added email confirmation and password reset, but the emails were only mentioned briefly there. This tutorial shows how to send those emails from an ASP.NET Core app using Gmail's free SMTP server.
- ASP.NET Core • Sending email with Gmail SMTP
- Google Account • App Passwords and Two-Factor Authentication
- ASP.NET Core • User Secrets for storing credentials
- ASP.NET Core • SMTP settings in appsettings.json
- ASP.NET Core • Testing password reset emails
06.NET API Security: JWT Token Auth, User Profile & Password Change (EP5) | .NET Multi-Tenant CRMPreview54:33
This chapter (Episode 5 of a .NET multi-tenant CRM build) adds JWT token-based authentication so the Blazor Web App can securely call the API. The login flow starts in the Blazor login page, goes through the internal AuthenticationService to the API's AuthenticationController, then to the Service Layer, where the Utility project's GenerateJwtToken method creates the token. The token is returned with the user profile, saved to local storage, and later sent as a Bearer token in the Authorization header on each secured request.
- ASP.NET Core • JWT token generation and validation
- ASP.NET Core • Claims and the User object in controllers
- Blazor • Local storage and Authorization headers
- ASP.NET Core • Configuration binding with IOptions and TokenConfiguration
- Blazor • User profile page and file uploads
- Software design • Generic error handling service
07.NET Authentication: Implementing Refresh Token & Enhanced User Profile, JWT Token Auth (EP6)Preview56:48
This chapter extends the authentication setup of a multi-tenant CRM built in .NET. Access tokens expire, so the chapter adds refresh tokens so users can stay logged in without signing in again. The work starts in the User model, where new fields are added: RefreshToken (a nullable string up to 128 characters), RefreshTokenExpiryTime, RefreshTokenAttemptCount (a limit on bad or expired refresh attempts), and RowVersion (an Entity Framework concurrency token that makes conflicting updates throw DbUpdateConcurrencyException). The presenter explains that the API project must be the startup project and that the Default Project in Package Manager Console must be DataAccess, because that is where the DbContext and migrations live. A migration named "Add Refresh Token" is created, reviewed, and applied to the database.
- C# / .NET • Entity Framework Core migrations
- C# / .NET • Concurrency tokens with RowVersion
- C# / .NET • Refresh token design
- C# / .NET • Manual mapping to view models
- C# / .NET • Authentication endpoints and error handling
08.NET 9 Centralized Logging & Error Handling: Serilog to SQL (API & Blazor) + AI Unit TestingPreview53:19
This chapter sets up centralized logging for a layered .NET 9 CRM application using Serilog with SQL Server as the main sink. Serilog writes structured logs (key-value data) to a database table called Logger, which is created automatically on first run. Settings live in appsettings.json: the minimum level is Information, the Microsoft and System namespaces are limited to Warning, and logs are batched (50 entries or 15 seconds) to reduce database writes. A custom middleware placed before authorization in the API pipeline adds user email, IP, request path, status code and elapsed time to each request's log context. Unhandled exceptions bubble up to a central exception handler, so try-catch blocks are only needed when the code can actually act on the error. Blazor front-end logs are sent over HTTP to a logging endpoint in the API, which keeps the database hidden from clients. The Blazor side uses a durable HTTP sink with local buffer files, a console sink, a custom log enricher for the user email, and a fatal-error handler in Program.cs that calls Log.CloseAndFlush. The chapter also moves navigation out of the HTTP client service and into an error handling service, so the service layer stays easy to test.
- C# • Centralized logging with Serilog
- C# • Middleware and exception handling in ASP.NET Core
- Blazor • Client logging and error handling
- SQL Server • Logging to a database with Serilog
- C# • Unit testing with XUnit
- GitHub Copilot • Generating and fixing tests
Description
Learn how to build a full-stack .NET web application from scratch in this step-by-step tutorial series! 🎯 We’ll cover everything from project setup to building a multi-tenant CRM, using C#, ASP.NET Core, Blazor, SQL Server, and more. 👨💻 What you'll learn: ✅ Setting up a scalable project structure ✅ API development with ASP.NET Core ✅ Database handling with Entity Framework ✅ Authentication & Authorization with Identity ✅ Frontend development with Blazor ✅ Best practices for building enterprise-level applications By the end of this series, you’ll have a fully functional real-world web application that you can use as a foundation for your own projects! 🔥 New episodes released regularly! Don’t forget to subscribe & follow along! #dotnet #blazor #csharp #webdevelopment #aspnetcore #saas #multi-tenant #crm #api
About the creator
- YouTube channel
- 1.1K subscribers
- 1 course on Studyio
The videos in this course are made by WeCodersNL and play from YouTube, credited to them. Studyio adds the chapters, notes, quizzes and a certificate around them.





