This repository contains a template to add a webapp as a demo for an usecase to PlanQK. It includes the web application (webapp) and a PlanQK proxy. You find more information about the demo-deployment in the PlanQK documentation.
To start the application locally, execute ./build-docker.sh
. Ensure you have
set the necessary environment variables, for instance, by using an .env
file.
You can then access the project at http://localhost:8085
.
The PlanQK proxy is a straightforward intermediary that forwards requests to the PlanQK service. It utilizes the following environment variables, which can be generated by a PlanQK application on the PlanQK Platform and set in the settings of the use-case demonstrator:
CONSUMER_KEY=
CONSUMER_SECRET=
SERVICE_ENDPOINT=
DEMO_DATA={"data":{}, "params:{}"}
PORT=8080
The proxy facilitates the following REST calls:
POST /planqk/create
- Initiates a new run of the defined service on the PlanQK platform. The request body should contain a JSON as defined in the PlanQK Service. The response includes the ID of the created instance.GET /planqk/status/{id}
- Retrieves the status of the run with the specified ID. This can be polled from the webapp to check if the instance has completed.GET /planqk/result/{id}
- Obtains the result of the instance with the specified ID. This can be requested from the webapp once the run has finished.
The webapp
directory contains the build of the web application (e.g., an
Angular or React application). The webapp can communicate with the PlanQK
proxy to initiate a new instance of the defined service on the PlanQK
platform, poll the status of the instance, and request its result.