Skip to content

InfooGeek/Decentralized-Voting-System-using-Blockchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Decentralized Voting System using Blockchain Technology

Technology Used

  1. Solidity
  2. React, Nodejs
  3. Javascript
  4. HTML CSS
  5. Truffle and Ganache

System Workflow

A brief explanation on the basic workflow of the application.

  • Admin will create a voting instance by launching/deploying the system in a blockchain network (EVM), then create an election instance and start the election with the details of the election filled in (including candidates for voters to vote).
  • Then the likely voters connect to the same blockchain network register to become a voter. Once the users successfully register, their respective details are sent/displayed in the admins' panel (i.e. verification page).
  • The admin then will check if the registration information (blockchain account address, name, and phone number) is valid and matches with his record. If yes, then the admin approves the registered user making them eligible to take part and cast their respective vote in the election.
  • The registered user (voter) following the approval from the admin casts their vote to the candidate of interest (from the voting page).
  • After some time, depending on the scale of the election the admin ends the election. As that happens the voting is closed and the results are displayed announcing the winner at the top of the results page.

Setting up the development environment

Requirements

Getting the requirements

  1. Download and install NodeJS

    Download and install NodeJS from here.

  2. Install truffle and ganache-cli using node packager manager (npm)

    npm install -g truffle
    npm install -g ganache
  3. Install metamask browser extension

    Download and install metamask from here.

    For Arch linux:

     sudo pacman -Syu
     sudo pacman -S nodejs
     npm install -g ganache
     npm install -g truffle

Configuring the project for development

  1. Clone this repository

    git clone https://github.com/InfooGeek/Decentralized-Voting-System-using-Blockchain
    cd Decentralized-Voting-System-using-Blockchain
  2. Run local Ethereum blockchain

    ganache

    Note: Do not close ganache (the blockchain network needs to be running all the time)

  3. Configure metamask on the browser with the following details

    New RPC URL: http://localhost:8545
    Chain ID: 1337

  4. Import account(s) using private keys from ganache-cli to the metamask extension on the browser

  5. Deploy smart contract to the (local) blockchain network (i.e ganache)

    #on the root directory
    truffle console
    migrate --reset

    or

    truffle migrate

    Note: Use truffle migrate --reset for re-deployments

  6. Launch the development server (frontend)

    cd client
    npm install #for the first time to install dependencies
    npm start

To-Do List

Possible features to add/improve within the app.

  • Email Verification—adding email/phone verification (OTP, etc..) while registering for voters.
  • Automated Verification—adding an automated verification (rather than manually approving by the admin) for the registered users. This could be based on the custom cooperation email, custom list of emails, or custom list of phone numbers, etc.
  • Report—option to generate a report at the end of an election. The report could contain a range of information including the number of people that were eligible to vote, the number of people that participated in the election, a bar-chart/pie-chart showing the election statistics, etc.
  • Workflow improvements—overall workflow improvements (eg. option to add candidates within the election setup page), with overall GUI improvements.
  • Multiple election instance—ability to create multiple election instances without having to re-deploy the smart contract.
  • Use of token to vote instade of native currency—each voter will get a token on registration-verification, using that they can voter only once, it will remove the use of state/hooks in react and can be easy for the voters as well.

License

MIT License

Yog Raj Dhakal (Loma) - MU

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors