Skip to content

Speaker Talks: Real World Apps with .NET 9, Blazor and NET Aspire

Eduardo Fonseca edited this page Oct 6, 2024 · 19 revisions

Introduction

In this session we will showcase some Real-World Apps developed using some of the best technologies out there:

  • .NET 9
  • Blazor
  • .NET Aspire

Why Real-World Apps?

A common approach when showcasing technologies is creating small demos showing the specific features, and that is good, however, is not always enough, since demos main focus is usually showcasing technologies and features, they tend to be very distant from what you would usually see in a production environment. The "FairPlay" category set of projects, are built under the concept of Real-World Apps, meaning, they are designed as production-ready software solutions, in fact, FairPlayTube is a platform already published in beta.

How is the "FairPlay" platform using the latest features included in .NET 9?

How is the "FairPlay" platform leveraging the huge potential of Blazor?

  • All web applications are created with Blazor
  • Re-usable components
  • Re-usable UI with MAUI Applications
  • Add static server-side rendering (SSR) pages to a globally-interactive Blazor Web App
    • Usage of @attribute [ExcludeFromInteractiveRouting]
  • Usage of HybridCache
    • Wrapped under the "CustomCache" class. Used mostly for caching of localization data and supported cultures.

All web applications are created with Blazor

By leveraging the power of Blazor, in the Web applications of the framework, we are considerably reducing the need of code duplication, since both the backend and the front-end use .NET, this means we can reuse the same model classes for both of them, instead of what the classes duplication you usually see in traditional SPAs frameworks when they use a different technology for the front-end and backend.

Re-usable components

Blazor is designed as a component-based framework, this makes it easier to reutilize UI (User Interface) elements and pages, this is especially useful when you want to speed up the development of Multi-Platform Applications by reutilizing the UI for the mobile version using MAUI.

Re-usable UI with MAUI Applications

Nowadays, when creating new platforms is usually very important to create the mobile application, in fact, many times it is also recommended to create the mobile version first, before even starting the web applications. When leveraging the power of Blazor combined with MAUI, you can do both. While it is recommended to do the mobile version first, it is also known that the deployment to the stores can take some time due to the approval process of each App Store, the deployment of web applications however, is way faster.

How is the "FairPlay" platform leveraging the huge potential of .NET Aspire?

  • Multiple apps under the same .NET Aspire solution.
  • Centralized configuration, the secrets.json file for the AppHost.
  • Instant access to Open-Telemetry.
  • Deployment of Custom Integration / Resources. See AzureVideoIndexerResourceExtensions.cs file
  • Deploy a local email testing solution: MailDev
  • Ability to deploy all solutions under a single Azure Resource Group or one application per Resource Group.

Multiple apps under the same .NET Aspire solution

.NET Aspire is a framework which allows you to easily build production-ready distributed, cloud-ready applications. It facilitates orchestration of applications and the communication among them. In this platform, we are using .NET Aspire as a tool to centralize configuration, as well as to select which projects to start when in development environment, and which projects to deploy together.

Instant access to Open-Telemetry

.NET Aspire comes with an integrated out-of-the box Dashboard, which allows you to monitor many details of your running apps, making it way easier to instantly detect the cause of errors as well as performance issues, it even allows you to see details of the queries sent to the database. The best of it is that, when you deploy the .NET Aspire solution, you have access to the same Dashboard for your production apps!

Ability to deploy all solutions under a single Azure Resource Group or one application per Resource Group

One of the goals in the FairPlay platform is have the ability to quickly deploy artifacts under the same Azure Resource Group, making it way easier to deploy your application suite into the Azure Market Place. The platform uses configuration-based boolean flags to allows you decide which applications to run and deploy.

Resources page

This page allows you to see all of the resources which are part of your solution. You can see important information such as their name, status, start time, source (projects location when in development mode), and endpoints.

Console Logs page

This page allows you to see all of the information sent to the logs, .NET Aspire components and integrations already have some out-of-the box information.

Structured Logs page

Traces page

Metrics page

Clone this wiki locally