Project Structure
The project follows Clean Architecture principles with a clear separation of concerns.
Solution Structure
Section titled “Solution Structure”template/├── src/│ ├── DotnetSaas.Domain/ # Entities, enums, interfaces│ ├── DotnetSaas.Application/ # Business logic, services│ ├── DotnetSaas.Contracts/ # DTOs shared with frontends│ ├── DotnetSaas.Infrastructure/ # EF Core, Identity, external services│ ├── DotnetSaas.Api/ # Minimal API endpoints│ ├── DotnetSaas.AppHost/ # .NET Aspire orchestrator│ └── DotnetSaas.ServiceDefaults/# Shared service configuration├── frontend/│ ├── blazor/ # Blazor WASM frontend│ ├── react/ # React frontend│ ├── angular/ # Angular frontend│ └── vue/ # Vue frontend└── tests/ ├── DotnetSaas.Tests/ # Unit tests └── DotnetSaas.IntegrationTests/ # Integration testsLayer Responsibilities
Section titled “Layer Responsibilities”Domain
Section titled “Domain”The innermost layer. Contains entities, value objects, enums, and domain interfaces. Has no dependencies on other project layers.
Application
Section titled “Application”Contains business logic, service interfaces, and DTOs. Depends only on the Domain layer.
Contracts
Section titled “Contracts”Shared DTOs and request/response records used by both the API and frontend projects. This enables type-safe communication between the Blazor WASM client and the API.
Infrastructure
Section titled “Infrastructure”Implements interfaces defined in Application. Contains EF Core DbContext, Identity configuration, external service integrations (Stripe, email, storage), and background jobs.
The entry point. Defines minimal API endpoints, middleware, and the application pipeline. References all other layers.
Frontend Architecture
Section titled “Frontend Architecture”All frontend frameworks consume the same REST API at /api/v1/. The Contracts project is shared with Blazor WASM for type safety. React, Angular, and Vue frontends use generated TypeScript types.