Skip to content

Latest commit

 

History

History
 
 

frontend

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

This is a Verifiable Credential (VC) Gated Website

Screenshot 2023-06-06 at 10 30 51 AM

About

This is an opinionated template for creating VC gated dapps with

  • frontend library: React
  • component library: Chakra
  • wallet connection libraries: Rainbowkit using WalletConnect v2, wagmi, & viem hooks

How to run locally

0. Follow server setup instructions

Before starting the frontend, run the server by following the server instructions. You need the ngrok url from the server in order to start the frontend.

1. Install frontend dependencies with --legacy-peer-deps

Make sure to run the install command with the --legacy-peer-deps flag.

npm i --legacy-peer-deps

Unfortunately some of the dependencies are mid migration and use different legacy versions of typescript, so you need to run the command and all other dependency installations with the flag or you'll see installation errors. When installing any other dependencies in this project, use the flag.

For example, here's how you could install react router:

npm install react-router-dom --legacy-peer-deps

2. Create a .env file by copying my sample

cp .env.sample .env;

Update your .env with the REACT_APP_VERIFICATION_SERVER_PUBLIC_URL variable to your hosted server ngrok url. If you're hosting in production with render, use the render url for this variable.

Visit https://cloud.walletconnect.com/ and create a new project (free and takes 2m). Update REACT_APP_WALLET_CONNECT_ID with the resulting Project ID.

Quick check: Make sure you've updated these values in .env, not .env.sample 🤠

3. Start the frontend

npm start

Visit http://localhost:3000/

4. Optional: host your website using Fleek

I've documented a similar hosting process here: https://github.com/oceans404/fullstack-sockets-demo#deploy-your-frontend

Logic flow

This frontend interacts with the verifier server to