Running Course Authoring MFE with tutor

Course authoring MFE is tagged as experimental MFE in nutemg and is expected to be available in Olive.

We are looking to gather all relative inforamtion, documenation needed to use the course author mfe.

For example, CORS setting need enable calls from MFE subdomain.
Other concenrs not known (Not inclusive list):

  • How would the URL change, is there a flag need to be enabled to (i.e simliar to LMS would readiret to learning MFE when enabled
  • What are env variables that are essetinals.

MFE github: GitHub - openedx/frontend-app-course-authoring: The micro-frontend for course authoring in Open edX. Frontend interfaces that currently live in Studio/CMS should eventually live here.

Based on latest BTR meeting, the ponit of posting here is make it available for wider community. @nedbat to ping relevant team in 2U/edX :pray:

4 Likes

After spending fair amount of time into this here is what I found is needed, to use the author mfe in production.

There are couple of settigns, config and waffle flags needed so the course author mfe can work.

First to add the MFE to config:

tutor config save --set AUTHOR_MFE_APP="{'name': 'author', 'port': 4224, 'repository': 'https://github.com/openedx/frontend-app-course-authoring'}"

Secodnly you need to apply/set the author MFE config

Env setttings

Create a file pluing to apply setting: i.e.

nano "$(tutor plugins printroot)"/author-mfe.py

Of which its content

from tutor import hooks
hooks.Filters.ENV_PATCHES.add_items([
    (
        "openedx-cms-production-settings",
"""
LOGIN_REDIRECT_WHITELIST.append("{{ MFE_HOST }}")
CORS_ORIGIN_WHITELIST.append("{% if ENABLE_HTTPS %}https://{% else %}http://{% endif %}{{ MFE_HOST }}")
CSRF_TRUSTED_ORIGINS.append("{{ MFE_HOST }}")
COURSE_AUTHORING_MICROFRONTEND_URL ="{% if ENABLE_HTTPS %}https://{% else %}http://{% endif %}{{ MFE_HOST }}/author"
"""
    ),
    (
        "cms-env-features",
"""
ENABLE_CORS_HEADERS: True
"""
    ),
])

Then enable it by tutor plugins enable tutor-mfe followed by tutor config save.

Django-admin settings

Also a waffle flag switch with name discussions.pages_and_resources_mfe need to be created, (so that sudio would redirect to the author mfe. (I suggest to do after the last step, so that you are sure the build was success before enabling it)

Build the mfe-image:

And ofcourse you would need to rebuild the mfe image by tutor images build mfe .

Refs: