0.2.0-pre.18 • Published 3 years ago

openmrs-esm-ohri-app v0.2.0-pre.18

Weekly downloads
-
License
MPL-2.0
Repository
github
Last release
3 years ago

OpenMRS OHRI App

A simple OpenMRS Microfrontend for learning and development purposes

Folder structure highlights

  • src - Main files for the app
  • src/index.ts - Performs configurations and loads root.component.ts
  • src/root.component.ts - Loads and routes components for the app around a user context
  • src/<component name>
    • src/<component name>/<component name>.component.tsx - Main component file
    • src/<component name>/<component name>.component.test.tsx - Tests for the component
    • src/<component name>/<component name>.resource.tsx - Helpers for component (e.g. API interaction)

How do I use it?

First, make sure to fork this repo.

Installation

Clone the forked repo to your computer and proceed as:

git clone https://github.com/<your github username>/openmrs-esm-ohri-app.git
cd openmrs-esm-ohri-app
npm install
npm run start

The core app will be served on localhost:8080

On a separate terminal, serve the local microfrontend module

npm run serve

The module will be served on localhost:8081

Now, on a browser, navigate to localhost:8080. Your screen should look like this:

Home screen


How do I check that the module is running?

  1. On the core app, click on the bottom right square on the screen to open dev-tools
  2. Then, scroll down the list of modules and locate the module openmrs-esm-ohri-app
  3. Close the dev-tools window
  4. Navigate to localhost:8080/openmrs/spa/patients/hts/form, where your screen should look like this:

Note: Whenever you create a module, it is displayed by navigating to an assigned route