ZKCleanAuth.Template 1.0.0

Suggested Alternatives

ZKCleanAuth.Template 1.1.0

Additional Details

The previous Version has a flaw it does not authenticate he routes. The newer version has this feature and the routes must include [Authorize] decorator

There is a newer version of this package available.
See the version list below for details.
dotnet add package ZKCleanAuth.Template --version 1.0.0
                    
NuGet\Install-Package ZKCleanAuth.Template -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ZKCleanAuth.Template" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZKCleanAuth.Template" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="ZKCleanAuth.Template" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ZKCleanAuth.Template --version 1.0.0
                    
#r "nuget: ZKCleanAuth.Template, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ZKCleanAuth.Template@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ZKCleanAuth.Template&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=ZKCleanAuth.Template&version=1.0.0
                    
Install as a Cake Tool

ZKCleanAuthTemplate

๐ŸŽฏ ZKCleanAuthTemplate is a production-ready, plug-and-play Clean Architecture template for ASP.NET Core with fully integrated JWT Authentication, Role-based Authorization, MediatR, FluentValidation, AutoMapper, and more.

Created by Zohaib Khan, this template accelerates your project kickoff by eliminating repetitive setup and promoting industry-standard architectural practices.


๐Ÿš€ Features

  • โœ… Clean Architecture (Domain, Application, Infrastructure, WebAPI)
  • ๐Ÿ” JWT Authentication (Login/Register with Role Claims)
  • ๐Ÿ‘ฅ Role-based Authorization (Admin/User separation)
  • ๐Ÿงฑ MediatR-based CQRS
  • ๐Ÿงน FluentValidation integration
  • ๐Ÿ”„ AutoMapper profile setup
  • ๐Ÿ“ฆ Configurable with dotnet new command
  • ๐Ÿงช Ready for unit/integration testing structure
  • ๐ŸŒ Global Exception Handling

๐Ÿ“ฆ Getting Started

Prerequisites


๐Ÿ› ๏ธ How to Use

1. Install the Template (from NuGet)

dotnet new install ZKCleanAuthTemplate::1.0.0
###Create a New Project
bash
dotnet new zkauth-n MyAuthProject
Your new project will be scaffolded with Clean Architecture and ready-to-run authentication APIs.

๐Ÿ—‚๏ธ Project Structure

๐Ÿ“ MyAuthProject/
โ”œโ”€โ”€ ๐Ÿ“ Domain
โ”œโ”€โ”€ ๐Ÿ“ Application
โ”œโ”€โ”€ ๐Ÿ“ Infrastructure
โ”œโ”€โ”€ ๐Ÿ“ WebAPI
All layers are properly separated and follow SOLID principles.

๐Ÿ”ง Customization Guide
You can extend this template to add:

Email confirmation

Refresh Tokens

Social Login

Multi-tenant Support

Swagger Authentication (already wired up partially)

๐Ÿค Contributions & Feedback
I built this for developers who want to skip boilerplate and focus on logic.
If you like it, feel free to:

โญ Star this template

๐Ÿž Submit issues or improvements

๐Ÿ”„ Fork and extend

๐Ÿ“ƒ License
MIT License

Built with โค๏ธ by Zohaib Khan โ€“ for learners, professionals, and companies who want clean, maintainable solutions from day one.
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 185 8/4/2025
1.0.0 288 8/4/2025 1.0.0 is deprecated.