Skip to content

Decentralised Voting App - A smartphone based voting app using blockchain technology

Notifications You must be signed in to change notification settings

darshanlahamage/Decentralised-Voting-App

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Decentralised Voting App

A smartphone based voting app using blockchain technology. Allows pre-registered users to login via OTP verification and vote registered candidates.

Features

  • OTP Verification
  • Fingerprint authenticated Voting
  • Realtime Voting Status
  • Deployed Public Contracts

API Reference

Twilio API

Required API Parameters - Refer Documentation

  client.verify.v2.services
Parameter Type Description
accountSid string Account Service Id
verifySid string Verify Service Id
authToken string Your API Key

Refer the above documentation for code snippets and example response

QuickNode API

Used for spinning up your own Ethereum Node

Parameter Type Description
HTTP Provider URL API Endpoint

Go to quicknode.com to set up your own sepolia endpoint or your prefered endpoint

MetaMask Private Key

Setup your MetaMask Wallet to get your Private Keys and add some test ethers in the Sepolia network or your prefered network

Environment Variables

To run this project, you will need to add the following environment variables to your .env file in respective Folders

Folder: server

TWILIO_AUTH_TOKEN

TWILIO_ACC_ID

TWILIO_VERIFY_ID

QuickNode_URL

PRIVATE_KEY1

VOTING_CONTRACT

VOTER_CONTRACT


Folder: voter-contract & voting-contract

QUICKNODE_KEY

PRIVATE_KEY

All the above API tokens and private keys can be obtained by following the API reference guides

VOTING_CONTRACT & VOTER_CONTRACT can be put once you deploy your contract.

QUICKNODE_KEY & QuickNode_URL are one and the same

PRIVATE_KEY obtained by setting up a metamask wallet

Run Locally

Clone the project

  git clone https://github.com/sandeepB3/Decentralised-Voting-App.git

Open 5 terminals and go to the each of the project directories

  cd server
  cd voter-contract
  cd voting-contract
  cd voting-App
  cd voting-portal

Install dependencies in all

  npm install

Step 1: Deploying Contracts

Create .env file in voter-contract & voting-contract folder & fill the env variables as stated above

  touch .env

Once you have setup the two enviorment variables deploy both the contract in both folders

  npx hardhat run scripts/deploy.js --network sepolia

Step 2: Setup your voting-portal web app

Inside the voting-portal folder change the value of contractAddress variable inside VotersPortal.js & VotingPortal.js to the new deployed contractAddressess

Similarly change the contents of Voters.json & VotingPortal.json inside the utils folder to the new contract ABI's present inside artifacts folder of voter-contract & voting-contract folder.

Start the Client

  npm start

Step 3: Setup your server

Create .env file in server folder & fill the env variables as stated above

  touch .env

Once you have setup the two enviorment variables run the server

  nodemon index.js

Step 4: Start your voting App

Start Client and scan the expo QR code using expo app

  npm start

Tech Stack

Client: React, react-router, Redux, React Native, Expo, Axios, Ethers.js

Server: Node.js, Express.js, Web3.js

Blockchain: Solidity, Hardhat, Sepolia

Tools: Metamask, QuickNode, Twilio

Screenshots

The below Screenshots shows the outputs of the step by step proccess flow

Deploying Contracts

Screenshot 2023-05-31 at 9 39 34 PM

Admin - User Interface

Screenshot 2023-05-31 at 9 39 42 PM

Client Application - Login & Verification

Screenshot 2023-05-31 at 9 40 01 PM

Client Application - Casting Votes

Screenshot 2023-05-31 at 9 40 13 PM

Client Application - Profile & Result Screen

Screenshot 2023-05-31 at 9 40 32 PM

Future Scope

  • Improving Transaction Speed with Solana Backend
  • Scalability using cloud platforms (AWS)
  • Implementing Advanced Security Measure
  • Improved UI & UX

About

Decentralised Voting App - A smartphone based voting app using blockchain technology

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 87.4%
  • Solidity 7.7%
  • HTML 2.8%
  • CSS 2.1%