Skip to content

🌐 A Polygon NFT-gated voting platform for the University of Santo Tomas Central Student Council

Notifications You must be signed in to change notification settings

cedricquitor/blockchain-web-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’Ž blockchain-web-app

This project has two applications:

This project is still a work in progress, click here to view the list of TODO's

TODO's

blockchain TODO's

  • None

client TODO's

Candidate.tsx

  • Hide the remove candidate button for non-admins.

Installation

To clone the repository:

Navigate to the directory where you plan to clone the project in.

git clone https://github.com/cedricquitor/blockchain-web-app.git

Setup blockchain's Environment Variables

  1. Create a .env file in blockchain/
  2. Click here for Environment Variables setup instructions

Setup client's Environment Variables

  1. Create a .env file in client/
  2. Click here for Environment Variables setup instructions

Polygon App (Solidity, Hardhat, Ethers) - blockchain

Environment Variables

  • ALCHEMY_API_KEY: Contact collaborators or @cedricquitor
  • PRIVATE_KEY: Click here for instructions on how to get your private key

How to deploy the smart contract in localhost

  1. Navigate to blockchain
cd blockchain
  1. Start a local node
npx hardhat node
  1. Open a new terminal and run the nft_deploy script using Hardhat
npm run deploy:localhost

How to deploy the smart contract in Polygon Mumbai testnet

  1. Navigate to blockchain
cd blockchain
  1. Run the nft_deploy script using Hardhat
npm run deploy:mumbai

How to get your MetaMask private key

  1. Head to your MetaMask account
  2. Click the kebab menu (three dots) on the furthest right
  3. Click Account details image
  4. Click Export private key
  5. Type in your MetaMask password
  6. Copy your private key (red text)
  7. Paste it in your .env file and name it PRIVATE_KEY

Note: Make sure you're in Polygon's Mumbai Testnet (How to add Mumbai Testnet)

How to add Polygon's Mumbai Testnet

  1. Head to your MetaMask browser extension
  2. Click your current network image
  3. Click Add network
  4. On the bottom part of the page, click Add a network manually image
  5. Fill the form with the following details:
Syntax Description
Network Name Mumbai Testnet
New RPC URL https://rpc-mumbai.maticvigil.com/
Chain ID 80001
Currency Symbol MATIC
Block Explorer URL https://polygonscan.com/

React App - client

Environment Variables

Note: Don't forget to replace the contract address if you redeploy your smart contract!

How to setup local dev environment

  1. Navigate to client
cd client
  1. Install dependencies
npm install
  1. Run local dev server script
npm run dev

About

🌐 A Polygon NFT-gated voting platform for the University of Santo Tomas Central Student Council

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published