
CleanAspire is a cutting-edge, open-source template built on .NET 9, designed to accelerate the development of lightweight, fast, and simple Blazor WebAssembly or Progressive Web Applications (PWA). It seamlessly integrates Minimal APIs, Aspire, and Scalar for modern API documentation.
With a focus on Clean Architecture and extreme code simplicity, CleanAspire provides developers with the tools to create responsive and maintainable web applications with minimal effort. The template also supports Microsoft.Kiota to simplify API client generation, ensuring consistency and productivity in every project.
CleanAspire fully supports offline mode through its integrated PWA capabilities, enabling your application to function seamlessly without an internet connection. By leveraging Service Workers and browser caching, the application can store essential resources and data locally, ensuring quick load times and uninterrupted access. Additionally, CleanAspire offers streamlined configuration options to help developers manage caching strategies and data synchronization effortlessly, guaranteeing that users receive the latest updates once the network is restored.
Key Features of Offline Support:
By incorporating robust offline capabilities, CleanAspire empowers developers to build resilient applications that deliver a consistent and reliable user experience, regardless of network conditions.
Built-in Aspire Support
Fast and Minimal .NET 9 Minimal APIs
Designed for Simplicity and Speed
Blazor WebAssembly and PWA Integration
Streamlined API Client Integration
Clean Architecture
Cloud-Ready with Docker
Real-Time Web Push Notifications
Integrated CI/CD Pipelines
Offline Mode Support
Offline mode enabled by default to provide a seamless experience even without internet access.
Uses IndexedDB to cache data locally, allowing the application to retrieve data and function offline.
The system detects the online/offline status and fetches data from IndexedDB when offline, ensuring uninterrupted access to key features.
version: '3.8'
services:
apiservice:
image: blazordevlab/cleanaspire-api:0.0.56
environment:
- ASPNETCORE_ENVIRONMENT=Development
- AllowedHosts=*
- ASPNETCORE_URLS=http://+:80;https://+:443
- ASPNETCORE_HTTP_PORTS=80
- ASPNETCORE_HTTPS_PORTS=443
- DatabaseSettings__DBProvider=sqlite
- DatabaseSettings__ConnectionString=Data Source=CleanAspireDb.db
- AllowedCorsOrigins=https://cleanaspire.blazorserver.com,https://localhost:7114
- Authentication__Google__ClientId=<your client id>
- Authentication__Google__ClientSecret=<your client secret>
- SendGrid__ApiKey=<your API key>
- SendGrid__DefaultFromEmail=<your email>
- Webpushr__Token=<your-webpushr-token>
- Webpushr__ApiKey=<your-webpushr-api-keys>
- Webpushr__PublicKey=<your-webpushr-public-key>
ports:
- "8019:80"
- "8018:443"
blazorweb:
image: blazordevlab/cleanaspire-webapp:0.0.56
environment:
- ASPNETCORE_ENVIRONMENT=Production
- AllowedHosts=*
- ASPNETCORE_URLS=http://+:80;https://+:443
- ASPNETCORE_HTTP_PORTS=80
- ASPNETCORE_HTTPS_PORTS=443
ports:
- "8015:80"
- "8014:443"
Clone the Repo:
git clone https://github.com/neozhu/cleanaspire.git
Navigate to the Project Folder:
cd CleanAspire
Run the Application:
dotnet run
Access the Application:
Open your browser and go to https://localhost:5001 to see the Blazor WebAssembly PWA in action.
Register on Webpushr
Obtain Required Keys
Add Configuration to appsettings.json
Add the keys obtained from Webpushr into your application configuration file as follows:
"Webpushr": {
"Token": "your-webpushr-token",
"APIKey": "your-webpushr-api-key",
"PublicKey": "your-webpushr-public-key"
}
Integrate Webpushr in the Application
PublicKey for initializing Webpushr on the client-side to enable browser notifications.Token and API Key securely on the server-side for API communication with Webpushr.CleanAspire is structured following the Clean Architecture approach, dividing the solution into distinct layers:
CleanAspire/
ā
āāā Solution Items/
ā āāā .editorconfig
ā
āāā src/
ā āāā CleanAspire.Api/ # API Layer - .NET Minimal API
ā ā āāā CleanAspire.Api.csproj
ā āāā CleanAspire.AppHost/ # Hosting Layer - Application hosting and configuration
ā ā āāā CleanAspire.AppHost.csproj
ā āāā CleanAspire.Application/ # Application Layer - Business Logic
ā ā āāā CleanAspire.Application.csproj
ā āāā CleanAspire.ClientApp/ # Client App Layer - Blazor WebAssembly or other client logic
ā ā āāā CleanAspire.ClientApp.csproj
ā āāā CleanAspire.Domain/ # Domain Layer - Core Entities, including EF entities
ā ā āāā CleanAspire.Domain.csproj
ā āāā CleanAspire.Infrastructure/ # Infrastructure Layer - Data Access, External Services
ā ā āāā CleanAspire.Infrastructure.csproj
ā āāā CleanAspire.ServiceDefaults/ # Service Defaults - Predefined configurations for services
ā ā āāā CleanAspire.ServiceDefaults.csproj
ā
āāā src/Migrators/
ā āāā Migrators.MSSQL/ # SQL Server Migration Scripts
ā ā āāā Migrators.MSSQL.csproj
ā āāā Migrators.PostgreSQL/ # PostgreSQL Migration Scripts
ā ā āāā Migrators.PostgreSQL.csproj
ā āāā Migrators.SQLite/ # SQLite Migration Scripts
ā ā āāā Migrators.SQLite.csproj
ā
āāā tests/
ā āāā CleanAspire.Tests/ # Unit and Integration Tests
ā ā āāā CleanAspire.Tests.csproj
ā
āāā README.md # Project README
āāā LICENSE # License Information
āāā CleanAspire.sln # Solution File
Contributions are welcome! If you want to add features, report bugs, or just suggest improvements, please feel free to submit issues or pull requests.
This project is licensed under the MIT Licenseā .
Feel free to reach out if you have questions or feedback. Let's build something amazing together with CleanAspire!
Content type
Image
Digest
sha256:805156df8ā¦
Size
149.2 MB
Last updated
3 months ago
docker pull blazordevlab/cleanaspire-webapp:0.0.123