Skip to content

Whats-Cookin/tests-untp

 
 

Repository files navigation

tests-untp

UNTP mock implementation is a mock app that presents how the decentralized app works. There are three main packages in this repository: components, core, and services. The components package contains the UI components, the core package plays the role of the render page by using the components package and interacting with the services package and the services package contains the business logic.

Prerequisites

Install dependencies

yarn install

Copy the .app-config.example file to .env for the demo explorer

cp packages/mock-app/src/constants/app-config.example.json packages/mock-app/src/constants/app-config.json

Update the app-config.json file with the correct values, for example:

{
  "services": [
    {
      "name": "processDPP", // Service name
      "parameters": [
        {
          "vckit": {
            "vckitAPIUrl": "https://vckit.example.com", // URL of the VC API
            "issuer": "did:web:vckit.example.com" // Issuer DID
          },
          "dpp": {
            "context": ["https://dpp.example.com/dppld.json"], // DPP context, please refer to the DPP documentation, if it is not provided, the error message will be displayed
            "renderTemplate": [{ "template": "<p>Render dpp template</p>", "@type": "WebRenderingTemplate2022" }],
            "type": ["DigitalProductPassport"],
            "dlrLinkTitle": "Livestock Passport",
            "dlrIdentificationKeyType": "gtin",
            "dlrVerificationPage": "http://dlr.example.com/verify" // DLR verification page
          },

          "dlr": {
            "dlrAPIUrl": "http://dlr.example.com", // DLR API URL
            "dlrAPIKey": "5555555555555"
          },
          "storage": {
            "url": "https://storage.example.com", // Storage API URL
            "params": {
              "resultPath": "" // Path to access the credential or the link to the credential within the API response
            },
            // Optional parameters
            "options": {
              "method": "POST",
              "headers": {
                "Content-Type": "application/json"
              }
            }
          }
        }
      ]
    }
  ]
}

Build the package

yarn build

Start the project

yarn start

Docker

  • Dockerfile Build image
docker build --build-arg CONFIG_FILE=./app-config.json -t mock-app:latest .

Run image

docker run -p 3000:80 mock-app:latest
  • Docker compose
docker-compose up

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 84.7%
  • Handlebars 13.7%
  • JavaScript 0.8%
  • HTML 0.5%
  • Dockerfile 0.2%
  • CSS 0.1%