CleanWebApi.Template
2026.10.29.102
Prefix Reserved
See the version list below for details.
dotnet new install CleanWebApi.Template@2026.10.29.102
Clean Web API
A dotnet new template for an API built with a streamlined version of Clean Architecture and ASP.NET Core Web API controllers.
It's one of five templates, for Minimal APIs, Web API controllers, GraphQL, Model Context Protocol and AWS Lambda, that share the same Application and Infrastructure layers, tests and CI pipeline.
Requirements
- .NET 10 SDK
- Docker (optional, to build and run the container image)
Install
dotnet new install CleanWebApi.Template
Create a solution
dotnet new cleanwebapi --name {YOUR_SOLUTION_NAMESPACE} --authorName "{YOUR_NAME}"
| Option | Description |
|---|---|
--name |
The name of the solution, also used as the root namespace. |
--authorName |
The name of the author of the solution. |
--authority |
The OAuth authorization server that issues access tokens. Leave it empty to run the API without authentication. |
--audience |
The audience access tokens must be issued for, usually the API's own URL. |
With an authority set, the movie, author and review endpoints need a JWT bearer token, and the version endpoint, the OpenAPI document and Scalar stay open.
Run it
From the new solution's folder, start the app and a Seq container for logs.
docker compose up -d
Then open the Scalar API reference at http://localhost:8080/scalar. The OpenAPI document is at http://localhost:8080/openapi/v1.json, and Seq shows the logs at http://localhost:5341.
Or run it without Docker.
dotnet run --project ./src/Presentation
Run the tests with dotnet test. Every way to run the solution is in docs/RUN.md inside it.
What's inside
- Presentation: ASP.NET Core controllers, documented with XML comments and browsable in Scalar
- Application: commands and queries through Mediator, validation with FluentValidation and mapping with Mapperly
- Infrastructure: Entity Framework Core on SQLite with migrations and optional sample data
- Tests: xUnit, Shouldly and NSubstitute, each test on its own in-memory database
- A Dockerfile that runs as a non-root user, a
docker-compose.yml, and a GitHub Actions pipeline with tests, a coverage gate, a container scan and CodeQL
Updates
A new version is released on the 1st of each month with every change merged since the previous release, as long as something has changed. To update an installed template:
dotnet new update
What changed in each version is in the release notes. To remove the template, run dotnet new uninstall CleanWebApi.Template.
More help
- README on GitHub for the architecture, every feature and the Docker build options
- Running guide for every way to run, configure and test the solution
- GitHub issues for bugs and ideas
- Security policy to report a vulnerability privately
Support
If this template saves you time, please consider sponsoring me on GitHub.
-
net10.0
- 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 |
|---|---|---|
| 2026.11.1.122 | 151 | 11/1/2026 |
| 2026.10.29.102 | 134 | 10/29/2026 |
| 2026.10.29.93 | 132 | 10/29/2026 |
| 2026.10.28.86 | 135 | 10/28/2026 |
| 2026.10.28.84 | 126 | 10/28/2026 |
| 2026.10.28.79 | 122 | 10/28/2026 |
| 2026.10.28.77 | 119 | 10/28/2026 |
| 2026.10.28.75 | 128 | 10/28/2026 |
| 2026.10.28.71 | 122 | 10/28/2026 |
| 2026.10.28.66 | 123 | 10/28/2026 |
| 2026.10.27.64 | 128 | 10/27/2026 |
| 2026.10.27.62 | 116 | 10/27/2026 |
| 2026.10.27.59 | 119 | 10/27/2026 |
| 2026.10.27.56 | 115 | 10/27/2026 |
| 2026.10.27.49 | 120 | 10/27/2026 |
| 2022.9.25.19 | 1,255 | 9/25/2022 |
| 2022.9.18.18 | 1,100 | 9/18/2022 |
| 2022.9.11.17 | 1,069 | 9/11/2022 |
| 2022.9.4.16 | 1,073 | 9/4/2022 |
| 2022.8.28.15 | 1,051 | 8/28/2022 |