@@ -21,50 +21,82 @@ Getting Started
21
21
Prerequisites
22
22
=============
23
23
24
- The `devstack `_ is currently recommended as a development environment for your
25
- new MFE. If you start it with ``make dev.up.lms `` that should give you
26
- everything you need as a companion to this frontend.
27
-
28
- Note that it is also possible to use `Tutor `_ to develop an MFE. You can refer
29
- to the `relevant tutor-mfe documentation `_ to get started using it.
30
-
31
- .. _Devstack : https://github.com/openedx/devstack
24
+ `Tutor `_ is currently recommended as a development environment for the Learning
25
+ MFE. Most likely, it already has this MFE configured; however, you'll need to
26
+ make some changes in order to run it in development mode. You can refer
27
+ to the `relevant tutor-mfe documentation `_ for details, or follow the quick
28
+ guide below.
32
29
33
30
.. _Tutor : https://github.com/overhangio/tutor
34
31
35
32
.. _relevant tutor-mfe documentation : https://github.com/overhangio/tutor-mfe#mfe-development
36
33
37
- To use this application, `devstack <https://github.com/openedx/devstack >`__ must be running and you must be logged into it.
38
-
39
- - 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.
40
34
41
- Cloning and Startup
42
- ===================
35
+ Cloning and Setup
36
+ =================
43
37
44
38
1. Clone your new repo:
45
39
46
40
.. code-block :: bash
47
41
48
42
git clone https://github.com/openedx/frontend-app-learning.git
49
43
50
- 2. Use node v18 .x.
44
+ 2. Use node v20 .x.
51
45
52
46
The current version of the micro-frontend build scripts supports node 18.
53
47
Using other major versions of node *may * work, but this is unsupported. For
54
48
convenience, this repository includes an ``.nvmrc `` file to help in setting the
55
49
correct node version via `nvm <https://github.com/nvm-sh/nvm >`_.
56
50
57
- 3. Install npm dependencies:
51
+ 3. Stop the Tutor devstack, if it's running: ``tutor dev stop ``
52
+
53
+ 4. Next, we need to tell Tutor that we're going to be running this repo in
54
+ development mode, and it should be excluded from the ``mfe `` container that
55
+ otherwise runs every MFE. Run this:
56
+
57
+ .. code-block :: bash
58
+
59
+ tutor mounts add /path/to/frontend-app-learning
60
+
61
+ 5. Start Tutor in development mode. This command will start the LMS and Studio,
62
+ and other required MFEs like ``authn `` and ``account ``, but will not start
63
+ the learning MFE, which we're going to run on the host instead of in a
64
+ container managed by Tutor. Run:
65
+
66
+ .. code-block :: bash
67
+
68
+ tutor dev start lms cms mfe
69
+
70
+ Startup
71
+ =======
72
+
73
+ 1. Install npm dependencies:
58
74
59
75
.. code-block :: bash
60
76
61
77
cd frontend-app-learning && npm ci
62
78
63
- 4. Start the dev server:
79
+ 2. Start the dev server:
80
+
81
+ .. code-block :: bash
82
+
83
+ npm run dev
84
+
85
+ Then you can access the app at http://local.openedx.io:2000/learning/
86
+
87
+ Troubleshooting
88
+ ---------------
89
+
90
+ If you see an "Invalid Host header" error, then you're probably using a different domain name for your devstack such as
91
+ ``local.edly.io `` or ``local.overhang.io `` (not the new recommended default, ``local.openedx.io ``). In that case, run
92
+ these commands to update your devstack's domain names:
64
93
65
94
.. code-block :: bash
66
95
67
- npm start
96
+ tutor dev stop
97
+ tutor config save --set LMS_HOST=local.openedx.io --set CMS_HOST=studio.local.openedx.io
98
+ tutor dev launch -I --skip-build
99
+ tutor dev stop learning # We will run this MFE on the host
68
100
69
101
Local module development
70
102
=========================
0 commit comments