GithubHelp home page GithubHelp logo

sandeepb3 / decentralised-voting-app Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 2.0 2.88 MB

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

JavaScript 74.56% Solidity 7.64% HTML 2.82% CSS 2.09% TypeScript 12.89%

decentralised-voting-app's Introduction

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

decentralised-voting-app's People

Contributors

sandeepb3 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.