❓ Question for Open edX Community – Clarifying Use of tutor-project Directory in Custom Plugin & MFE Development

Hi everyone,

I’m working on customizing the registration flow using a custom plugin (custom-registration-fields) and modifying the frontend-app-authn MFE. I noticed that I’ve been doing all my development and Tutor commands outside the tutor-project directory, specifically in:

ruby

CopyEdit

~/.local/share/tutor-plugins/

I also have a tutor-project directory provided by my mentor, which includes:

arduino

CopyEdit

tutor-project/
├── config.yml
├── env/

But so far, I haven’t been using this directory actively. My questions are:

  1. What is the correct use-case or best practice for using the tutor-project directory?
  2. If I already made changes to .local/share/tutor-plugins/, should I migrate them into tutor-project?
  3. Could working outside the tutor-project directory be the reason I’m facing CORS issues and plugin override issues (like MFE changes not reflecting during npm start)?

I want to make sure I’m following a production-friendly, scalable setup as expected in a team project. Any clarity or advice would be appreciated.

Thanks in advance!

@sravan123 could you please indicate which Tutor version you’re using in your posts?

@arbrandes do you have any advice here?

I assume that tutor-project is your Tutor environment’s root directory. If that is indeed the case, you should not be working directly in it, opting instead to using tutor commands or plugins to modify its state.

With that in mind, you’ve been doing the right thing by developing plugins in ./local/share/tutor-plugins, which is the default directory for them.

The above should answer questions 1 and 2. As for 3, no, working outside the Tutor root should not be the reason why you’re seeing CORS or plugin override issues.

CORS issues, particularly in a dev enviroment, suggest you’re working with a new or customized MFE on a non-standard port that makes requests to the LMS. If that is the case, you need to modify your custom MFE’s Tutor plugin to include something like the following, substituting 8080 for your MFE’s actual port:

from tutormfe.hooks import MFE_APPS, MFE_ATTRS_TYPE

from tutor import hooks

hooks.Filters.ENV_PATCHES.add_item(
  (
    "openedx-lms-development-settings",
    """
CORS_ORIGIN_WHITELIST.append("http://{{ MFE_HOST }}:8080")
LOGIN_REDIRECT_WHITELIST.append("http://{{ MFE_HOST }}:8080")
CSRF_TRUSTED_ORIGINS.append("http://{{ MFE_HOST }}:8080")
"""
    )
)

Finally, plugin override issues could happen for many, many reasons. It’s difficult to assist without more details. For example:

  • What release of Open edX are you running?
  • Does following the example for using a plugin slot in the tutor-mfe README to the letter work?
  • What plugin slot are you trying to use? In what MFE?

Hey thank you for your response Mr.Arbandes

At First I used
Tutor version - 18.0.4
python 3.8
ubuntu VM - 20.04
opened version - indigo

Realized MFE is not working in this version decided to update

Now we are planning to change tutor version which supports
python 3.10
ubuntu VM -22.04
opened Version - redwood

Our intention is to customize our registration page by adding two dynamic fields like phone_number and skills.(first task) - (frontend-app-authn)
Customize learners dashboards and all possible customization
And we are trying to integrate ai application into it (next task)

My questions are

1. MFE support in ubuntu 20.04(os) && indigo version (openedx) ?
2. Steps to install openedx REDWOOD version through RDP
3. MFE supporting ports ? Why those core issues happening ?
4. How to create development environment for each MFE(frontend-app-authn,dashboards…) ? Could you please provide proper steps for that ?
5. Should i use global directories created by tutor by defaualt or local directories

Where possible I would always recommend using the latest release as we only support one release at a time. On Monday, Teak (tutor v20) will be released, so v18 will be two releases behind. Could you use v19 or even wait a few days to try out v20? Then you will have the latest release, with the newest features and security fixes.

Hey then if i am using sumac version, if version suddenly changed is that possible to change our version to this new one without losing data’s ? .

Yes, you can upgrade from one release to the next without losing data, as per the Tutor documentation. You just have to make sure to run tutor local launch again after upgrading the Tutor packages.