V4 · SaaS · Multi-Tenant · .NET 10 · Blazor Web App · VSA

Blazor CRM Multi-Tenant Source Code

SaaS CRM with Multi-Tenancy — Complete Source Code

A production-ready multi-tenant SaaS CRM application to serve multiple organizations from a single deployment. Built with .NET 10, ASP.NET Core, Blazor Web App (interactive server), MudBlazor and Vertical Slice Architecture — V4 adds workspace selection with a signed tenant cookie, multi-branch scoping per tenant, 68 modules across 9 areas and plain CQRS handlers wired to Minimal API endpoints.

$21 $49
Instant Download
Buy Now — $21 via Lemon Squeezy
cards
Powered by paypal
Live Demo
Blazor CRM Multi-Tenant Dashboard — SaaS CRM with Multi-Tenancy .NET 10 Blazor Web App
NEW · V4

What's New in V4

The V4 upgrade keeps every business module and adds multi-tenant workspaces with multi-branch operations on a completely rebuilt application architecture.

Multi-Tenant Workspaces

Sign in, pick a workspace at /TenantSelection, and every query is scoped to it. 60 entity classes carry TenantId; a signed 12-hour tenant cookie (or a JWT tenant_id claim for API clients) drives the guard pipeline.

Multi-Branch per Tenant

Each workspace gets its own branch list and a protected Head Office branch seeded during provisioning; branch scoping is tenant-scoped end to end.

Super Admin Area

7 platform modules — Tenant, Tenant User, System User, Health Check, Serilog, System File and Job Dashboard — exempt from tenant selection and reserved for the SuperAdmin role.

CQRS Without MediatR

Every operation is a plain handler class with a single HandleAsync(). Blazor pages resolve handlers through HandlerInvoker with a fresh DI scope per call, while Minimal API endpoints inject the same handler directly. No dispatcher, no pipeline magic.

Per-Feature Minimal API + Refresh-Token Auth

One Minimal API group per feature (/api/{entity}) with list, /export, /{id}/items and /{lookup}-lookup routes — JWT-protected and rate-limited. Access tokens rotate with SHA-256 hashed refresh tokens, Firebase SSO is optional, and Bearer clients select a workspace via POST /api/auth/select-tenant.

Three Database Providers + Ops Stack

InMemory (zero-config), SQL Server and PostgreSQL — switch with a single IsUsed toggle in appsettings.json. Hangfire, Serilog, health checks, OpenTelemetry (OTLP) and four rate-limiting policies round out the ops stack.

The Problem

Business Problems Solved by Blazor CRM Multi-Tenant

SaaS businesses need to serve multiple organizations from one deployment — but building secure tenant isolation, managing separate customer data, and scaling multi-tenant infrastructure is complex and expensive.

Serving Multiple Organizations from One Instance

Building separate CRM instances for each client is prohibitively expensive in infrastructure and maintenance. Blazor CRM Multi-Tenant allows multiple organizations to share one database and one deployment with complete data isolation via TenantId global query filters. Add new tenants in seconds without provisioning new servers.

Data Leakage Between Tenants

Without proper tenant isolation, customer data can leak between organizations — a catastrophic security and compliance failure. EF Core global query filters automatically scope every query to the current tenant. Tenant A's contacts, deals, and activities are completely invisible to Tenant B. Zero data leakage by design.

Scattered Customer Data Across Tenants

Each tenant needs their own contacts, companies, and deals — but managing this separation manually is error-prone. Blazor CRM Multi-Tenant centralizes all tenant data with automatic scoping. Every API call, every database query, every UI interaction is tenant-aware.

No Tenant-Aware Sales Pipeline

Each tenant needs their own sales pipeline and reporting — but building per-tenant analytics is complex. Blazor CRM Multi-Tenant provides fully tenant-aware dashboards with KPI cards, pipeline charts, and win/loss rates scoped to each organization.

Business Features

What's Included in Blazor CRM Multi-Tenant

