Wiki Spaces


Get Help from Others

Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack


Page tree
Skip to end of metadata
Go to start of metadata

When you want to write code within the OpenMRS SPA, you will need to follow these instructions for setting up your development environment.

Step-by-step guide

First, make sure you have the following installed.

  1. Install git
  2. Install node, which includes npm. This is for compiling and bundling frontend code (not for writing backend code).
  3. Trust insecure localhost SSL certificates.
  4. Run the following commands:
git clone # or whichever frontend repo you want to develop in
cd openmrs-esm-root-config
npm install
npm start -- --https --port 8080
  1. Now go to
  2. Open the browser console
  3. localStorage.setItem('openmrs:devtools', true)

  4. Refresh the page. You will now see a floating colored rectangle on the screen. Click on it. A panel will open up
  5. In the Import Map tab, click on the frontend module that you are working on.
  6. For all repos except for openmrs-esm-root-config, modify the URL to be 8080. This will make it so the javascript bundle is loaded from https://localhost:8080 instead of the CDN. For esm-root-config, modify it to be the following fully qualified url: https://localhost:8080/openmrs-esm-root-config.defaults.js
  7. Refresh the page.
  8. Verify that root-config.js is being downloaded from localhost now. You can do this in the Network tab of the browser dev tools.
  9. Congrats! You're all set up. Try adding a console.log() statement inside of a file and saving the file. Your web browser will refresh and you should see the console.log inside of the browser console.