App Setup

Demo Video

DIGIT Health Campaign Management Demo | DIGIT HCM

Setup Guide

Database (DB) Restore (Providing a DB backup to avoid hassle since the automation of the seed data creation is a work in progress):

To restore the database, you can access the DB dump file. Use the following link to download the SQL file. https://drive.google.com/file/d/1u2eljinnCCJAxUGCHRHHfnDQ5-WMZWIo/view?usp=sharing

Steps to Restore Database Data

  • Run Kubectl, and copy cmd to copy the file to the server (playground pod where DB runs).

  • Execute the restore command inside the playground pod.

psql -h {host} -U {username} -d {dbname} -f /path/in/pod/seed_data.sql

Note:

  • Once the DB is restored, redeploy the MDMS service, persister, and indexer services using the config flag since we have updated a few links in the DevOps repository.

  • The Postgres version should be 14.8 or later.

kubectl apply -f /path/to/your/pod-config.yaml

Frontline Worker's App Setup

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.10.0 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 to Run the Application

  1. 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

  1. Open the project in your preferred IDE (Android Studio, Visual Studio Code). Make sure that the IDE is configured with the Flutter and Dart plugins.

  2. Run install_bricks.sh bash script which is located in the tools folder.

  3. Navigate to the root folder of the project in the terminal and run the following command to initialise the packages using Melos:

melos bootstrap

(-or-)

melos bs

This command fetches and links all the necessary dependencies for the project.

  1. Now, create a .env file inside the apps/health_campaign_field_worker_app folder.

Sample .env file:

BASE_URL={replace with base url}
MDMS_API_PATH="egov-mdms-service/v1/_search"
TENANT_ID="default"
SYNC_DOWN_RETRY_COUNT="3"
RETRY_TIME_INTERVAL="5"
CONNECT_TIMEOUT="120000"
RECEIVE_TIMEOUT="120000"
SEND_TIMEOUT="120000"
  1. Create another file as pubspec_overrides.yaml in the same folder:

# melos_managed_dependency_overrides: digit_components,digit_firebase_services,forms_engine,intl, digit_showcase
dependency_overrides:
 digit_components:
   path: ..\\..\\packages\\digit_components
 digit_firebase_services:
   path: ..\\..\\packages\\digit_firebase_services
 digit_showcase:
   path: ..\\..\\packages\\digit_showcase
 forms_engine:
   path: ..\\..\\packages\\forms_engine
 intl: ^0.18.0

Note: Check that all the folder names are present in the packages folder before overriding the dependencies.

  1. Navigate to the app's folder from the terminal:

    cd apps/health_campaign_field_worker_app

  2. Connect your Android device or start an emulator. Ensure that it is visible by running

    flutter devices.

  3. 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.

Steps to Generate APK

  • Create a .env file inside the apps/health_campaign_field_worker_app folder.

Sample .env file:

BASE_URL="https://health-demo.digit.org/"
MDMS_API_PATH="egov-mdms-service/v1/_search"
TENANT_ID="default"
SYNC_DOWN_RETRY_COUNT="3"
RETRY_TIME_INTERVAL="5"
CONNECT_TIMEOUT="120000"
RECEIVE_TIMEOUT="120000"
SEND_TIMEOUT="120000"
ENV_NAME="UAT"

Upserting Localisation

  1. 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:

{
            "code": "ADMINISTRATION_UNIT_FORM_LABEL",
            "message": "Administrative Unit",
            "module": "hcm-beneficiary",
            "locale": "en_MZ"
      }

API curl:

curl --location '{URL}/localization/messages/v1/_upsert' \
--header 'Content-Type: application/json' \
--data '{
    "RequestInfo": {
        "apiId": "emp",
        "ver": "1.0",
        "ts": "10-03-2017 00:00:00",
        "action": "create",
        "did": "1",
        "key": "abcdkey",
        "msgId": "20170310130900",
        "requesterId": "rajesh",
        "authToken": "{authToken}",
        "userInfo": {
            "id": 128
        }
    },
    "tenantId": "{tenantId}",
    "locale": "{locale}", // Eg. en_MZ
    "module": "hcm-common",
    "messages": [
        {
            "code": "ADMINISTRATION_UNIT_FORM_LABEL",
            "message": "Administrative Unit",
            "module": "hcm-beneficiary",
            "locale": "en_MZ"
        }
    ]
}'

Link for Localisation:

Consolidated: https://github.com/egovernments/releasekit/blob/master/localisation/HCM/consolidated/en_MZ/consolidated.json Module’s Localisation: https://github.com/egovernments/releasekit/tree/master/localisation/HCM/V1.2

Last updated

https://creativecommons.org/licenses/by/4.0/