Complete end-to-end business features with tenant isolation — 68 modules across 9 areas, and every module is a complete vertical slice with Blazor pages, a plain CQRS handler, a FluentValidation validator, a Minimal API endpoint and EF Core queries.

Profile

Personal Info, Password, Avatar, Session

Pipeline

CRM Dashboard, Campaign, Budget, Expense, Lead, Lead Contacts, Lead Activities, Sales Team, Sales Representative, Todo, Todo Dashboard

Third Party

Customer Group, Customer Category, Customer, Customer Contact, Vendor Group, Vendor Category, Vendor, Vendor Contact

Sales

Sales Quotation, Sales Order, Delivery Order, Sales Return, Credit Note, Invoice, Payment Receive — lists export to XLSX, Detail pages print to PDF

Purchase

Purchase Requisition, Purchase Order, Goods Receive, Purchase Return, Debit Note, Bill, Payment Disburse — lists export to XLSX, Detail pages print to PDF

Inventory

Unit Measure, Product Group, Product, Warehouse, Transfer Out, Transfer In, Positive/Negative Adjustment, Scrapping, Stock Count, Transaction Report, Stock Report, Movement Report

Utilities

Booking Group, Booking Resource, Booking, Program Manager, Program Resource, Payment Method

Monitoring & Logs

Health Check, Serilog logs, System File — plus the Hangfire dashboard at /hangfire

App Settings

Users, Roles, Tax, Country, Currency, Auto Number, Company, Branch

System Settings

full inspection mode for appsettings.json

Super Admin

Tenant, Tenant User, System User, Health Check, Serilog, System File, Job Dashboard

AI Chat

ChatGPT / Claude / Gemini / DeepSeek (optional, bring your own API key)

Technology

Technologies Used

Blazor CRM Multi-Tenant is built on the modern .NET ecosystem with production-grade libraries and tools.

.NET 10 ASP.NET Core 10 Blazor Web App (Interactive Server) MudBlazor ASP.NET Core Minimal APIs Entity Framework Core 10 CQRS Handlers (No MediatR) FluentValidation Swagger / OpenAPI SignalR Hangfire Serilog Firebase SSO
LayerTechnology
Framework.NET 10
Web FrameworkASP.NET Core 10
UI RenderingBlazor Web App — Interactive Server render mode (SignalR circuit)
UI Component LibraryMudBlazor (Material Design components for Blazor)
UI AssetsSheetJS (Excel export), jsPDF (PDF print), ECharts (dashboards)
Architecture PatternVertical Slice Architecture (VSA) via ASP.NET Core Areas + CQRS plain handlers (no MediatR)
Multi-TenancyIMultiTenant + EF Core global query filter (60 entities) + tenant selection cookie/JWT claim
API StylePer-feature Minimal API groups (/api/{entity}) with Swagger/OpenAPI
Data AccessEntity Framework Core 10 — code-first, auto-create on startup, DataTable paging/search/sort helpers
DatabaseInMemory (zero-config) / SQL Server / PostgreSQL — toggle IsUsed in appsettings.json
Branch ScopeIHasBranch + BranchId — tenant-scoped branches, protected Head Office per workspace
ValidationFluentValidation
AuthenticationASP.NET Core Identity + JWT access/refresh token rotation + Firebase SSO (Google)
AuthorizationRole-based (11 global roles incl. SuperAdmin + per-area roles) + rate-limited endpoint policies
Real-TimeSignalR circuit (Blazor Web App interactive server mode)
Background JobsHangfire — dashboard at /hangfire, recurring jobs (daily log cleanup)
EmailMailKit — SendGrid / Mailgun / SMTP / Mailjet (switch via appsettings.json)
LoggingSerilog — rolling files, optional database sink and Seq, 3-day auto cleanup
ObservabilityHealth checks (/health/live, /health/ready) + Admin Ops metrics dashboard + OpenTelemetry (OTLP)
AI ChatOptional AI assistant — ChatGPT / Claude / Gemini / DeepSeek (provider + API key)
Architecture

