README.rst 5.01 KB
Newer Older
1
|codecov| |license|
Douglas Hall's avatar
Douglas Hall committed
2

3
frontend-app-learning
Douglas Hall's avatar
Douglas Hall committed
4
5
6
7
8
=========================

Introduction
------------

9
10
11
12
13
This is the Learning MFE (micro-frontend application), which renders all
learner-facing course pages (like the course outline, the progress page,
actual course content, etc).

Please tag **@edx/engage-squad** on any PRs or issues.  Thanks.
Douglas Hall's avatar
Douglas Hall committed
14

15
16
17
18
.. |codecov| image:: https://codecov.io/gh/edx/frontend-app-learning/branch/master/graph/badge.svg?token=3z7XvuzTq3
   :target: https://codecov.io/gh/edx/frontend-app-learning
.. |license| image:: https://img.shields.io/badge/license-AGPL-informational
   :target: https://github.com/edx/frontend-app-account/blob/master/LICENSE
David Joy's avatar
David Joy committed
19
20
21
22
23
24
25

Development
-----------

Start Devstack
^^^^^^^^^^^^^^

26
To use this application, `devstack <https://github.com/edx/devstack>`__ must be running and you must be logged into it.
David Joy's avatar
David Joy committed
27

28
29
- Run ``make dev.up.lms``
- Visit http://localhost:2000/course/course-v1:edX+DemoX+Demo_Course to view the demo course.  You can replace ``course-v1:edX+DemoX+Demo_Course`` with a different course key.
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

Local module development
^^^^^^^^^^^^^^^^^^^^^^^^

To develop locally on modules that are installed into this app, you'll need to create a ``module.config.js``
file (which is git-ignored) that defines where to find your local modules, for instance::

   module.exports = {
     /*
     Modules you want to use from local source code.  Adding a module here means that when this app
     runs its build, it'll resolve the source from peer directories of this app.

     moduleName: the name you use to import code from the module.
     dir: The relative path to the module's source code.
     dist: The sub-directory of the source code where it puts its build artifact.  Often "dist", though you
       may want to use "src" if the module installs React as a peer/dev dependency.
     */
     localModules: [
        { moduleName: '@edx/paragon/scss', dir: '../paragon', dist: 'scss' },
        { moduleName: '@edx/paragon', dir: '../paragon', dist: 'dist' },
        { moduleName: '@edx/frontend-enterprise', dir: '../frontend-enterprise', dist: 'src' },
        { moduleName: '@edx/frontend-platform', dir: '../frontend-platform', dist: 'dist' },
     ],
   };

See https://github.com/edx/frontend-build#local-module-configuration-for-webpack for more details.
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

Deployment
----------

The Learning MFE is similar to all the other Open edX MFEs. Read the Open
edX Developer Guide's section on
`MFE applications <https://edx.readthedocs.io/projects/edx-developer-docs/en/latest/developers_guide/micro_frontends_in_open_edx.html>`_.

Environment Variables
^^^^^^^^^^^^^^^^^^^^^

This MFE is configured via environment variables supplied at build time.
All micro-frontends have a shared set of required environment variables,
as documented in the Open edX Developer Guide under
`Required Environment Variables <https://edx.readthedocs.io/projects/edx-developer-docs/en/latest/developers_guide/micro_frontends_in_open_edx.html#required-environment-variables>`_.

The learning micro-frontend also supports the following additional variables:

74
75
76
77
78
79
80
81
82
CREDIT_HELP_LINK_URL
  A link to resources to help explain what course credit is and how to earn it.

ENABLE_JUMPNAV
  Enables the new Jump Navigation feature in the course breadcrumbs, defaulted to  the string 'true'.
  Disable to have simple hyperlinks for breadcrumbs. Setting it to any other value but 'true' ('false','I love flags', 'etc' would disable the Jumpnav).
  This feature flag is slated to be removed as jumpnav becomes default. Follow the progress of this ticket here:
  https://openedx.atlassian.net/browse/TNL-8678

83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
SOCIAL_UTM_MILESTONE_CAMPAIGN
  This value is passed as the ``utm_campaign`` parameter for social-share
  links when celebrating learning milestones in the course. Optional.

  Example: ``milestone``

SUPPORT_URL_CALCULATOR_MATH
  A link that explains how to use the in-course calculator. You can use the
  one in the example below, if you don't want to have your own branded version.

  Example: https://support.edx.org/hc/en-us/articles/360000038428-Entering-math-expressions-in-assignments-or-the-calculator

SUPPORT_URL_ID_VERIFICATION
  A link that explains how to verify your ID. Shown in contexts where you need
  to verify yourself to earn a certificate. The example link below is probably too
  edx.org-specific to use for your own site.

  Example: https://support.edx.org/hc/en-us/articles/206503858-How-do-I-verify-my-identity

SUPPORT_URL_VERIFIED_CERTIFICATE
  A link that explains what a verified certificate is.  You can use the
  one in the example below, if you don't want to have your own branded version.
  Optional.

  Example: https://support.edx.org/hc/en-us/articles/206502008-What-is-a-verified-certificate

TWITTER_HASHTAG
  This value is used in the Twitter social-share link when celebrating learning
  milestones in the course. Will prefill the suggested post with this hashtag.
  Optional.

  Example: ``brandedhashtag``

TWITTER_URL
  A link to your Twitter account. The Twitter social-share link won't appear
  unless this is set. Optional.

  Example: https://twitter.com/edXOnline
121