This package contains examples showcasing issuance, verification, and revocation of Verifiable Credentials using the Verite protocols.
Additional examples showcase a DeFi use-case and smart contract integration, and a central custody service example in which Verifiable Credentials are generated dynamically.
- Node.js v14
- npm v7 or greater (
npm i -g npm@7
)
This package is set up as an npm workspace (requires npm v7 or greater), and as such, the dependencies for all included packages are installed from the root level using npm install
. Do not run npm install
from this directory.
From the root of the monorepo, run:
npm run setup
From the root of the monorepo, simply run:
npm run dev
This app is built with next.js. Next.js is a development framework for React which has automatic routing (based on folder structure), server-side rendering, and other optimizations. Next.js maintains a folder structure which maps directly to app routes. For example, the file pages/hello.tsx
would map to the route /hello
.
The folder structure is as follows:
pages/ Contains top-level React components which are treated as "pages" mapped to an HTTP route
pages/api Contains Server-Side API routes
components/ Contains shared React components
hooks/ Contains shared React hooks
lib/ Contains code shared between React front end and the API backend
prisma/ Contains the database schema and seeds
The root App
React component is located in pages/_app.tsx
. The root page for this demo is located at pages/index.tsx
.
You can read more about the Next.js folder structure in their documentation.
This app uses a local sqlite database to maintain state, and uses prisma to access the database from code.
There are several database scripts which can be helpful during development:
npm run db:migrate
npm run db:reset
npm run db:seed
npm run prisma studio
In some cases, the testnet faucets we use have run out of Eth. You should manually fill these faucets using a Goerli faucet (such as https://goerli-faucet.pk910.de/).
The addresses to fill are:
0x71CB05EE1b1F506fF321Da3dac38f25c0c9ce6E1
0x695f7BC02730E0702bf9c8C102C254F595B24161