How neozhu/cleanaspire works
Project Type and Purpose
• CleanAspire is a .NET 9 Minimal API + Blazor WebAssembly PWA template built on Clean Architecture principles.
• It provides a ready-to-use full-stack solution:
• A Blazor WebAssembly client (ClientApp/WebApp) with PWA support (offline caching, service workers).
• A Minimal API backend (CleanAspire.Api) hosting business logic via an Application layer.
• A layered architecture (AppHost, Application, Domain, Infrastructure, Migrators, ServiceDefaults).
• Integration with external services (Webpushr for push notifications, Minio for file storage, SendGrid for email, external OAuth providers).
File Structure
• Top-level solution (.sln) containing:
• src/CleanAspire.Api – Minimal API endpoints, OpenAPI, exception handlers, identity/email, Webpushr config.
• src/CleanAspire.AppHost – Host setup (Aspire), configuration (appsettings, logging).
• src/CleanAspire.Application – Business logic (commands/queries/event handlers), DTOs, validators, pipeline behaviors (caching, validation).
• src/CleanAspire.Domain – Core entities, value objects, domain events, interfaces.
• src/CleanAspire.Infrastructure – EF Core DbContext, persistence configurations, interceptors, file-upload services, DI registrations.
• src/CleanAspire.ClientApp – Blazor WASM PWA client, Kiota-generated HTTP client proxies, components, pages, services (offline, caching, navigation, push).
• src/CleanAspire.WebApp – Blazor Server–hosted version for SEO/SSR fallback.
• src/Migrators – Database migrations for MSSQL, PostgreSQL, SQLite.
• tests/CleanAspire.Tests – Endpoint/unit tests.
• deploy/docker-compose.yml – Docker setup for API, WebApp, Standalone.
README for Additional Insights
• Outlines Clean Architecture layering.
• Mentions: Minimal APIs, Scalar for OpenAPI documentation, Aspire for hosting, Kiota for client generation, PWA/offline (IndexedDB, Service Worker), Webpushr notifications, CI/CD workflows.
Detail
• Essential components (AppHost, Endpoints, Pipeline Behaviors, EF Interceptors).
• Kiota code-generation process from the API’s OpenAPI to the ClientApp.
• Offline flow: Client fallback to IndexedDB when offline.