Wiki Spaces

Documentation
Projects
Resources

Get Help from Others

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

Documentation

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This is described on the Open Web Apps Module page. It's the same as installing any other other module

3. Scaffold Your Open Web App

A boilerplate Open Web App along can be scaffolded using the Yeoman OpenMRS OWA generator. You will need NodeJS 4+ installed to do this. See the install instructions here.

...

This will start up the Yeoman generator. The output should be something like:


Image Modified

 

Follow the options in the Yeoman generator in order to scaffold the app. Depending on your setup options it might look something like this when you are done: 

 

Image Modified

 

Congratulations you have successfully scaffolded your app!

...

This creates a zip file in the app directory. You can then upload this to an OpenMRS implementation using the Open Web Apps Module. 

Local Deployment

To speed up the development workflow, we can deploy directly to the app data directory on the filesystem, again using using npm Webpack.:

 

Code Block
themeMidnight
languagebash
titleScaffold Open Web App
npm run build:deploy

...

 The app should now show up in your OpenMRS implementation (Administration -> Open Web Apps Module -> Manage Apps) and will look something like this: 

 

 

If you have issues using Webpack to deploy the app, ensure that the deploy directory is correct. Open the config.json file in the apps directory and make sure that LOCAL_OWA_FOLDER points to the correct directory. For example: 

...

npm can use Browsersync to watch the files as you development and dynamically reload the app as you make changes to the code. Each time you save a file in the app's directory, the app will reload and display in the browser. This is an extremely useful tool. To use browsersync run the following command in your app's directory: 

...

Code Block
themeMidnight
languagebash
titleBuild App
npm run watch

 

If you have issues getting browsersync to work, ensure that the app is being injected. Open the config.json file in the app directory and make sure that APP_ENTRY_POINT points to the correct path. Your config.json file should look 

{
"LOCAL_OWA_FOLDER": "/Users/username/openmrs-standalone-2.5/appdata/owa",
"APP_ENTRY_POINT": "http://localhost:8081/openmrs-standalone/owa/appList/index.html"
}

 

...

...