Skip to content

RapidPro Dev Mode

Nic Pottier edited this page Feb 8, 2021 · 2 revisions

Running the flow editor in dev mode for RapidPro is possible but requires some specific settings. You will need to run nginx as a proxy.

Configured nginx as follows (rapidpro.conf):

upstream mailroom {
  server localhost:8090 max_fails=0;
}

upstream courier {
  server localhost:8080 max_fails=0;
}

upstream rapidpro {
  server localhost:8000 max_fails=0;
}

upstream floweditor {
  server localhost:3000 max_fails=0;
}

server {
  listen 8888;

  location ~ /mr/ {
    proxy_pass http://mailroom;
  }

  location ~ /c/ {
    proxy_pass http://courier;
  }

  location ^~ /static/media {
    proxy_pass http://floweditor;
  }

  location ~ /asset-manifest\.json|sockjs|.*webpack|dev/(.*) {
    proxy_pass http://floweditor/$1;
  }

  location ~ /.+ {
    add_header Access-Control-Allow-Origin *;
    proxy_set_header Host $http_host;
    proxy_pass http://rapidpro;
  }
}
  1. Set EDITOR_DEV_MODE = True in your settings.py (or set RAPIDPRO_EDITOR_DEV_MODE to True)

  2. Start mailroom on default port (make sure docs are copied in to base dir from recent release, test by going to /mr/docs/))

  3. Start courier on default port if you plan on sending/receiving messages

  4. Start rapidpro on default port

  5. Start floweditor in dev mode: yarn start

You should be able to edit/dev on editor now on flow editor page. Check network request log in chrome if it doesn't work.

Clone this wiki locally