WFA Configuration
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:
Use FTP to transfer the WFA ZIP file named ‘wfa.zip’.
(In this example, the FPT destination is ‘/home/ktt’.)Connect to the server and execute the below command.
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:
For the ‘connectGitConfig’ service, use the domain name ‘http://localhost:8080’ throughout the configuration files:
// Declare global variables config.addVariables( {"cmn_baseUrl": "http://localhost:8080/connectGitConfig/api/getConfig?type=ws_v2&ver=1&branch={{branch}}&endpoint={{endpoint}}"},
For Node.js services, reference the 'node_container' Docker container using 'http://node_container:[--PORT_NUMBER--]':
requestData: new utils.RequestData( { method: "GET", URL: "'http://node_container:3015/api/vouchers/currentStatus'", . . . }),
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:
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
Export and Import Data:
Export the ZWE VMMC filtered dataset from MongoDB Atlas and import it into the target MongoDB server, the MongoDB docker container.
Copy the exported file into the MongoDB Docker container and run the following command:
Set Indexes:
To ensure proper performance, set indexes on the collections listed above.
Export the indexes from MongoDB Atlas by running the following command in the MongoDB shell for each database and collection:
Import the indexes into the target MongoDB instance using a Node.js script named 'indexImporter.js'.