What the generated .NET app contains
Application structure (Clean Architecture)
src/
{Project}.Api/
Controllers/
AuthController.cs # POST /auth/login, /auth/register
{Entity}Controller.cs # [ApiController] per entity
Middleware/
TenantMiddleware.cs # multi-tenant workspace resolution
GlobalExceptionHandlerMiddleware.cs
Program.cs # Minimal API setup, DI registration
appsettings.json # ${ENV_VAR} references, no secrets
{Project}.Core/
Entities/
{Entity}.cs # Domain entities (POCOs)
User.cs
Interfaces/
I{Entity}Repository.cs
I{Entity}Service.cs
DTOs/
{Entity}Request.cs # FluentValidation validators
{Entity}Response.cs
{Project}.Infrastructure/
Data/
AppDbContext.cs # EF Core DbContext with tenant filter
Configurations/
{Entity}Configuration.cs # IEntityTypeConfiguration per entity
Migrations/ # EF Core migrations
Repositories/
{Entity}Repository.cs # implements I{Entity}Repository
Services/
EmailService.cs
{Entity}Service.cs
tests/
{Project}.Tests/
Controllers/
{Entity}ControllerTests.cs # WebApplicationFactory integration tests
Services/
{Entity}ServiceTests.cs # xUnit + Moq unit tests
Fixtures/
TestDatabaseFixture.cs # Testcontainers PostgreSQL
{Project}.sln
Dockerfile
docker-compose.yml
Makefile
openapi.yaml
Database layer
- Entity Framework Core 8 — no raw SQL for queries (exception: raw SQL for PostgreSQL-specific session commands)
- EF Core migrations —
dotnet ef migrations addper entity, version-controlled IEntityTypeConfiguration— all column types, indexes, and FK constraints declared explicitly- Global query filter on
AppDbContextfor multi-tenant workspace scoping:.HasQueryFilter(e => e.WorkspaceId == _workspaceId) - Optimistic concurrency via
[Timestamp]/rowversionon aggregate roots - PostgreSQL via Npgsql — never SQL Server Express in production config
Auth and security
- ASP.NET Core Identity for user management + password hashing (pbkdf2)
- JWT bearer tokens issued as httpOnly cookies with
SameSite=Lax [Authorize]attribute on every protected controllerFluentValidationvalidators on every request DTO — no manualModelStatechecks- Secrets via
Environment.GetEnvironmentVariable()orIConfigurationbound to env vars — neverappsettings.jsonliterals - Rate limiting via
Microsoft.AspNetCore.RateLimitingon auth endpoints
API design
[ApiController]with attribute routing:[Route("api/v1/[controller]")]- Routes match the generated OpenAPI 3.1 spec (via Swashbuckle / Scalar)
{Entity}Responserecord on every response — never expose EF entities directly- Consistent error format:
{"error": "snake_case_code", "message": "Human readable description."} - 201 for creation, 422 for validation errors (via
ValidationProblemDetails), 403 for permission, 404 for not found - Pagination via
IPagedResult<T>response wrapper
Tests
- xUnit + Moq test suite with
WebApplicationFactoryfor integration tests - Testcontainers PostgreSQL for real database tests (no in-memory database)
- Auth tests: token issuance, refresh, expiry, 401 enforcement
- Controller tests: HTTP status codes, validation error shapes, authorization
- Repository tests: CRUD, tenant isolation, soft-delete behavior
Infrastructure
- Multi-stage Dockerfile (mcr.microsoft.com/dotnet/sdk:8.0 build → runtime:8.0-alpine — ~100MB final image)
docker-compose.yml: ASP.NET Core app + PostgreSQL + Redis (for distributed cache / rate limiting)Makefile:make dev,make test,make migrate- GitHub Actions:
dotnet format --verify-no-changes→dotnet test→docker build→ deploy
ASP.NET Core vs Minimal API
Both patterns are generated by Archiet. The choice:
Choose Controller-based API (default) when:
- Your team knows the MVC controller pattern
- You want attribute routing, filters, and action results
- You're building a large API with many endpoints
Choose Minimal API when:
- You're building a small service or microservice
- You want the lightest possible startup overhead
- You prefer explicit, procedural route registration
Archiet generates controller-based by default. Minimal API is available for microservices output.
vs dotnet new templates and Ardalis Clean Architecture
dotnet new webapi gives you weather forecast boilerplate. Ardalis Clean Architecture gives you the architectural scaffolding.
What neither gives you: your entities, your repositories, your services, your controllers, your migrations, your tests — the 80% of the application specific to your product.
Archiet generates the complete ASP.NET Core application for your specific product, in Clean Architecture layout, production-ready.
CTA
Generate a complete ASP.NET Core + Next.js application from your requirements — free plan, no credit card.
Describe your product, pick .NET Core, download a production-ready codebase in 90 seconds.
Start free at archiet.com.