Coder Social home page Coder Social logo

huynguyen-hl / tests-untp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from uncefact/tests-untp

0.0 0.0 0.0 1.17 MB

UNTP mock implementations and test cases

License: GNU General Public License v3.0

Shell 0.01% JavaScript 0.87% TypeScript 98.15% CSS 0.07% HTML 0.53% Handlebars 0.15% Dockerfile 0.21%

tests-untp's Introduction

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

tests-untp's People

Contributors

ldhyen99 avatar huynguyen-hl avatar namhoang1604 avatar ducpm511 avatar onthebreeze avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.