DIGIT Health Campaign Management Demo | DIGIT HCM
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
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
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
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.
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.
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 the IDE is configured with the Flutter and Dart plugins.
Run install_bricks.sh bash script which is located in the tools folder.
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.
Now, 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 present in the packages folder before overriding the dependencies.
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.
Create a .env file inside the apps/health_campaign_field_worker_app folder.
Sample .env file:
Navigate to the root folder of the project in the terminal and run the following command:
melos clean
melos bs
After successfully running melos bs, navigate to the apps/health_campaign_field_worker_app folder in the terminal and run the following command to generate the APK:
flutter build APK --release
How to change the master data: 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
Import the following curl in Postman:
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:
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
HCM deployment guide
Access needed to the following:
Github
eGoV email Id
Jenkins: https://builds.digit.org
Click on ‘builds’.
Search for “health-campaign-services”.
Select the relevant service.
All services which are created for the health campaign are in “Health-services”.
If the service is not present, add it in the build files of the repo. The dev team should have added this already.
Select the service to build.
Click on “Build with Parameters”.
You will see a list of branches available for Github
For QA, search ‘qa’.
Select “origin/qa”.
Click on ‘Build’.
This will trigger the build. The latest build will be on the top of the list.
Click on the top of the list to check for the build logs.
You will see multiple options.
Click on “Console Output”.
If the build is successful, you will see the following message: “Finished: SUCCESS”.
Scroll up to see the image name, which has been pushed: docker.io/egovio/household:qa-efb0e0ac09-20 pushed successfully!
Copy household:qa-efb0e0ac09-20.
Visit https://builds.digit.org/.
Click on deployments.
Select the environment where you want to deploy.
For QA, click on “deploy-to-health-qa”.
Click on “Build with Parameters”.
Click on ‘Build’.
Paste the image name from the build step and paste it in the text box.
Cluster Config: If there is a change at the infra level or it is the first deployment for the service on the infra, select this check box: default keep it unchecked.
Click on ‘Build’.
You will see the latest deployment in progress on the top of the deployment list.
Click on the top to see the deployment logs.
This will show the Git data.
Click on “Console Output”.
If the deployment is successful in the logs, you will see the following message: “Finished: SUCCESS”.
Check the status of Kubernetes to verify if the new pod is running or not.