Vatsal Shah
Feb 21 · 3 min read

We have an HR Management Product NeoHRM and wanted to build a feature that captures the culture of the firm and helps build community around knowledge management related to core DNA of the firm through Q&A.

Further the idea was to measure the participation of employees into the knowledge management process and identify people who advance the capabilities of the firm with their problem solving approach. We were considering open source forums, since focus of our value was in measuring the interactions and establishing a feedback loop to the employee, so third party product with custom measurement index would suffice.

Design Challenge :

Embed open source product product developed with Ruby on Rails into our React application.

The EXISTING system design:

  • Open source product is hosted as a sub-domain
  • User logs into the HRM management product.
  • Navigates to the UI to find himself landing into the discussion panel as a completely new link.

Problems with this approach:

  • Multiple redirects for user tokens between both the products which increased the loading time and had a bad user experience. Need to reduce loading time of screens.
  • Between these redirections user sees a blank screen and has no clue about whats going on. Remove screen transition gaps for better user experience.

The PROPOSED system design:

Constraints:

  • Both the products should be hosted under the same domain.
  • No code integration. Interaction between both products will happen through event and data exchanges.
  • The open source product is hosted in a docker on independent EC2 instance

What are we solving for:

  • Combining two products as one through a micro front end approach
  • Faster and seamless interactions between wrapper and embedded product
  • Designing Event bus to communicate across micro front ends.

How we solved the problems:

Problem no. 1 : The micro front end approach

iFrames to render embedded product:

Product Screenshot on left where section highlighted will embed the UI on the right as a micro front end. The problem with embedding this micro frontend was we had 2 headers, one of each product. It was decided to hide the wrapper header and show those options in the left navigation when the micro frontend is embedded.

Steps to follow:

1. Read the current Route(URL)

2. Based on the route(URL) of the page, when it matches with the micro frontend specific link, the wrapper header is not shown and the UI is altered to show the header options is left navigation

On the left is the wrapper product screenshot showing are which will embed the micro frontend(Right Image)

Problem no. 2: The loading time

Convert redirects to XHR request:

These redirects can simply be converted to XHR requests to get the user token and then the final link is opened in the embedded micro frontend using iframe.

In our case since both the products are hosted under the same domain so CORS issues are not to be tackled.

Problem no. 3: Designing Event bus to communicate across micro front ends.

Both the wrapper and the micro frontend had to communicate based on events and exchange data.

For two way communication between the wrapper and micro frontend, REST APIs and Webhooks are used.

1. Micro frontend REST APIs are used to send data from the wrapper product. List of APIs here.

2. Web Hooks are setup in the micro product which are triggered for different types of events. Link to setup Webhooks.

Prodio DesignWorks

A product design firm that makes good products. Saves founder asses from bad strategy. Doesn’t behave like a tech vendor. Behaves like a tech co-founder. Tells it like it is. Unscrews you.

Vatsal Shah

Written by

Prodio DesignWorks

A product design firm that makes good products. Saves founder asses from bad strategy. Doesn’t behave like a tech vendor. Behaves like a tech co-founder. Tells it like it is. Unscrews you.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade