Open source · ASP.NET Core starter
Backend Template
BackEnd_templete-
The solution
Six projects land on the plate: Domain, Application, Infrastructure, Api, Contracts and a Client — one .NET 10 solution.
Taxi_Server.slnx -
Clean Architecture
They stack the way they depend: the Domain at the bottom, the use cases on it, Infrastructure and the Api on top — every dependency points inward.
src/ -
Results, not exceptions
A broken business rule returns a Result with an Error and its kind, and one translator turns it into a localized problem response.
Result<T> -
The MediatR pipeline
Every request runs logging → validation → performance → caching before its handler.
Common/Behaviours/ -
One feature, five use cases
Cars: create, update and remove commands, two queries, their validators, a DTO and a mapper — the 17-step feature recipe, done once as an example.
Features/Cars/ -
The data
EF Core on PostgreSQL 16, with migrations and interceptors that fill audit fields and dispatch domain events.
AppDbContext.cs -
Sign-in
Identity with JWT access tokens and rotating refresh tokens, issued and refreshed by the API.
TokenProvider.cs -
The endpoints
Sign in, refresh, who am I — and the Cars CRUD, cached per language.
requests/requests.http -
One command to run it
The API with PostgreSQL 16, Seq for logs, and Prometheus and Grafana for metrics — five services in Docker Compose.
docker-compose.yml -
Tested
Unit tests for the domain (Result, Car, RefreshToken) and the application (the pipeline registration, result serialization).
dotnet test -
Written down for AI
Prompts to add a feature, fix a bug, change one layer or update the docs, plus AGENTS.md — the rules an assistant follows.
prompts/add-feature.md -
A backend to start from
Everything above, ready the day you start a new API.
git clone … BackEnd_templete
Backend Template
Inside the repository
-
The solution, from the outside
210 files: six projects in src/, two test projects, Docker containers for logs and metrics, the docs, sample requests and prompts for AI assistants.
Taxi_Server.slnx -
src/ — six projects
Api, Application, Domain, Infrastructure, Contracts and a Client: Clean Architecture, every dependency pointing inward.
src/ -
Domain — the rules
Entities and their errors (Car, RefreshToken), AuditableEntity, DomainEvent, LocalizedText and a Result type — and no framework at all.
src/Taxi.Domain/ -
Results, not exceptions
Result, Error and ErrorKind: a business rule that fails returns an error the API can translate, instead of throwing.
Result<T> -
Application — the use cases
Commands and queries per feature with MediatR, their validators, DTOs and mappers, and the shared pipeline behaviours.
src/Taxi.Application/ -
The MediatR pipeline
Every request passes logging, validation, performance and caching before its handler; unhandled exceptions are caught on the way.
ValidationBehavior.cs -
One feature: Cars
Create, update and remove commands, the list and by-id queries, a DTO and a mapper — the 17-step feature recipe, done once as an example.
Features/Cars/ -
Infrastructure — the outside world
EF Core on PostgreSQL with configurations, migrations and interceptors for audit fields and domain events; Identity with JWT and refresh tokens; settings.
src/Taxi.Infrastructure/ -
Api — the edge
Controllers, a global exception handler, OpenAPI transformers (bearer, Accept-Language, version) and Arabic and English resources.
src/Taxi.Api/Program.cs -
tests/ — 7 files
Unit tests for the domain (Result, Car, RefreshToken) and the application (pipeline registration, result serialization).
dotnet test -
prompts/ — for AI assistants
Ready instructions to add a feature, modify one, fix a bug, change a single layer or update the docs — the rules written down.
prompts/add-feature.md -
All of it
210 files: a backend you can start a new API from on day one.
docker compose up
A reusable .NET 10 backend template with Clean Architecture and CQRS, ready for new APIs with authentication, caching, logging and testing.
- My role
- Author
- Period
- 2026
- Company
- Open source
- Runs on
- .NET 10 · Docker
Read the whole case study · 1 min
A reusable .NET 10 backend template with Clean Architecture and CQRS, ready for new APIs with authentication, caching, logging and testing.