Skip to content

ProReception/ProReception.DistributionServerInfrastructure

Repository files navigation

Pro Reception Distribution Server Infrastructure

Helper library with common infrastructure code for our distributed apps

Status

GitHub Workflow Status (with branch) Nuget

How to use

  1. Install via NuGet: Install-Package ProReception.DistributionServerInfrastructure
  2. Add custom settings:
    • Create new class for storing your settings, which inherits from BaseSettings
      using DistributionServerInfrastructure.Settings.Models;
      
      public class MySettings : BaseSettings
      {
      }
    • Create new ISettingsManager interface, which inherits from ISettingsManagerBase
      using DistributionServerInfrastructure.Settings;
      
      public interface ISettingsManager : ISettingsManagerBase
      {
      }
    • Create new SettingsManager class, which inherits from SettingsManagerBase and implements ISettingsManager
      using DistributionServerInfrastructure.Settings;
      
      public class SettingsManager : SettingsManagerBase<MySettings>, ISettingsManager
      {
          public SettingsManager(string appName, string cryptKey, string authKey) : base(appName, cryptKey, authKey)
          {
          }
      }
  3. In your Program.cs file, create a new instance of your SettingsManager class, and add the infrastructure configuration
    var settingsManager = new SettingsManager(
        "My App Name",
        "some crypt key",
        "some auth key");
    
    builder.AddProReceptionDistributionServerInfrastructure<ISettingsManager, SettingsManager>(settingsManager);
  4. Use the infrastructure config after building the app:
    app.UseProReceptionDistributionServerInfrastructure();

Configuration

These are the expected configuration values.

Pro Reception API

There has to be a section in the configuration called ProReceptionApi:

{
  "ProReceptionApi": {
    "BaseUrl": "https://localhost:7016"
  }
}

Components

The components can be used inside your Razor views.

Pro Reception login component

@using ProReception.DistributionServerInfrastructure.Components

<ProReceptionConnection />

Logs component

@using ProReception.DistributionServerInfrastructure.Components

<Logs />

MudBlazor

There is an issue when using MudBlazor from an app running as a Windows Service. See my question on StackOverflow here.

So, my work around is to host the MudBlazor CSS and JS files on Azure storage, and load them from there. This means that every time I update the MudBlazor library, I also need to add the new CSS and JS files to the Azure storage.

To get the CSS and JS files for a specific version, I create a new app, and then copy the files when the app is running.

dotnet new install MudBlazor.Templates
mkdir -p mud-test/MyApplication
dotnet new mudblazor --interactivity Server --name MyApplication --all-interactive --output mud-test/MyApplication
dotnet new sln -n MyApp -o mud-test
dotnet sln mud-test/MyApp.sln add mud-test/MyApplication/MyApplication.csproj

About

Helper library with common infrastructure code for our distributed apps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •