Reference app showing how the library pieces work together in a real API.
- Todo CRUD with filtering and pagination
- FluentValidation request validation
- Standardized error handling and ProblemDetails responses
- Soft delete and auditing
- Column-level encryption for sensitive user fields
- Health checks (
/health,/health/ready,/health/live,/health/detailed) - Scalar/OpenAPI exploration in Development
cd samples/MinimalCleanArch.Sample
dotnet runOpen:
https://localhost:5095/scalar/v1http://localhost:5096/scalar/v1
curl -X POST "http://localhost:5096/api/todos" \
-H "Content-Type: application/json" \
-d '{
"title": "Learn MinimalCleanArch",
"description": "Run through the sample app features",
"priority": 3,
"dueDate": "2030-12-31"
}'curl "http://localhost:5096/api/todos?searchTerm=learn&pageSize=10&pageIndex=1"
curl "http://localhost:5096/api/todos?isCompleted=false&priority=3"curl -X POST "http://localhost:5096/api/todos" \
-H "Content-Type: application/json" \
-d '{
"title": "",
"description": "invalid",
"priority": 99
}'Expected: 400 with validation details.
curl "http://localhost:5096/api/todos/999999"Expected: standardized not-found/problem response.
curl "http://localhost:5096/health"
curl "http://localhost:5096/health/ready"
curl "http://localhost:5096/health/live"
curl "http://localhost:5096/health/detailed"Public:
POST /api/users/registerPOST /api/users/login
Authenticated:
GET /api/users/profilePUT /api/users/profileGET /api/users/todos
Admin policy (Admin role):
GET /api/admin/usersDELETE /api/admin/users/{userId}POST /api/admin/users/{userId}/roles/{roleName}DELETE /api/admin/users/{userId}/roles/{roleName}
MinimalCleanArch.Sample/
|- API/
| |- Endpoints/
| |- Models/
| |- Validators/
|- Domain/
| |- Entities/
|- Infrastructure/
| |- Data/
| |- Specifications/
| |- Seeders/
|- Program.cs
|- appsettings.json
Program.csfor service registration and middleware order.API/Endpoints/TodoEndpoints.csfor result-first endpoint patterns.API/Validators/TodoValidators.csfor request rules.Infrastructure/Specifications/for filtering logic.Infrastructure/Seeders/for startup data seeding.
- specifications composed in application-facing query paths
- validators registered once and reused by endpoints
- result-to-HTTP mapping without controller-specific plumbing
- encrypted properties and audit support without leaking infrastructure into the domain model
- a concrete reference for how the packages fit together in one app
- SQLite is used by default (
Data Source=minimalcleanarch.db). - If
Encryption:Keyis not configured, a temporary key is generated in Development. - Scalar is mapped in Development and is the default launch URL in
Properties/launchSettings.json.