Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR#11 Bank onboarding workflow with Test credentials #11

Merged
merged 59 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
05c2a21
Qr code Reader component added to handle DID
Feb 1, 2024
e24efb4
Added toast and fix Helper box
Feb 1, 2024
a9a459d
Fix Helper box now works with onboarding form
Feb 2, 2024
922cb56
Added onboarding page item to sidebar
Feb 2, 2024
29c284b
Organizations page as Landing
Feb 5, 2024
57b1339
Design fixes for landing page
Feb 5, 2024
7cc132b
Added new UI libraries
Feb 6, 2024
b5e141d
Added UI components folder
Feb 6, 2024
cd5d97c
Added form components folder
Feb 6, 2024
56727fd
Assets for Quotient page
Feb 6, 2024
0f6b85b
added Open bank Quotient page
Feb 6, 2024
a9a21d8
General style fixes and small refactor over Quotient page
Feb 6, 2024
80f77ea
Design fixes and Refactor for Quotient page
Feb 6, 2024
befba2b
Styling Goverment docs for Quotient page
Feb 6, 2024
fd98e64
Added basic configuration for Issuing credentials
Feb 6, 2024
0fdd5d8
Successfully issuing credentials on Quotient
Feb 7, 2024
7e09801
Small fixes
Feb 7, 2024
697f1ea
Fix linting
Feb 7, 2024
e48364a
format check fix
Feb 7, 2024
8c86de1
removed lock.json file
Feb 7, 2024
9387085
Fix form-check to work with npm
Feb 7, 2024
e4598fa
feat: quotient loan form
Feb 8, 2024
f08dc35
Fix:comments from PR#11
Feb 8, 2024
4294213
Changed the _credentials folder content
Feb 8, 2024
2b89efc
fix:Change component to jsx
Feb 9, 2024
1858108
Desktop design complete for New Banking page
Feb 9, 2024
b9dc892
feat - equinet dashboard page
Feb 9, 2024
43e1eea
Setting up QR generator with each template
Feb 9, 2024
ef671fa
fix: generate Qr on loan
Feb 10, 2024
be858c0
Removed old pages
Feb 10, 2024
e81d637
desktop design done for Equinet page
Feb 10, 2024
72039ce
Qr code & credentials styles for loan page
Feb 10, 2024
72246c3
Qr for new bank page
Feb 10, 2024
d90713b
Landing page updated with demo flow items
Feb 10, 2024
76da3fb
Cleaning componetns folder
Feb 10, 2024
99b48fe
deleted icons folder
Feb 10, 2024
4d1f23e
Partners page created
Feb 10, 2024
254be4d
Issuers Did's on env file
Feb 10, 2024
6bacdca
partners pages desktop design
Feb 10, 2024
7024167
Page layout moved to app.js & creating custom partner page
Feb 11, 2024
5594e2c
Custom partner content structure
Feb 11, 2024
dd54c15
Partnert custom page complete with responsive
Feb 12, 2024
a41142c
fix linting
Feb 12, 2024
eb087c3
Suggested fixes
Feb 12, 2024
2cc4073
Fixed success bank account created page
Feb 12, 2024
e8ab9fb
Partners Componets move to new folder
Feb 12, 2024
597e141
feat: urbanscape page & form
Feb 12, 2024
737a72c
Merge branch 'design-fixes' into bank-onboarding-workflow
dhipgraby Feb 12, 2024
3ccaaf4
Fixing PR commets
Feb 13, 2024
94b5c42
fix: format-check failing because the identified lines did not adhere…
Dadogg80 Feb 14, 2024
95560e6
Merge branch 'dev' into bank-onboarding-workflow
Dadogg80 Feb 14, 2024
7afea60
fix: remove personal values as default values.
Dadogg80 Feb 14, 2024
a197cd1
Update format-check.yaml dev branch added (#13)
dhipgraby Feb 14, 2024
a9e9212
Merge branch 'dev' into bank-onboarding-workflow
gasher Feb 15, 2024
e4260b0
Pusing for format-check
Feb 15, 2024
1127402
fix format-check
Feb 15, 2024
81e2980
Fixed _credentials subject
Feb 19, 2024
9b8f09a
fix: failing format-check
Dadogg80 Feb 19, 2024
b20c182
Update pages/_app.js
Dadogg80 Feb 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
DOCK_API_URL=https://api-testnet.dock.io
DOCK_API_TOKEN= # you can generate a key at https://certs.dock.io/keys
NEXT_PUBLIC_DOCK_API_URL="https://api-testnet.dock.io"
DOCK_API_TOKEN = # You API KEY
DOCK_API_DID= # the DID to use for the issuer. You can generate one here: https://certs.dock.io/dids
NEXT_PUBLIC_SERVER_URL= # the URL where this app is listening (e.g. http://192.168.0.100:3000 or http://localhost:3000)
NEXT_PUBLIC_SERVER_URL= http://localhost:3000

# Proof-Request Template Ids
QUOTIENT_PROOF_TEMPLATE_ID=""
EQUINET_PROOF_TEMPLATE_ID=""
URBANSCAPE_PROOF_TEMPLATE_ID=""

# Organization Profiles
NEXT_PUBLIC_QUOTIENT_ISSUER_ID=""
NEXT_PUBLIC_FORSUR_ISSUER_ID=""
NEXT_PUBLIC_EQUINET_ISSUER_ID=""
56 changes: 50 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,21 @@
"browser": true,
"es6": true
},
"extends": ["next", "eslint:recommended", "plugin:react/recommended", "airbnb-base"],
"extends": [
"next",
"eslint:recommended",
"plugin:react/recommended",
"airbnb-base"
],
"rules": {
"no-use-before-define": ["error", { "functions": false, "classes": true, "variables": true }],
"no-use-before-define": [
"error",
{
"functions": false,
"classes": true,
"variables": false
}
],
"class-methods-use-this": "off",
"no-console": "off",
"no-nested-ternary": "off",
Expand All @@ -27,16 +39,48 @@
"indent": "off",
"implicit-arrow-linebreak": "off",
"function-paren-newline": "off",
"no-confusing-arrow": "off"
"no-confusing-arrow": "off",
"no-unused-vars": "off",
"no-trailing-spaces": "off",
"import/prefer-default-export": "off",
"no-shadow": "off",
"react/react-in-jsx-scope": "off", // Disable react/react-in-jsx-scope rule
"linebreak-style": ["off"]
},
"settings": {
"import/resolver": {
"node": {
"extensions": [
".js",
".jsx",
"ts",
"tsx"
],
"moduleDirectory": [
".",
"node_modules"
]
},
"alias": {
"map": [
["components", "./components"],
["utils", "./utils"]
[
"components",
"./components"
],
[
"utils",
"./utils"
],
[
"store",
"./store"
],
[
"lib",
"./lib"
]
]
}
}
}
}
}
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
37 changes: 37 additions & 0 deletions _credentials/equinet.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { v4 as uuidv4 } from "uuid";
import { getRandomNumber } from "utils";
import { dockUrl } from "utils/constants";

