Skip to content
Demos and sample for my "Designing a UI for Microservices" talk
C# HTML Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ASP.Net Core API Gateway - 01
ASP.Net Core API Gateway - 02
ASP.Net Mvc Core UI Composition
ASP.Net Mvc Core Bump Microsoft.CSharp from 4.5.0 to 4.6.0 in /ASP.Net Mvc Core Nov 11, 2019
shared/JsonUtils
targets Improve build process Jan 8, 2019
.gitattributes
.gitignore
Build.cmd
LICENSE
README.md
appveyor.yml
postman-collection.json update postman collection to remove action from url May 6, 2019

README.md

Designing a UI for Microservices - Demos

This repository contains all the demos run during the Designing a UI for Microservices talk.

ViewModel Composition is deeply discussed on my blog in the ViewModel Composition category.

Requirements

ASP.Net Core API Gateway - demos

The ASP.Net Core API Gateway, 01 and 02, solution demos ViewModel Composition techniques built on top of .Net Core.

CompositionGateway

CompositionGateway project shows how to create and host a .Net Core API Gateway, or reverse proxy, that composes HTTP requests to multiple API backends.

To run this sample ensure that the following projects are set as startup projects:

  • Sales.Api
  • Shipping.Api
  • Warehouse.Api
  • Catalog.Api
  • CompositionGateway

As client to test the funzionality a REST client such as Postman can be used.

  • ASP.Net Core API Gateway - 01 demoes how single items composition works
  • ASP.Net Core API Gateway - 02 demoes how single items and items list composition works

The postman-collection.json file can be imported into Postman, creating a collection with all the HTTP requests needed to test both demos.

ASP.Net Mvc Core - Demo

WebApp project is a .Net Core Mvc app that composes HTTP requests to multiple backends directly in Mvc Views as Controllers are invoked. This demo implements ViewModel Composition concepts introducing the concept of Branding as a contract at the UI level.

To run this sample ensure that the following projects are set as startup projects:

  • Sales.Api
  • Shipping.Api
  • Warehouse.Api
  • Catalog.Api
  • WebApp

ASP.Net Mvc Core UI Composition - Demo

WebApp project is a .Net Core Mvc app that composes HTTP requests to multiple backends directly in Mvc Views as Controllers are invoked. This demo implements ViewModel Composition and UI Composition concepts.

To run this sample ensure that the following projects are set as startup projects:

  • Sales.Api
  • Shipping.Api
  • Warehouse.Api
  • Catalog.Api
  • WebApp

Note

To simplify as much as possible the sample, frontend applications, such as CompositionGateway and WebApp, directly reference ViewModel Composition and UI Composition assemblies. This allows also to avoid the usage of Visual Studio post build events, that at the time of this writing are affected by a bug when used in combination with .NET Core, causing events variable to not be populated as expected.

A workaround is to use a MSBuild Exec task to simulate post build events. E.g. in order to try to run samples removing all hard-coded references:

  1. Remove references to composition assemblies from CompositionGateway and WebApp project(s)
  2. Edit the project file of composition assemblies that need to be copied to CompositionGateway and WebApp output folders by adding the following to each of them:
  <Target Name="PostBuild" AfterTargets="PostBuildEvent">
    <Exec Command="
     copy &quot;$(TargetDir)$(TargetName).dll&quot; &quot;$(SolutionDir)CompositionGateway\$(OutDir)$(TargetName).dll&quot; /Y /B
     copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)CompositionGateway\$(OutDir)$(TargetName).pdb&quot; /Y /B" />
  </Target>

Replacing CompositionGateway with WebApp for the last 2 demos.

NOTE:

  • All solutions are configured to use the SwitchStartupProject Visual Studio Extension to manage startup projects. The extension is not a requirement, but it's comfortable.
You can’t perform that action at this time.