|
1 | | -.... |
| 1 | +<img alt="icon" src=".diploi/icon.svg" width="32"> |
| 2 | + |
| 3 | +# Blazor Component for Diploi |
| 4 | + |
| 5 | +[](https://diploi.com/component/blazor) |
| 6 | +[](https://diploi.com/component/blazor) |
| 7 | +[](https://diploi.com/component/blazor) |
| 8 | + |
| 9 | +## Operation |
| 10 | + |
| 11 | +### Getting started |
| 12 | + |
| 13 | +1. In the Dashboard, click **Create Project +** |
| 14 | +2. Under **Pick Components**, choose **Blazor**. Here you can also add a backend framework to create a monorepo app |
| 15 | +3. In **Pick Add-ons**, you can add one or multiple databases to your app |
| 16 | +4. Choose **Create Repository** to generate a new GitHub repo |
| 17 | +5. Finally, click **Launch Stack** |
| 18 | + |
| 19 | +Link to the full guide - upcoming |
| 20 | + |
| 21 | +### Development |
| 22 | + |
| 23 | +During development, the container uses `dotnet watch` to enable automatic reloads when files change. The development server is started with: |
| 24 | + |
| 25 | +```sh |
| 26 | +dotnet watch --no-launch-profile |
| 27 | +``` |
| 28 | + |
| 29 | +This will: |
| 30 | +- Use `dotnet watch` to monitor for changes to .cs, .razor, and .css files and restart the server when changes are detected. |
| 31 | +- Run the Blazor Server application with hot reload enabled. |
| 32 | +- Start the app on port 5054. |
| 33 | +- Enable automatic browser refresh when Razor components or CSS files change. |
| 34 | + |
| 35 | +### Production |
| 36 | + |
| 37 | +Builds a production-ready image. During the build, dependencies are restored with `dotnet restore` and the application is published with `dotnet publish`. When the container starts, it runs: |
| 38 | + |
| 39 | +```sh |
| 40 | +dotnet component-blazor.dll |
| 41 | +``` |
| 42 | + |
| 43 | +This uses the compiled .NET application optimized for production deployment. |
| 44 | + |
| 45 | +### Data Protection |
| 46 | + |
| 47 | +The application uses ASP.NET Core Data Protection for securing authentication cookies and anti-forgery tokens. In Kubernetes deployments, data protection keys are persisted using a PersistentVolumeClaim to ensure session continuity across pod restarts. |
| 48 | + |
| 49 | +## Links |
| 50 | + |
| 51 | +- [Blazor documentation](https://docs.microsoft.com/en-us/aspnet/core/blazor/) |
| 52 | +- [ASP.NET Core documentation](https://docs.microsoft.com/en-us/aspnet/core/) |
| 53 | +- [.NET documentation](https://docs.microsoft.com/en-us/dotnet/) |
0 commit comments