export function createCreditScoreCredential({ receiverDid }) {

console.log("Creating EquiNet - Credit Score Credential for:", receiverDid);

return {
url: `${dockUrl}/credentials`,
body: {
anchor: false,
persist: true,
password: "1234",
distribute: true,
credential: {
id: `https://creds-testnet.dock.io/${uuidv4()}`,
name: "EquiNet - Credit Score",
description: "This schema represents a Verified Credit Score Credential, issued by EquiNet. It standardizes the presentation of credit scores for reliable and efficient verification processes.",
type: [
"VerifiableCredential",
"EquiNetCreditScore"
],
issuer: {
name: "EquiNET",
description: "EquiNet is the credit bureau.",
logo: "https://img.dock.io/9f327cafda3be5f0cff0da2df44c55da",
id: process.env.NEXT_PUBLIC_EQUINET_ISSUER_ID
},
credentialSubject: {
id: receiverDid,
credit_score: getRandomNumber(700, 800),
}
}
}
};
}
45 changes: 45 additions & 0 deletions _credentials/forsur.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { v4 as uuidv4 } from "uuid";
import { dockUrl } from "utils/constants";

export function createBiometricsCredential({
receiverDid,
enrollmentId,
biometricData,
}
) {

console.log("Creating ForSur - Biometric Enrollment Credential for:", receiverDid);

return {
url: `${dockUrl}/credentials`,
body: {
anchor: true,
persist: true,
password: "1234",
distribute: true,
credential: {
id: `https://creds-testnet.dock.io/${uuidv4()}`,
name: "ForSur - Biometric",
description: "The \"ForSur - Biometric\" schema is specifically developed for the secure registration and storage of biometric data.",
type: [
"VerifiableCredential",
"ForSurBiometric"
],
issuer: {
name: "Forsur",
description: "Forsur is the biometric provider.",
logo: "https://img.dock.io/80f154126a78bba321b413c3ffb8d4a7",
id: process.env.NEXT_PUBLIC_FORSUR_ISSUER_ID
},
CredentialSubject: {
dhipgraby marked this conversation as resolved.
Show resolved Hide resolved
id: receiverDid,
biometric: {
id: enrollmentId,
created: new Date().toISOString(),
data: biometricData,
}
}
}
}
};
}
50 changes: 50 additions & 0 deletions _credentials/quotient.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { v4 as uuidv4 } from "uuid";
import { dockUrl } from "utils/constants";

