https://cdisc-org.github.io/conformance-rules-editor/
Install Node.js version 16: https://nodejs.org/en/download/releases
-
Install frontend dependencies - From the root directory, run the command:
npm install
-
Install api dependencies - From the ./api directory, run the command:
npm install
-
Install static web app node libraries by running the following commands:
npm install -g @azure/static-web-apps-cli@1.1.6 npm install -g azure-functions-core-tools@4 --unsafe-perm true
Note: Currently rule editor requires version 1.1.6 of Azure SWA CLI. Newer versions of the CLI will result in a 404 error from the emulator.
-
Using VSCODE, install the "Azure Functions" extension.
-
Create a local.settings.json in the API folder to support local development of the API. It should contain the following values which provide information for the staticwebapp config and the Microsoft Graph API for Users' name resolution:
{ "IsEncrypted": false, "Values": { "EXECUTE_RULE_URL": "<RULE_EXECUTOR_URL>", "FUNCTIONS_WORKER_RUNTIME": "node", "SWA_TENANT_ID": "<Static Web App Tenant ID>", "SWA_CLIENT_ID": "<Static Web App Client ID>", "SWA_CLIENT_SECRET": "<Static Web App Client Secret>", "CORE_AUTHOR_GROUP": "<User Group ID for write permissions>", "RULE_SCHEMA_URL": "https://raw.githubusercontent.com/cdisc-org/cdisc-rules-engine/main/resources/schema/CORE-base.json" } }
By default, the Rules Editor will use the
MSGraph
Users Provider. If you do not have a SWA tenant, you can omit theSWA_TENANT_ID
,SWA_CLIENT_ID
,SWA_CLIENT_SECRET
, andCORE_AUTHOR_GROUP
variables. Instead, you can use the following:"USERS_PROVIDER": "Dummy",
-
Storage - There is a base Storage abstraction which allows for any storage implementation. Currently there are 2 storage implementations. Using one of these implementations requires the additional env variables to be added to the local.settings.json file
-
CosmosDB (SQL)
Tell the editor which storage implementation to use:
"STORAGE_PROVIDER": "CosmosSQL",
"COSMOS_BASE_URL": <COSMOS_BASE_URL>, "COSMOS_KEY": <COSMOS_KEY>, "COSMOS_DATABASE": <COSMOS DB Name>, "COSMOS_CONTAINER": <COSMOS Container Name>, "COSMOS_HISTORY_CONTAINER": <COSMOS History Container Name>
Optional env variable to ignore unauthorized https connections when cosmosdb is running in a local emulator:
"NODE_TLS_REJECT_UNAUTHORIZED": "0",
-
Drupal
Tell the editor which storage implementation to use:
"STORAGE_PROVIDER": "Drupal",
"DRUPAL_BASE_URL": "<DRUPAL_API_URL>", "DRUPAL_CLIENT_ID": "<DRUPAL_API_CLIENT_ID>", "DRUPAL_CLIENT_SECRET": "<DRUPAL_API_CLIENT_SECRET>", "DRUPAL_GRANT_TYPE": "<DRUPAL_API_GRANT_TYPE>", "DRUPAL_PATH": "<DRUPAL_API_PATH>", "DRUPAL_SCOPE": "<DRUPAL_API_SCOPE>",
-
If using Windows, you may need to change the Powershell execution policy:
- Open Powershell in Administrator mode
- Run the command:
Set-ExecutionPolicy RemoteSigned
and inputY
at the prompt.
Run the "Everything" compound (see launch.json).
A browser should open that points to: http://localhost:4280/
Alternatively, you can run the launch components individually.
Run: $Env:BROWSER='none'; npm run --prefix ./api build; swa start http://localhost:3000 --api-location ./api --run 'npm start'
Navigate to: http://localhost:4280/
For more development details, refer to the wiki.