Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

WFA App is an web application that is deployed in ‘Tomcat’ docker container.

...

Deployment Location:
- Host computer /user/webapps/wfa , which is virtual mount of docker container’s tomcat/webapps. When we deploy updates of WFA App, we need to unzip the app file into this location.

DWS Config Settings:

...

Target login Dhis2 server:
In ‘ws_v2@CMN@replica', we need to properly set ‘dhis2LoginUrl’, ‘dhis2CountryLevel’, ‘cws_dws_pwa_name’, and ‘cws_dws_pwa_pwd’.
For ‘dhis2LoginUrl’ set to ‘dev.psh.org.zw’, the ‘dhis2CountryLevel’ is set to '1'.
However, this might/might not be same for the production Dhis2 server.

...

On this page:

WFA is a web application deployed on Tomcat. It integrates with services such as 'Dhis2 login', 'voucherCodeService', and 'message scheduling/sending', all of which are orchestrated through the DWS, a middle-ware service.

WFA Deployment

The WFA application is provided as a zip file. Deployment or updates are performed by unpacking this ZIP file into the Tomcat ‘webapps’ folder.

Steps:

  1. Use FTP to transfer the WFA ZIP file named ‘wfa.zip’.
    (In this example, the FPT destination is ‘/home/ktt’.)

  2. Connect to the server and execute the below command.

    Code Block
    sudo tar --overwrite -xvf /home/ktt/wfa.zip -C /home/ktt/zw-vmmc-docker/tomcat/webapps

WFA DWS Configurations

DWS operates based on endpoint configurations. By setting up the appropriate configuration for each endpoint, DWS ensures proper execution of operations.
The configuration files are managed via the Git Repository ‘connectConfigs’, under the ‘zimProd’ branch.

Changes Made for This Project:

  1. For the ‘connectGitConfig’ service, use the domain name ‘http://localhost:8080

...

  1. ’ throughout the configuration files:

    Code Block
    // Declare global variables
    config.addVariables(
      {"cmn_baseUrl": "http://localhost:8080/connectGitConfig/api/getConfig?type=ws_v2&ver=1&branch={{branch}}&endpoint={{endpoint}}"},
  2. For Node.js services, reference the 'node_container' Docker container using 'http://node_container:[--PORT_NUMBER--]':

    Code Block
      requestData: new utils.RequestData(
      {
        method: "GET",
        URL: "'http://node_container:

...

Dhis2 Server Setup

  • ‘OrgUnit’ needs to be populated for login user code & pin.

  • ‘OrgUnitGroup’ needs to be populated for login user roles.

...

  1. 3015/api/vouchers/currentStatus'",
        . . . 
      }),
  2. The ‘ws_v2@CMN@replica’ endpoint authenticates WFA users against Dhis2 orgUnits.
    Adjust this endpoint to connect to the ZWE HoH Dhis2 server by setting the following values appropriately:

    Code Block
    var config = new utils.Config("ws_v2@CMN@replica","CMN_2.0");
    config.addVariables(
      . . . 
      {"dhis2CountryLevel": "1" },
      {"dhis2LoginUrl": "https://dev.psh.org.zw"},
      {"cws_dws_pwa_name": "app_wfa_vmmc"},
      {"cws_dws_pwa_pwd": "---Place Pwd Here---"},
      . . . 
    );
    
    . . . 

Database Setups & Data Migration

WFA uses MongoDB to store data. Below are the databases and collections utilized by WFA:

Database > Collection

Notes

db1 > client

Stores client data

dbLog > log

Stores log data  

dbOthers > InfoDef

Contains voucher code generation variables

dbOthers > vouchers

Queue storage for generated voucher codes

Data Migration

  1. Export and Import Data:

    1. Export the ZWE VMMC filtered dataset from MongoDB Atlas and import it into the target MongoDB server, the MongoDB docker container.

    2. Copy the exported file into the MongoDB Docker container and run the following command:

      Code Block
      mongoimport --host=localhost --port=27017 --db=db1 --collection=client --file=/data/client2024.json --jsonArray
  1. Set Indexes:

    1. To ensure proper performance, set indexes on the collections listed above.

    2. Export the indexes from MongoDB Atlas by running the following command in the MongoDB shell for each database and collection:

      Code Block
      db.your_collection_name.getIndexes();
    1. Import the indexes into the target MongoDB instance using a Node.js script named 'indexImporter.js'.

      Code Block
      node indexImporter.js db1 client indexFiles/clientIndexes.json