MFE stands for Micro Frontend. Instead of having one massive frontend layout, Open edX breaks down the UI into smaller, independent React applications (like frontend-app-learning for the course player, or frontend-app-account for user settings).
If you need to change how the platform looks or behaves for a specific feature, you will "mount" the MFE locally. This means telling the Docker container to use the code on your computer instead of its internal code.
You must have Node.js and npm installed (see 00-getting-started-prerequisites.md).
First, we need to download the React code from the OpenPecha organization on GitHub. Clone the mfes inside the tutor root directory
cd $(tutor config printroot)Example: Let's assume we want to modify the Learning app.
git clone https://github.com/OpenPecha/frontend-app-learning.gitWe never work directly on the main branch. Create a feature branch for your specific task:
cd frontend-app-learning
git checkout -b feature/my-custom-featureBefore modifying code or running it, you must install all the required Javascript packages.
npm install(If this fails, ensure you are using Node versions 16 or 18. Newer versions of Node often break MFE builds in Open edX! Use nvm use 18 and try again.)
It is good practice to push your branch up so your work is backed up remotely.
# Wait until you actually make code changes before running this:
git add .
git commit -m "Initial commit for custom feature"
git push origin feature/my-custom-featureNow we tell Tutor to use your local folder.
For most MFEs (like frontend-app-learning), you should clone them into your Tutor root directory, which you can locate with tutor config printroot.
- Navigate to the Tutor root:
cd $(tutor config printroot)
- Mount it using
./:tutor mounts add ./frontend-app-learning
Warning
Exception for frontend-app-profile (macOS Users)
Your default Tutor root on macOS is usually inside ~/Library/Application Support/tutor. The space in "Application Support" causes pip and npm errors specifically for the Profile MFE.
If you are mounting frontend-app-profile, do not move it into the Tutor root. Keep it in a workspace directory without spaces (e.g., ~/sherab-mfe/) and mount it using the absolute path:
# Do this ONLY for frontend-app-profile!
tutor mounts add ~/sherab-mfe/frontend-app-profile- Verify it was successfully mounted:
tutor mounts list
Because we changed which code the frontend uses, we must rebuild the Docker image specifically for MFEs.
tutor images build mfe --no-cacheApply everything by restarting your development server.
tutor dev restartNow, any changes you make in frontend-app-learning/src/ on your computer will show up live on your local Sherab instance!
Next Step: E-Commerce configuration is next in 04-sherab-ecommerce-setup.md.