Git Product home page Git Product logo

blockchain-voting's Introduction

BlockChain Voting DApp

This is a minimal DApp that enables voting and vote tallying on the block chain.

It has a smart contract implemented in the solidity language that acts as a backend and a minimal front end built with React js.

Project Inspiration

The main inspiration behind this project is the upcoming ( as of this writing ) General election in Kenya.

Out of curiousity, I wondered what it would be like if the election would be conducted on blockchain tech and with that idea in mind, this DApp was created.

How it works

  • The smart contract takes candidates' names and voter Addresses ( These should be blockchain addresses unique to each voter ) on deployment and these are stored on chain ( this could be quite expensive ). Out of this a voter register ( an array of voter address ) is created.
  • On the front-end, the deployer of the contract should also provide a copy of the voters' register to which is used to validate users who are eligible to vote.

Landing Page

  • If the address provided exists in the voters' register, the user is then redirected to the voting page where they select a candidate of their choice and submit.

Voting Page

  • On submission, the smart contract validates that the user address exists on the voter register stored on chain and that they have not cast a vote yet. If these requirements are met, the users vote is counted and added to the total tally and the supplied address marked as voted.

  • The contract also implements a 60% voter turnout threshold; i.e For the election to be valid, at least 60% of all registered voters should vote.

  • As soon as voting is concluded, election results can be view of the results page where there is tabulated data showing who won the election, the number of votes they got and a percentage margin of how much they got from the total votes cast.

Results Page

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.