Versions Compared

Key

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

...

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

WFA Deployment

The WFA app file will be application is provided as a zip file. Initial deployment or update deployment can be done Deployment or updates are performed by unpacking this zip file in tomcat webapps ZIP file into the Tomcat ‘webapps’ folder.

Steps:

  1. Use FTP to transfer the WFA zip ZIP file named ‘wfa.zip’.
    (In this example, the FPT file transfer 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 by based on endpoint configurations. By setting up a proper operation configuration for a given endpoint, DWS performs a proper operation.

...

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’ 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:3015/api/vouchers/currentStatus'",
        . . . 
      }),
  3. 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