Skip to content

Conversation

Phil-NHS
Copy link
Contributor

@Phil-NHS Phil-NHS commented Aug 8, 2025

NOT FOR PRODUCTION JUST TO SHARE APPROACH AND GET FEEDBACK

JIRA link

[TD-5888](https://hee-tis.atlassian.net/browse/TD-5888)
https://hee-tis.atlassian.net/wiki/spaces/TP/pages/4917985332/Some+notes+on+Blazor+and+LH+Architecture
https://hee-tis.atlassian.net/wiki/spaces/TP/pages/4939153413/LearningHub.Nhs.Shared

Description

Please ask questions, make suggestions and add feedback

Screenshots

image Clientside appsettings image image image #### server side appsetting example for configuring/locking down the bff "BFFPathValidation": { "AllowedPathPrefixes": [ "search/", "catalogue/", "Resource/GetArticleDetails", "Resource/GetAudioDetails", "Resource/GetFileTypes" ], "BlockedPathSegments": [ "Admin", "User/Delete", "Sensitive" ] }, [TD-5888]: https://hee-tis.atlassian.net/browse/TD-5888?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

@Phil-NHS Phil-NHS self-assigned this Aug 8, 2025
@Phil-NHS Phil-NHS changed the base branch from master to Develop/Feature/TD-5829-5862-Shared-Architecture-and-BFF-2 August 8, 2025 14:14
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous pr created public setting so dont worry what is added or lost its the bff end point that is relevant

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is things being pulled into shared to support searchservice

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a new and temporary file i think, but needed to move it to support search

@@ -2,7 +2,6 @@
{
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Mvc;//qqqq
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a good example of how we can easily move aspnetcore.mvc it just moves to the presentation layer the controller uses it and it should work

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All this is, is just a little helper to tidy up the repittion of registering different clients that only differ by the appsettings end point value. ... this may end up being different anyway if we look at how we httpclients across top level of solution

Logger.LogInformation($"Logger: Calling via the bff this api route: {ApiRoute}");
Logger.LogInformation("📡 Target: {TargetUrl}", "https://lh-web.dev.local/bff/lh-api.dev.local/Catalogue/GetLatestCatalogueAccessRequest/500");
// Assuming httpClient.BaseAddress is set
string fullUrl = new Uri(httpClient.BaseAddress, ApiRoute).ToString();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the base address is the bff address followed by the name of the api we wish to hit

@@ -62,7 +62,7 @@ public SearchController(
/// <param name="filterApplied">filter applied.</param>
/// <returns>The actionResult.</returns>
[HttpGet("results")]
public async Task<IActionResult> Index(SearchRequestViewModel search, bool noSortFilterError = false, bool emptyFeedbackError = false, bool filterApplied = false)
public async Task<IActionResult> Index([FromQuery] SearchRequestViewModel search, bool noSortFilterError = false, bool emptyFeedbackError = false, bool filterApplied = false)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is how we move aspnet core out of the one service earlier into the presentation service


<ItemGroup>
<None Include="compilerconfig.json" />
</ItemGroup>


<ItemGroup>
<!--For Blazor-->
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.8" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is how webui tells the client to buil the wasm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is how we make it an mvc project that can compile blazor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont worry about this, there is a nice logging component and we are stubbing it server side pretty much

@Phil-NHS Phil-NHS merged commit 15f02cf into Develop/Feature/TD-5829-5862-Shared-Architecture-and-BFF-2 Aug 13, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant