This project demonstrates the creation, development, and deployment of a Blazor WebAssembly (WASM) application using .NET 8. It adheres to SOLID principles to ensure a clean, maintainable codebase, and is deployed as an Azure Static Website for global accessibility.
Before you begin, ensure you have the following installed:
- .NET 8 SDK
- Visual Studio 2022 or later with the ASP.NET and web development workload
- Azure CLI
- An active Azure subscription
-
Open your terminal or command prompt.
-
Navigate to the directory where you want to create the project.
-
Run the following command to create a new Blazor WebAssembly project:
dotnet new blazorwasm -o src/Client --force
-
Navigate into your project directory:
cd src/Client
-
Open the project in Visual Studio or your preferred IDE.
- Place any required assets (images, CSS, JavaScript files) in the
wwwroot
folder of your project.
Ensure your project adheres to SOLID principles for better maintainability and scalability. Here are some general guidelines:
- Single Responsibility Principle: Keep components focused on a single task.
- Open/Closed Principle: Design components to be open for extension but closed for modification.
- Liskov Substitution Principle: Derived classes must be substitutable for their base classes.
- Interface Segregation Principle: Use many client-specific interfaces instead of one general-purpose interface.
- Dependency Inversion Principle: Depend on abstractions, not on concretions.
Refactor your code accordingly to follow these principles.
- Commit your changes and push them to your GitHub repository.
- In the Azure Portal, create a new Static Web App.
- Follow the wizard to connect your GitHub repository and configure the build and deployment settings.
- Once the deployment is complete, Azure will provide you with a URL to access your Blazor WASM application.
Contributions are welcome! Please read our Contributing Guide for more information.
This project is licensed under the MIT License - see the LICENSE file for details.