.NET 5 Applications and Class Libraries Used and Their Purpose

Blash uses a number of .NET projects in it's solution.

In addition to the Blash API and the Blazor WebAssembly application, it also uses a number of class libraries to integrate these two applications together.

We will have a look at the different .NET projects in the Blash source code, and what their purpose is.

RoundTheCode.Blash.Data

The RoundTheCode.Blash.Data assembly is a class library that mirrors the tables used in the SQL Server database as classes.

In-addition, there are some extra classes, such as DashboardModel. This class is used by the Blash API and Blazor WebAssembly application, and is used when a new dashboard is created.

The RoundTheCode.Blash.Data assembly is shared by both the Blash API and the Blazor WebAssembly application. As a result, it shares classes used by both projects, such as creating a tweet, or returning a dashboard with it's tweets.

RoundTheCode.Blash.Shared

The RoundTheCode.Blash.Shared assembly is a class library that is primary used for logging.

Blash extends the logging feature that comes with ASP.NET Core to allow for writing log files to text files.

This library is used with RoundTheCode.Blash.TwitterApi and RoundTheCode.Blash.Api, mainly to log events in background tasks, or when an exception is thrown.

RoundTheCode.Blash.TwitterApi

The integration of the Twitter API is used in the RoundTheCode.Blash.TwitterApi library.

It's a class library that performs HTTP requests to the Twitter API and returns it's response.

This request is done through the Blash API and it will wait until it gets a response. From there, the Blash API can store information in it's database, such as the dashboards available and the tweets to display.

RoundTheCode.Blash.Api

The Blash API is the central part of Blash.

Using the ASP.NET Core Web API application, it has a number of methods inside its controllers to create and delete dashboards.

In-addition, it has a number of background jobs, where it communicates with the Twitter API. These include:

  • Getting a list of rules from the Twitter API and converting them into dashboards.
  • Getting a list of recent tweets from the Twitter API and placing them in the appropriate dashboard.
  • Listening to real-time tweets from the Twitter API, based on the rules setup.

Finally, the Blash API has a SignalR hub set up. The purpose of this hub is so it can send or receive any changes that might happen with the Blazor WebAssembly application.

Examples of this might include creating a new dashboard, or receiving a real-time tweet. These sort of events need to be communicated with all clients that are using the Blazor WebAssembly application.

RoundTheCode.Blash.BlazorWasm

The Blazor WebAssembly shows the application to the user.

The user has the ability to create and delete dashboards. In-addition, the user can view the most recent tweets for these dashboards, and receive real-time tweets.

The Blazor WebAssembly application has communication with the Blash API. When it starts up, it connects to the Blash API through a SignalR connection.

In addition, when a dashboard is created, or deleted, it will call an endpoint on the Blash API to perform that task.