Application Architecture

Blazor CRM Multi-Tenant uses Vertical Slice Architecture (VSA) with plain CQRS handlers wired directly into per-feature Minimal API endpoints, and EF Core global query filters for complete tenant isolation — no MediatR dependency.

Vertical Slice Architecture

Each feature (Tenant, Lead, Sales Order, Product, etc.) lives in its own folder under ASP.NET Core Areas with its Blazor pages, feature components, plain CQRS handlers, validators, and Minimal API endpoint all in one place. Zero coupling between features. Every handler automatically applies tenant filtering.

Folder structure: Areas/SuperAdmin/Tenant/ contains Pages/, Components/, Cqrs/, Endpoints/, and the entity fields definition — everything for that feature with tenant awareness built in.

Multi-Tenant Isolation

Tenant isolation is implemented at the EF Core level using global query filters combined with the soft-delete filter. 60 entity classes implement IMultiTenant, and every query is automatically scoped to TenantId == CurrentTenantId. Without a selected tenant the sentinel NO_TENANT_SELECTED makes reads return zero rows; inserts are auto-stamped with the current tenant (and throw without tenant context); changing TenantId on a row throws. Legacy rows are stamped on first update. Zero data leakage by design — no developer can accidentally query across tenants.

Tenant resolution: sign in, then pick a workspace at /TenantSelection. A signed HttpOnly X-Tenant-Token cookie (12 hours) becomes a tenant_id claim via claims transformation; TenantGuardMiddleware guards module areas and redirects to /TenantSelection?reason=no-tenant|invalid-tenant, while SuperAdmin pages are exempt. Bearer clients call POST /api/auth/select-tenant to receive a JWT with tenant_id.

Single-Project Monolith

The entire multi-tenant application — Blazor UI, REST API, tenant management, business logic, data access, and authentication — lives in one .NET 10 project. No distributed complexity, no microservice overhead. Single F5 to run. Deploy as one unit to Azure, IIS, or Docker. Perfect for SaaS startups that value velocity.

Project Structure Overview

Indotalent/
├── Areas/
│   ├── Main/                     # CRM dashboard, lead management, campaigns
│   │   ├── CrmDashboard/         # KPI dashboard (ECharts)
│   │   ├── Lead/                 # Lead + Lead Contact + Lead Activity
│   │   ├── Campaign/  Budget/  Expense/
│   │   ├── SalesTeam/  SalesRepresentative/
│   │   ├── Todo/  TodoDashboard/
│   │   └── TenantSelection/      # workspace picker after sign-in
│   ├── ThirdParty/               # Customer, Vendor + categories, groups, contacts
│   ├── Sales/                    # Quotation, Order, Delivery, Return, Credit Note,
│   │                             # Invoice, Payment Receive
│   ├── Purchase/                 # Requisition, Order, Goods Receive, Return,
│   │                             # Debit Note, Bill, Payment Disburse
│   ├── Inventory/                # Product, Warehouse, Transfer, Adjustment,
│   │                             # Scrapping, Stock Count, Reports
│   ├── Utilities/                # Booking, Program Manager, Payment Method
│   ├── Admin/                    # User, Role, Tax, Country, Currency, Auto Number,
│   │   │                         # Company, Branch (tenant-scoped)
│   ├── SuperAdmin/               # Tenant, TenantUser, SystemUser, JobDashboard +
│   │   │                         # Health Check, Serilog, System File (global, no tenant)
│   ├── AI/Chat/                  # multi-provider AI chat (ChatGPT/Claude/Gemini/DeepSeek)
│   ├── Identity/                 # Account pages (Login, Register, Manage)
│   ├── Public/                   # Home + built-in Documentation
│   └── Blazor/                   # App shell, layouts, HandlerInvoker, TenantGuard
├── Infrastructures/              # Auth, tenancy, database, email, jobs, logging, OTel
├── Data/                         # Entities (IMultiTenant), enums, seeders, migrations
├── Shared/                       # ApiResponse, DataTable helpers, pagination
└── Program.cs                    # Single entry point with full configuration

