Setup App
Demo Video
DIGIT Health Campaign Management Demo | DIGIT HCM
Overview
This guide provides step-by-step instructions to clone and run the Health Campaign Frontline Worker's App locally on your machine. The app is a Flutter application developed for health campaigns.
Pre-requisites
Before you begin, ensure that you have the following installed on your PC:
Flutter 3.16.5 version - Flutter SDK.
Android Studio or VS Code, any preferred IDE for Flutter development.
Android device or emulator for testing.
Run the flutter doctor command to ensure all the required checklists are marked.
Steps
Open a terminal and run the following commands:
git clone https://github.com/egovernments/health-campaign-field-worker-app.git
cd health-campaign-field-worker-app
Product Repo: egovernments/health-campaign-field-worker-app
Open the project in your preferred IDE (Android Studio, Visual Studio Code). Make sure that your IDE is configured with the Flutter and Dart plugins.
Create a .env file inside the apps/health_campaign_field_worker_app folder.
Sample .env file:
Create another file as pubspec_overrides.yaml in the same folder:
Note: Check that all the folder names are in the packages folder before overriding the dependencies.
Create another file as pubspec_overrides.yaml in packages/attendance_management/pubspec_overrides.yaml
Create another file as pubspec_overrides.yaml in packages/forms_engine/pubspec_overrides.yaml
Run install_bricks.sh bash script which is located in the tools folder. This script fetches and links all the necessary dependencies for the project.
After successfully running the script and setting up the env file, navigate to the app's folder from the terminal:
cd apps/health_campaign_field_worker_app
Connect your Android device or start an emulator. Ensure that it is visible by running
flutter devices.
Now, run the following command to launch the app:
flutter run.
This command will build the app and install it on the connected device or emulator.
Generate APK - Steps
Create a .env file inside the apps/health_campaign_field_worker_app folder.
Sample .env file:
Create another file as pubspec_overrides.yaml in the same folder.
Note: All the folder names should be in the packages folder, before overriding the dependencies.
Create another file as pubspec_overrides.yaml in packages/attendance_management/pubspec_overrides.yaml
Create another file as pubspec_overrides.yaml in packages/forms_engine/pubspec_overrides.yaml
Run install_bricks.sh bash script which is located in the tools folder. This script fetches and links all the necessary dependencies for the project.
After successfully running the script and setting up the env file, navigate to - apps/health_campaign_field_worker_app folder in the terminal, and run the following command to generate the APK:
flutter build apk --release --no-tree-shake-icons
After successfully running the above command, the APK will be generated in the path
apps/health_campaign_field_worker_app/build\app\outputs\flutter-apk\app-release.apk
Install the generated APK on your preferred Android device.
Change Master Data - Steps
All the Master data persist in MDMS under the tenant folders.
Sample: https://github.com/egovernments/health-campaign-mdms/tree/DEV/data/default. App master data persist in:
https://github.com/egovernments/health-campaign-mdms/tree/DEV/data/default/health
Consist of service register: All the APIs that the app utilises to call the server: https://github.com/egovernments/health-campaign-mdms/blob/DEV/data/default/health/service-registry.json
App configuration: Primary details required to run the app:
https://github.com/egovernments/health-campaign-mdms/blob/DEV/data/default/health/field-app-configuration.json Project types: Details of the projects are listed here: https://github.com/egovernments/health-campaign-mdms/blob/DEV/data/default/health/project-types.json
Additional static configs: https://github.com/egovernments/health-campaign-mdms/blob/DEV/data/default/health/symptoms_types.json
Upsert Localisation
Import the following curl in Postman:
Note:
Replace the {URL} with the required environment.
Get the {authToken} of SUPER_USER.
Replace the {tenantId} with the required tenant.
Each message object should have a unique code and module.
Sample message to upsert:
API curl
Localisation Link
If the localisation is not executed prior, then -
Consolidated: https://github.com/egovernments/releasekit/blob/master/localisation/HCM/consolidated/en_MZ/consolidated.json Module Localisation:
https://github.com/egovernments/releasekit/tree/master/localisation/HCM/V1.3