Skip to content

Project Structure

The project follows Clean Architecture principles with a clear separation of concerns.

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 tests

The innermost layer. Contains entities, value objects, enums, and domain interfaces. Has no dependencies on other project layers.

Contains business logic, service interfaces, and DTOs. Depends only on the Domain layer.

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.

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.

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.