Areas/Main/Lead/                  # Feature folder convention (VSA)
├── Pages/         # Index / Create / Edit / Detail (.razor)
├── Components/    # feature-local dialogs and forms
├── Cqrs/          # GetList/GetById/Create/Update/Delete handlers + validators
├── Endpoints/     # LeadEndpoint.cs -> /api/lead
└── LeadFields.cs  # entity field definitions
Security

Security & Authorization

Security is baked into the architecture — multi-tenant isolation, Identity, JWT, RBAC, and audit trail.

Blazor CRM Multi-Tenant ships with tenant-aware authentication and authorization. ASP.NET Core Identity manages users with secure password hashing; roles are global constants and tenancy is a TenantUser mapping (tenant + user with IsActive) — newly registered users receive Guest and Member, and SuperAdmins are mapped to every tenant automatically. JWT access tokens with SHA-256 hashed refresh tokens and rotation protect the REST API, the signed X-Tenant-Token selection cookie drives the Blazor UI, and Firebase SSO (Google) is optional.

Role-based access control uses 11 global roles — Guest, Member, Admin, AI, Main, Sales, Purchase, Inventory, ThirdParty, Utilities and SuperAdmin — with every API group behind rate-limiting policies (global, authenticated, write, admin). EF Core global query filters combine TenantId == CurrentTenantId with the soft-delete filter so Tenant A's data never leaks to Tenant B; without a selected tenant the sentinel NO_TENANT_SELECTED makes reads return zero rows.

With Blazor Web App (interactive server mode), source code, database credentials, and tenant resolution logic never leave the server. All data access happens server-side via SignalR.

Security Features

  • Tenant Isolation — Global query filter TenantId == CurrentTenantId (60 IMultiTenant entities) + NO_TENANT_SELECTED sentinel for reads
  • ASP.NET Core Identity — User registration, login, password hashing, password reset; TenantUser mapping controls workspace membership
  • JWT + Refresh Token Rotation — SHA-256 hashed refresh tokens; X-Tenant-Token cookie (12 h) for the Blazor UI, JWT tenant_id claim for API clients
  • Role-Based Access Control — 11 global roles incl. SuperAdmin + per-area roles; TenantUser mapping per workspace
  • Policy-Based Authorization — Declarative policies for fine-grained feature access
  • Tenant Guard — TenantGuardMiddleware requires a selected workspace for module areas (SuperAdmin pages are exempt); redirects carry no-tenant / invalid-tenant reasons
  • Firebase SSO — Optional Google sign-in via Firebase Authentication
  • Rate Limiting — Four endpoint policies: global, authenticated, write, admin
  • Audit Trail — Every create/update/delete logged with tenant, user ID, and timestamp
  • Server-Side Code — Source code, DB credentials, and tenant logic never leave the server
Integration

REST API & Integration

Blazor CRM Multi-Tenant exposes a complete tenant-aware REST Web API built on per-feature Minimal API groups — ready for mobile apps, third-party integrations, and external systems.

API Endpoints (Tenant-Aware)

Every feature registers one Minimal API endpoint group. All endpoints are JWT-protected, role-authorized, rate-limited, tenant-scoped and return an ApiResponse<T> envelope.

POST/api/auth/select-tenant— Workspace selection for Bearer clients — JWT with tenant_id
GET/api/tenant— Tenant management (SuperAdmin only, global)
GET/api/customer— Tenant-scoped list — DataTable paging, search, sort
GET/api/customer/export— Full Excel export (SheetJS download)
GET/api/customer/{id}/items— Related line items for a header record
GET/api/customer/{lookup}-lookup— Lookup options for form selectors
POST/api/customer— Create customer — auto-stamped with the current tenant
PUT/api/customer— Update customer — tenant-scoped
DELETE/api/customer/{id}— Soft-delete customer — tenant-scoped

