Derex Plugin to integrate Open edX Profile Microfrontend
-
Install this package inside a derex project environment
-
Add to the project derex.config.yaml
plugins: derex.mfe_profile: {}
-
From the LMS Django Admin, create a
SiteConfigurationfor your domain and set theENABLE_PROFILE_MICROFRONTENDtotrue
There are some options that can be passed to the plugin configuration in your derex.config.yaml file.
-
docker_image: Then tag which will be given to the built docker image
-
build_dir: An optional build directory which content will be included in the build context. Some files will you'll probably want to include here:
.env.derex.j2and.env.development.derex.j2files- a
Caddyfile - a
Dockerfile.j2Jinja template which will compiled and used for the build - the whole microfrontend repository. This is especially useful when doing local development
- any additinal file you might need in your build.
.j2files will be compiled with the derexProjectobject in the context
If
.env.derex.j2,.env.development.derex.j2,CaddyfileandDockerfile.j2are not present default one will be used. -
aliases: Additional network aliases for the docker container. This list will also be used to populate the
CORS_ORIGIN_WHITELISTandLOGIN_REDIRECT_WHITELISTLMS settings -
NODE_VERSION: The node version which will be given as a build argument
-
MFE_REPOSITORY: A repository URL which will be given as a build argument or a path to a local repository in the
build_dir -
MFE_BRANCH: A Git branch which will be checked out after cloning the Microfrontend repository
e.g.:
plugins:
derex.mfe-profile:
{
"build_dir": "mfe_profile_build",
"docker_image": "my-custom-image-name",
"aliases": [
"profile.mydomain.com",
]
"MFE_REPOSITORY": "https://github.com/edx/frontend-app-profile.git",
"MFE_BRANCH": "open-release/lilac.master",
"NODE_VERSION": "12-alpine",
}You can build the microfrontend image by running:
derex build mfe-profile
-
Install direnv
-
Allow direnv to create the virtualenv
direnv allow
-
Install with pip
pip install -r requirements_dev.txt pre-commit install --install-hooks