export function createBankIdCredential({
receiverDid,
receiverName,
receiverAddress,
enrollmentId,
biometricData
}) {

console.log("Creating Quotient Bank Identity Credential for:", receiverDid);

return {
url: `${dockUrl}/credentials`,
body: {
anchor: true,
persist: true,
password: "1234",
distribute: true,
algorithm: "dockbbs+",
credential: {
id: `https://creds-testnet.dock.io/${uuidv4()}`,
name: "Quotient - Bank Identity",
description: "The \"Quotient - Bank Identity\" schema provides a secure and standardized format for representing key aspects of an individual's bank identity.",
type: [
"VerifiableCredential",
"QuotientBankIdentity"
],
issuer: {
name: "Quotient Credit Union",
description: "Quotient is our credit union",
logo: "https://img.dock.io/06d78272268c606a172d5fd1cd559b46",
id: process.env.NEXT_PUBLIC_QUOTIENT_ISSUER_ID
},
credentialSubject: {
id: receiverDid,
name: receiverName,
address: receiverAddress,
account_number: `ABC${uuidv4()}`,
biometric: {
id: enrollmentId,
created: new Date().toISOString(),
data: biometricData,
}
}
}
}
};
}
17 changes: 17 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": false,
"tsx": false,
"tailwind": {
"config": "tailwind.config.js",
"css": "styles/globals.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "/components",
"utils": "/lib/utils"
}
}
33 changes: 33 additions & 0 deletions components/bank-auth.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from 'react';
import { Separator } from 'components/ui/separator';
import { QRCodeGenerator } from 'components/qr-generator';
import useQrCode from 'utils/useQrCode';
import BankCredentials from './org/quotient/bank-credentials';
/**
* @description Bank QR code authenticator.
* @todo setUserInfo param
* @param {*} setUserInfo setter once qr code triggered from mobile app and returns user info
* @param {*} isAuth shows BankCredentials
* @memberof QuotientBankForm, UrbanScapePage
* @returns React.FC
*/
const BankQrAuthentication = ({ isAuth = false, proofTemplateId }) => {
const { qrCodeUrl } = useQrCode({ proofTemplateId });

return (
<div className='grid gap-2 p-4 bg-neutral-50 rounded-lg space-y-5 h-fit'>
<h2>Authenticate with your mobile banking app and providing the needed credentials including a validated credit score over 600.</h2>
<Separator />
<p className='text-start'>Scan the QR code below with your mobile banking app.</p>

{qrCodeUrl !== '' ? (<QRCodeGenerator url={qrCodeUrl} />) : null}
<Separator />
<div>
<h3>Required credentials:</h3>
<BankCredentials isAuth={isAuth} />
</div>
</div>
);
};

export default BankQrAuthentication;
39 changes: 0 additions & 39 deletions components/banking-account-summary.js

This file was deleted.

17 changes: 0 additions & 17 deletions components/button.js

This file was deleted.

Loading
Loading