The same tenant-aware pattern applies to every entity — vendor, lead, campaign, sales order, invoice, product, branch and more — with /export, /{id}/items and /{lookup}-lookup routes.

API Features

  • Swagger/OpenAPI Docs — Interactive API documentation at /swagger
  • JWT Authentication — Access + refresh tokens with rotation; Bearer clients select a workspace via POST /api/auth/select-tenant
  • Automatic Tenant Scoping — API returns only data belonging to the selected workspace (tenant_id claim)
  • FluentValidation — Input validation on all endpoints
  • Server-Side DataTables — Paging, search, and sorting handled by CQRS list handlers
  • Excel Export — /export endpoints feed client-side .xlsx download via SheetJS; Detail pages print to PDF via jsPDF
  • Rate Limiting — Global, authenticated, write and admin endpoint policies
  • Mobile-Ready — Use the API to build mobile apps or integrate with external systems
Database & Deployment

Database & Deployment

Three database providers, auto-provisioned workspaces, and flexible deployment options — ready to run in under 60 seconds.

Database

  • InMemory — Zero-config provider for instant evaluation (no database server needed)
  • SQL Server — Production provider, auto-created and seeded on startup
  • PostgreSQL — Production provider, switch with a single IsUsed toggle in appsettings.json
  • EF Core Migrations — Code-first approach with full migration history
  • Demo Mode — 4 demo tenants (Bandung, Jakarta, Singapore, Kuala Lumpur) seeded automatically
  • Tenant Provisioning — each new workspace is seeded with 8 countries, 8 currencies, 4 taxes, a default company, a protected Head Office branch, 6 system warehouses and 5 payment methods

Deployment Options

  • Azure App Service — Deploy directly from Visual Studio or GitHub Actions
  • IIS (Windows Server) — Standard ASP.NET Core publish to IIS
  • Docker — Containerize and deploy anywhere Docker runs
  • Windows / Linux / macOS — .NET 10 runs everywhere
  • Single Project — No distributed complexity. One publish, one deploy, serve all tenants
  • Setup Time: Clone repo → choose a database provider → F5 → serving multiple tenants in under 60 seconds

Application Screenshots

Explore the Blazor CRM Multi-Tenant interface — tenant management, dashboards, contact management, sales pipeline, and more.

Blazor CRM Multi-Tenant Dashboard Overview Blazor CRM Multi-Tenant Contact Management Blazor CRM Multi-Tenant Tenant Management Blazor CRM Multi-Tenant Deal Tracking Blazor CRM Multi-Tenant Sales Pipeline Blazor CRM Multi-Tenant Reporting & Analytics Blazor CRM Multi-Tenant Data Management

Try the Live Demo

Test every feature — including multi-tenant isolation — before you buy. No registration required.

URL: https://blazor-saas-crm.csharpasp.net/

Email: admin@root.com

Password: 123456

FAQ

Frequently Asked Questions

