Learning is a frontend-base app: a library that a site plugs into the Open
edX frontend shell, not a standalone micro-frontend with its own webpack build.
It is published to NPM as @openedx/frontend-app-learning.
This app renders the learner-facing pages of a course: the course home and its outline, the dates, progress and live tabs, and the courseware itself, where learners work through units.
This app is published to NPM by semantic-release. Its branches follow
OEP-10 ADR 0002:
master- Unstable. Every merge publishes a prerelease, which goes out on the
latestdist-tag untilstablefirst publishes. Breaking changes land here with no DEPR process and no warning, so it is not supported in production. All changes, including bug fixes, should target this branch first. stable- Will carry the newest stable major and own the
latestdist-tag. It is cut, but has not published yet. n.xandn.m.x- Maintenance branches for majors and minors that
stablehas moved past. Each owns the dist-tag matching its own name.
The first release is 1.0.0-alpha.1, on the latest dist-tag. Both
.releaserc and the Release CI workflow already know the whole layout,
so a new line starts publishing as soon as its branch is pushed.
This repository is no longer branched or tagged for Open edX releases in its own right. It participates by published version instead, per OEP-10 ADR 0003.
The legacy micro-frontend lives on in the legacy-mfe branch, cut from the last commit before this conversion. Open edX releases that still ship the micro-frontend are cut from there.
A running Open edX instance serves this app's backend APIs. Tutor in
development mode is the usual choice, and site.config.dev.tsx already
points at its default hostnames.
Clone the repo:
git clone https://github.com/openedx/frontend-app-learning.gitUse the version of Node specified in the
.nvmrcfile.Other major versions of Node may work, but they are unsupported. The
.nvmrcfile helps set the right version via nvm.Install npm dependencies:
cd frontend-app-learning && npm ciStart the dev server:
npm run dev
The dev server runs with PORT=2000 PUBLIC_PATH=/learning (set in the
dev script in package.json) and is available at
http://apps.local.openedx.io:2000/learning.
It uses the site defined in site.config.dev.tsx.
To develop this app and a local checkout of frontend-base together, use the
built-in npm workspace support:
mkdir -p packages/frontend-base
sudo mount --bind /path/to/frontend-base packages/frontend-base
npm install
npm run dev:packagesBind mounts are used instead of symlinks because Node resolves symlinks to
their real paths, which breaks hoisted dependency resolution. When you are
done, unmount with sudo umount packages/frontend-base.
A site adds Learning by importing learningApp and listing it in its site
config's apps, next to the shell, header and footer apps.
site.config.dev.tsx in this repository is a complete example:
import { learningApp } from '@openedx/frontend-app-learning';
const siteConfig: SiteConfig = {
// ...
apps: [
shellApp,
headerApp,
footerApp,
learningApp,
],
};Sites that build their own route tree can use the exported learningRoutes
instead.
This app is not configured by build-time environment variables any more. It
reads its settings from app config. A site sets them in commonAppConfig,
which applies to every app on the site, or in the app's own config, which
wins:
apps: [
// ...
{ ...learningApp, config: { SUPPORT_URL: 'https://support.example.com' } },
],These are the keys Learning reads. All are unset by default, except
SHOW_UNGRADED_ASSIGNMENT_PROGRESS, which is false. Where a URL is
unset, the link it feeds is left out.
CONTACT_URLCREDENTIALS_BASE_URLCREDIT_HELP_LINK_URLDISCOUNT_CODE_INFO_URLDISCOVERY_API_BASE_URLECOMMERCE_BASE_URLENABLE_NOTICESENTERPRISE_LEARNER_PORTAL_URLEXAMS_BASE_URLLEGACY_THEME_NAMEMARKETING_SITE_BASE_URLPROCTORED_EXAM_FAQ_URLPROCTORED_EXAM_RULES_URLSESSION_COOKIE_DOMAINSHOW_UNGRADED_ASSIGNMENT_PROGRESSSOCIAL_UTM_MILESTONE_CAMPAIGNSUPPORT_URLSUPPORT_URL_CALCULATOR_MATHSUPPORT_URL_ID_VERIFICATIONSUPPORT_URL_VERIFIED_CERTIFICATETERMS_OF_SERVICE_URLTWITTER_HASHTAGTWITTER_URL
Learning does not take other apps' URLs as config keys. It links to them by
route role, such as org.openedx.frontend.role.dashboard or
org.openedx.frontend.role.profile (the full list is in
src/constants.ts). A role resolves to an installed app's route, or to an
entry in the site config's externalRoutes. site.config.dev.tsx declares
them as external routes, at the addresses Tutor's development mode uses.
Learning offers slots that sites use to change its pages, and ships widgets that sites can add to its slots or render elsewhere. See:
- src/slots/README.md for the slots, with a README and examples for each.
- src/widgets/README.md for the widgets.
The layout follows the standard frontend-base app layout:
src/app.ts: the app definition imported bysite.config.*.tsx.src/constants.ts: the app'sappIdand route roles.src/index.ts: the package's public exports.src/routes.tsx: the app's routes.src/Main.tsx: the root component for the app's routes.src/slots.tsx: the slot operations this app registers: its widgets in the shell's header and course bar, and its tabs in its own tab slots.src/slots/: the slots this app offers.src/widgets/: the widgets this app ships.src/style.scss: the app's styles.
npm run build compiles the library into dist/ with tsc and
tsc-alias, and copies the SCSS and asset files across. This is what gets
published and what sites consume.
npm run build:ci runs openedx build against site.config.ci.tsx, so
webpack goes through the whole app. It catches problems, such as broken
lazy-loaded imports or stylesheets, that tsc and Jest do not.
See the frontend-base i18n how-to.
If you're having trouble, we have discussion forums where you can connect with others in the community.
Our real-time conversations are on Slack. You can request a Slack invitation, then join our community Slack workspace. Because this is a frontend repository, the best place to discuss it would be in the #wg-frontend channel.
For anything non-trivial, the best path is to open an issue in this repository with as many details about the issue you are facing as you can provide.
https://github.com/openedx/frontend-app-learning/issues
For more information about these options, see the Getting Help page.
Contributions are very welcome. Please read How To Contribute for details.
This project is currently accepting all types of contributions, bug fixes, security fixes, maintenance work, or new features. However, please make sure to discuss your new feature idea with the maintainers before beginning development to maximize the chances of your change being accepted. You can start a conversation by creating a new issue on this repo summarizing your idea.
Note that contributions are expected to follow the Open edX AI Contribution Policy.
All community members are expected to follow the Open edX Code of Conduct.
The code in this repository is licensed under the AGPLv3 unless otherwise noted.
Please see LICENSE for details.
Please do not report security issues in public. Please email security@openedx.org.