Bahmni Lab Entry Micro Frontend build using OMRS 3.x
- React (TypeScript) - Front-end JS library
- Jest - JS testing framework
- React Testing Library - JS testing library for React components
- yarn - Yarn package manager
- webpack - JS module bundler
- ESLint - JS linter
- Prettier - Code formatter
- Babel - JS compiler
- Github Actions - CI service
- Clone the bahmni-lab-frontend repo.
git clone https://github.com/bahmni/bahmni-lab-frontend.git
- Install dependencies in the root directory of the repo.
yarn install
-
Add required OpenMRS apps in spa-build-config with the specific version.
-
Builds the OpenMRS appshell, assembles the built OpenMRS modules and combines Bahmni Lab application and assembled OpenMRS modules
yarn build:appshell
- Assembles the OpenMRS modules and combines Bahmni Lab application and assembled OpenMRS modules
yarn build:assemble
- Build the dist folder
yarn build
- Copy OpenMRS modules to dist
yarn build:dist
- Execute the below command to bring up the application in port 8200.
yarn bahmni
Note :
- To use additional OpenMRS micro-frontends, add them in dev-importmap pointing to the CDN.
- Make sure --config-url points to the port where served files reside.
- The --backend points to OpenMRS
- To add custom OpenMRS apps to the application
- Add folder containing build files of the custom OpenMRS application to omrs-apps. Ensure that the folder name follows the convention - openmrs-esm-app name-version number
- Check-in the omrs-apps folder to repo until the PR gets merged in OpenMRS.
- Update dev-importmap to point to locally served omrs-apps/openmrs-esm-app name-version number/openmrs-esm-app name.js
- Update the workflow to copy omrs-apps to dist folder after
yarn build:dist
command.
run: cp -R omrs-apps/ dist/
- Delete the above command from workflow and checked-in omrs-apps folders once the PR is merged in OpenMRS.
- Latest image of Bahmni Lab Entry can be pulled from here.