You get the complete, unrestricted C# source code of the entire Blazor CRM Multi-Tenant application — V4. A single .NET 10 project with all features: multi-tenant workspaces with workspace selection (X-Tenant-Token cookie) and EF Core global query filters, multi-branch scoping per tenant, a Super Admin area, Vertical Slice Architecture with plain CQRS handlers, per-feature Minimal API endpoints, EF Core migrations and three database providers (InMemory, SQL Server, PostgreSQL). Clone, choose a database provider, press F5, and serve multiple tenants immediately.
After sign-in you pick a workspace at /TenantSelection. A signed HttpOnly X-Tenant-Token cookie (12 hours) becomes a tenant_id claim, and EF Core global query filters combine TenantId == CurrentTenantId with the soft-delete filter across 60 IMultiTenant entity classes. Without a selected tenant the sentinel NO_TENANT_SELECTED makes reads return zero rows; inserts are auto-stamped (and throw without tenant context); changing TenantId on a row throws. API clients use POST /api/auth/select-tenant. Zero data leakage between tenants.
Absolutely! You receive the complete source code. You can rebrand, add custom features, modify the multi-tenant architecture, and deploy as your own SaaS product. Each license covers one end product per client project. See our License page.
Blazor CRM Multi-Tenant ships with three database providers: InMemory for zero-config evaluation, SQL Server, and PostgreSQL for production. Switch providers with a single IsUsed toggle in appsettings.json — the database is auto-created and seeded on startup, including 4 demo tenants.
Absolutely! The code is clean, well-structured, and self-documenting. Beginners can study real multi-tenant SaaS patterns, EF Core global query filters, authentication flows, VSA feature organization, and REST API design — all in a single project.
Due to the digital nature of source code, we have a strict no-refund policy. That's why we provide a fully functional live demo with multi-tenant testing — test every feature before you buy. Full policy here.
Each workspace has its own branch list. Tenant provisioning seeds a protected Head Office branch (plus countries, currencies, taxes, a default company, system warehouses and payment methods), and branch scoping is tenant-scoped end to end — records, selectors and the searchable Branch column always stay inside the selected workspace.
V4 adds workspace selection with a signed tenant cookie and guard middleware, multi-branch scoping per tenant, a Super Admin area (7 platform modules), CQRS plain handlers wired to per-feature Minimal API endpoints (no MediatR), JWT refresh-token rotation with optional Firebase SSO, three database providers (InMemory / SQL Server / PostgreSQL), and a built-in ops stack: Hangfire, Serilog, health checks, OpenTelemetry and rate limiting.
Yes. ASP.NET Core Identity with JWT access tokens (SHA-256 hashed refresh tokens with rotation) and a signed tenant selection cookie, plus optional Firebase SSO (Google). There are 11 global roles: Guest, Member, Admin, AI, Main, Sales, Purchase, Inventory, ThirdParty, Utilities and SuperAdmin. Workspace membership is a TenantUser mapping (tenant + user, IsActive) — new users get Guest and Member, and SuperAdmins are mapped to every tenant automatically.
Vertical Slice Architecture (VSA) via ASP.NET Core Areas with plain CQRS handlers — no MediatR. Each feature lives in its own folder with Blazor pages, a single-purpose handler exposing HandleAsync() and returning ApiResponse<T>, a FluentValidation validator and a Minimal API endpoint group. Blazor pages call handlers through HandlerInvoker, while Minimal API endpoints inject them directly. Tenant isolation is enforced by EF Core global query filters.

Get Blazor CRM Multi-Tenant Source Code

Complete, unrestricted C# source code with full multi-tenant SaaS architecture. Single .NET 10 project.

$21 $49
Instant Download
Buy Now — $21 via Lemon Squeezy

or

cards
Powered by paypal

Secure checkout via PayPal or LemonSqueezy. No subscription.

MVC EDevKit

NEW · ASP.NET Core MVC

The Same VSA You Know. Now in ASP.NET Core MVC.

MVC EDevKit Basic is the MVC implementation of Vertical Slice Architecture — every feature lives in one self-contained folder with Controllers, CQRS handlers, per-feature Endpoints, and Razor Views.

  • MVC implementation of VSA — one folder per feature: Controllers, Cqrs handlers, Endpoints, Views + DataTables.
  • Production-grade & AI-Ready — included skill file generates a complete feature in 18 files from a single prompt.
  • 10 enterprise features pre-built — Identity + JWT + Firebase SSO, Hangfire, multi-provider email, Serilog, health checks.
More Detail
MVC EDevKit Basic ASP.NET Core MVC starter

7 Free Enterprise Manager Apps

Included free with every MVC EDevKit purchase
Asset ManagerComplete IT asset lifecycle management
Booking ManagerResource booking, approvals, check-in/out
Helpdesk ManagerInternal IT support ticketing
Invoice ManagerCreate, manage, track invoices
Meal ManagerMeal ordering for staff and guests
Project ManagerProjects, timesheets, and skill matrix
Roster ManagerEmployee shift scheduling