overhangio / tutor-mfe

This plugin makes it possible to easily add micro frontend (MFE) applications on top of an Open edX platform that runs with Tutor.
GNU Affero General Public License v3.0
22 stars 95 forks source link

Custom host for MFEs #133

Closed vunguyen-dmt closed 1 year ago

vunguyen-dmt commented 1 year ago

MFEs are now available at http(s)://{{ MFE_HOST }}/{{MFE_NAME}} and it can not be customized. Could we add "host" to the configuration, something like:

{
      "repository": "https://github.com/myorg/mymfe",
      "port": 2001,
      "version": "me/my-custom-branch",
      **"host': "mymfe.edx.org"** // or something dynamic like mymfe.{{ MFE_HOST }}
}

This could help make the URL shorter, more friendly and more flexible. for example, the new learner dashboard mfe could be accessed at home.edx.org instead of apps.courses.edx.org/home

This is just my personal opinion for an enhancement, feel free to close if it's not useful or technically not possible.

regisb commented 1 year ago

This should be achievable via a custom plugin. You will need to modify the right LMS/CMS settings to point to the right learner dashboard url. You will also need to configure Caddy (the web proxy) to catch requests sent to your custom host. But I'm not prepared to introduce this new setting for all users, as it would be too difficult to manage all edge cases. For instance, we would need to check that no two MFEs share the same host.

That being said, recently I've also questioned our initial assumption that MFEs should be served from a separate, dedicated domain name. We could just as well serve them from the LMS domain name, for instance: mylms.org/a/home, mylms.org/a/authn, etc. Heck, I've even thought about copying MFE static assets to the openedx container, and serve them from there. After all, MFEs are now a mandatory part of Open edX, so does it even make sense to keep them in a separate optional plugin?

Of course all of this would require some large non-backward compatible changes, and we are too soon after the Palm release to release them now. Just wanted to mention these thoughts. @arbrandes FYI.

I'm going to close this issue for now, but we can discuss this further on the forum if you're interested @vunguyen-dmt.