CleanArch.Generator
1.0.142
dotnet tool install --global CleanArch.Generator --version 1.0.142
dotnet new tool-manifest
dotnet tool install --local CleanArch.Generator --version 1.0.142
#tool dotnet:?package=CleanArch.Generator&version=1.0.142
nuke :add-package CleanArch.Generator --version 1.0.142
๐งฑ Clean Architecture Template for .NET
This template generates a project based on Clean Architecture using .NET, with a clear separation of concerns. It simplifies development, testing, and long-term maintenance.
ุชูุงุตู ู ุนู
ุฅุฐุง ูุงู ูุฏูู ุฃู ุฃุณุฆูุฉ ุฃู ุชุฑุบุจ ูู ู ูุงูุดุฉ ุงูุฃุฏุงุฉุ ูู ููู ุงูุชูุงุตู ู ุนู ุนุจุฑ:
- ุงูุจุฑูุฏ ุงูุฅููุชุฑููู: support@example.com
- WhatsApp: ุงุชุตู ุจู ุนุจุฑ WhatsApp
- LinkedIn: ุฑุงุจุท ุญุณุงุจู ุนูู LinkedIn
- **Slack/Telegram **: ุงูุถู ุฅูู ููุงุชู ุนูู Telegram
ู ูุงุญุธุฉ: ูู ููู ุฃูุถูุง ุฅูุดุงุก issue ุนูู GitHub ููุฅุจูุงุบ ุนู ุฃู ู ุดููุฉ ุฃู ูุทูุจ ู ูุฒุงุช ุฌุฏูุฏุฉ!
๐ Features
- โ
Well-structured layered architecture:
API,Application,Domain,Infrastructure - ๐ฆ Professional folder structure with logical separation of responsibilities
- ๐งช High testability and support for unit testing
- โ๏ธ Built with the latest .NET version (
net8.0) - ๐งฐ Easily extensible and customizable for various application types (Web API, Microservices, etc.)
โ๏ธ Installation & Usage (PowerShell)
๐ฅ๏ธ All commands below should be run using PowerShell
๐ ๏ธ The generator tool is installed once globally on your machine.
1. Install the Generator Tool (one-time setup)
dotnet tool install --global CleanArch.Generator --version 1.0.118 --add-source "C:\Your\Path"
2. Create a New Project for Any .NET Version
First, create a new folder for your project and navigate into it using PowerShell:
mkdir MyNewProject
cd MyNewProject
Then generate the project using:
cleanarch-gen new --name MyNewProject --framework net8.0
๐ก If
--frameworkis not specified, the latest available .NET version will be used by default.
๐๏ธ Project Structure
MyNewProject/
โโโ src/
โโโ MyNewProject.API/ # ุทุจูุฉ ุงูุนุฑุถ (Controllers + Middleware)
โ โโโ Controllers/
โ โ โโโ BaseController.cs
โ โโโ Middleware/
โ โ โโโ ExceptionMiddleware.cs
โ โโโ MyNewProject.API.csproj
โ
โโโ MyNewProject.Domain/ # ุงูููุงูุงุช ููุงุฌูุงุช ุงูุชุฌุฑูุฏ
โ โโโ Entites/
โ โ โโโ BaseEntity.cs
โ โโโ Interface/
โ โ โโโ IRepository.cs
โ โ โโโ IUnitOfWork.cs
โ โโโ MyNewProject.Domain.csproj
โ
โโโ MyNewProject.Application/ # ู
ูุทู ุงูุฃุนู
ุงูุ ุงูุฎุฏู
ุงุชุ DTOs
โ โโโ Base/
โ โ โโโ BaseService.cs
โ โโโ Interface/
โ โ โโโ IService.cs
โ โโโ Implement/
โ โ โโโ Service.cs
โ โโโ DTOs/
โ โ โโโ RequestDTO.cs
โ โ โโโ ResponseDTO.cs
โ โโโ MyNewProject.Application.csproj
โ
โโโ MyNewProject.Infrastructure/ # ุชูููุฐ ุงูู
ุณุชูุฏุนุงุชุ DbContext
โ โโโ Data/
โ โ โโโ AppDbContext.cs
โ โโโ Repository/
โ โ โโโ Repository.cs
โ โ โโโ UnitOfWork.cs
โ โโโ MyNewProject.Infrastructure.csproj
โ
โโโ MyNewProject.sln # ู
ูู ุงูุญู ุงูุฃุณุงุณู
๐งฉ Layer Explanation
| Layer | Description |
|---|---|
| API | Handles HTTP requests (controllers and middleware) |
| Domain | Defines core entities and repository/unit-of-work interfaces |
| Application | Application logic (services, DTOs, and interface implementations) |
| Infrastructure | Implements database access, repositories, and DbContext setup |
โถ๏ธ Run the Project
cd MyNewProject
dotnet run
Then navigate to: https://localhost:7025
๐งช Extensibility & Testing
You can add a test project (e.g., MyNewProject.Tests) to cover business logic and infrastructure.
Recommended tools:
๐ Notes
- Suitable for teams adopting Separation of Concerns
- Fully customizable to fit your team's style or environment
- Designed with best practices for enterprise-grade software development
๐ฌ Contributing
Contributions are welcome! Whether itโs a suggestion, improvement, or bug fix โ feel free to submit a pull request.
๐ License
This project is licensed under the MIT License. You are free to use, modify, and distribute it with attribution.
๐ NuGet Package:
https://www.nuget.org/packages/CleanArch.Generator
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.142 | 452 | 12/11/2025 |
| 1.0.141 | 434 | 12/11/2025 |
| 1.0.140 | 172 | 9/6/2025 |
| 1.0.128 | 150 | 8/22/2025 |
| 1.0.127 | 146 | 8/22/2025 |
| 1.0.126 | 268 | 8/8/2025 |
| 1.0.125 | 219 | 5/18/2025 |
| 1.0.124 | 201 | 5/18/2025 |
| 1.0.123 | 194 | 5/18/2025 |
| 1.0.122 | 201 | 5/18/2025 |
| 1.0.121 | 213 | 5/16/2025 |
| 1.0.120 | 208 | 5/16/2025 |
| 1.0.119 | 225 | 5/16/2025 |
| 1.0.118 | 230 | 5/16/2025 |
| 1.0.117 | 214 | 5/16/2025 |
| 1.0.116 | 230 | 5/16/2025 |
| 1.0.114 | 226 | 5/16/2025 |
| 1.0.113 | 223 | 5/16/2025 |
| 1.0.112 | 230 | 5/16/2025 |
| 1.0.111 | 228 | 5/16/2025 |