How to create and integrate my custom Django REST app to Tutor

Hi everyone,

I am a newbie and trying to write my custom Django REST application. I have conducted some research and came across this discussion: How to integrate an independent application as a plugin into Tutor.

In summary, these are the steps that I understand:

Step 1: Build your own Django application using this template: GitHub - openedx/edx-cookiecutters: Open edx public templates for apps, libraries and services. (I assume using the IDA). For example: GitHub - openedx/ecommerce: Service for managing edX's product catalog and handling orders for those products.

Step 2: Follow this plugin template to integrate both my Django app (BE) and the custom React mfe (FE): GitHub - overhangio/cookiecutter-tutor-plugin: Cookiecutter for tutor plugins. For example: GitHub1s.

If these steps are correct, I have some questions:

  1. I want to create simple BE and FE custom apps that communicate with each other when I turn on my local Docker. However, the examples have complex configurations (Docker, Caddy) that are challenging for a newbie like me to follow. Are there any simpler examples or documentation available?
  2. How do I set up the codebase for development? Specifically, if I want to rebuild the FE and BE when I make a code change and need to test the new changes, how can I do that?
  3. In the examples, the BE endpoint is hidden, as shown below:

    The URL on line 30 is from @edx/frontend-platform. If I want to make it simpler to run on my local Docker, how can I configure the BE to expose itself, for example, on localhost:2333?

Any help is valuable to me. Thanks in advance.

1 Like

Can anyone solve these issues?

  1. If your backend app is not too complicated, it would be much simpler to develop it as a Django App Plugin rather than an IDA. As a django app plugin, it runs as part of the LMS and you don’t have to set up Caddy, or Docker, or do anything special other than make sure your plugin is installed into the LMS. And you can do pretty much all the same things an IDA can do. So I’d recommend you start with that. Later, if you need to, you can separate it from the LMS and make it into an independent application.

To create a new FE/MFE, use frontend-template-application and follow the instructions for configuring it to work with Tutor.

  1. If you set things up as a Django app plugin and follow the MFE template, you should have automatic reloading. Whenever you make any change, it will automatically restart/rebuild as needed. Just refresh the browser if necessary.

  2. There is no issue with this if you run it within the LMS, just access it the same way as the LMS (same host, port, and auth).

2 Likes

Thank you so much. I’ll try