Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/animo/paradym-example-university-courses
A demo website for Paradym workflows
https://github.com/animo/paradym-example-university-courses
Last synced: 3 days ago
JSON representation
A demo website for Paradym workflows
- Host: GitHub
- URL: https://github.com/animo/paradym-example-university-courses
- Owner: animo
- Created: 2023-09-19T10:22:19.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-26T15:57:51.000Z (9 months ago)
- Last Synced: 2024-02-27T16:01:10.587Z (9 months ago)
- Language: TypeScript
- Size: 2.31 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Issue and verify credentials with Paradym
Easily integrate [Paradym](https://paradym.id) workflows into your frontend application with this demo. Enroll in university courses by proving prior course completions.
## Before you begin
> Check out the [YouTube video](https://youtu.be/fU-GHo-g5bs?si=bA3pSMTENtMqBo-E) for a complete walkthrough of the demo application and its workflows.
This demo uses [Paradym](https://paradym.id), a workflow builder for developers that provides the actions, workflows and infrastructure you need to use verifiable credentials in your solution.
If you don't have an account yet, you can start with our [quick start guide](https://docs.paradym.id/).
This demo also uses the [Paradym Wallet](https://docs.paradym.id/integrating-with-a-holder-wallet/paradym-wallet), an open source companion app to the Paradym platform available on the [Apple App Store](https://apps.apple.com/nl/app/paradym-wallet/id6449846111?l=en) and [Google Play Store](https://play.google.com/store/apps/details?id=id.paradym.wallet).
## Prerequisites
### Setup your workflows
The demo app requires 3 workflows. All workflows used for this demo application can be found in the `/paradym` folder.
- **Register Credential Template**: workflow used to register your credential schema and definition. The result of this workflow is used in the other 2 workflows.
- **Issue Cource Certificate**: workflow used to issue a course credential once the course is completed.
- **Verify Course Certificate**: workflow used to request and validate the required credentials for a course.#### Step 1: Register your credential information
- Create a new workflow in Paradym with the name Register Credential Template.
- Copy the contents from `registerCredentialTemplate.yaml` into your created workflow.
- Publish the workflow.
- Execute the workflow via the executions tab.
- Click on the execution to view the result of your workflow.
- Copy the `credentialDefinitionId` from the result and save the value for later.#### Step 2: Create the other workflows
Next, you need to create the other 2 workflows: Issue Course Certificate and Verify Course Certificate.
- Copy the contents from `.yaml` files from the `paradym` directory and create the workflows.
- Replace the `` values with the `credentialDefinitionId` value from step 1 for both workflows.
- Publish the workflows.Once you have created the workflows in the Paradym dashboard, you can copy the workflow ID's from Paradym and set them as environment variables.
#### Step 3: Set your Paradym Project ID
You can find your Paradym Project ID in the settings tab on the Paradym dashboard as described [here](https://docs.paradym.id/executing-a-workflow/api-execution#project-id).
#### Step 4: Create your Paradym API Key
You can generate your API key in the settings tab on the Paradym dashboard as described in [here](https://docs.paradym.id/executing-a-workflow/api-execution#api-key).
#### Step 5: Setup Paradym Webhook
The application uses Paradym Webhooks. For this, we need to create a Webhook in the Paradym dashboard (as described [here](https://docs.paradym.id/using-webhooks)).
For this to work with your local environment, we'll need to expose port 3000 to the internet. This can be done using [ngrok](https://ngrok.com/). Once you have installed ngrok, you can run the following command to expose port 3000 to the internet.
```bash
ngrok http 3000
```Use the **https** url to create your webhook in the Paradym dashboard. Make sure to add `/api` after the url (e.g. https://107a-217-123-79-23.ngrok-free.app/api).
You'll need set the webhook secret in your environment variables.
#### Step 6: Set the environment variables
The environment variables consist of your Paradym API Key, your Paradym project ID, your Paradym webhook secret, and the ID's of the workflows just created. Once you have created the workflows in the Paradym dashboard, you can copy the workflow ID's from Paradym and set them as environment variables.
```bash
cp .env.example .env.local
```| Variable | Description |
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `PARADYM_API_KEY` | This is the API key used to send request to Paradym. You can generate your API key in the settings tab on the Paradym dashboard as described in [here](https://docs.paradym.id/executing-a-workflow/api-execution#api-key). |
| `PARADYM_WEBHOOK_SECRET` | This is a secret that is generated once you create a Webhook in the Paradym dashboard. You can set up a Webhook in the settings tab on the Paradym dashboard as described in [here](https://docs.paradym.id/using-webhooks). |
| `PARADYM_PROJECT_ID` | This is your Paradym project identifier. It can be located in the settings tab on the Paradym dashboard as described [here](https://docs.paradym.id/executing-a-workflow/api-execution#project-id). |
| `ISSUE_COURSE_CERTIFICATE_WORKFLOW_ID` | This is the ID of the issue course credential workflow. Once you have created the workflow in Paradym you can copy the ID from the [executions tab](https://docs.paradym.id/executing-a-workflow/api-execution#workflow-id). |
| `VERIFY_COURSE_CERTIFICATE_WORKFLOW_ID` | This is the ID of the verify course credential workflow. Once you have created the workflow in Paradym you can copy the ID from the [executions tab](https://docs.paradym.id/executing-a-workflow/api-execution#workflow-id). |## Running the demo
First, run `yarn` to install the dependencies:
```bash
yarn
```You can then run the development server:
```bash
yarn dev
```Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.