The Voting Application is a decentralized system that utilizes blockchain technology to manage and conduct elections. It provides a transparent and secure way for users to register, vote, and view election results. The following document outlines the basic workflow of the application.
- Admin Role:
- The administrator initiates the election process by deploying the application on a blockchain network (Ethereum Virtual Machine, EVM).
- The admin creates a new election instance and enters the election details, including the list of candidates available for voters to choose from.
- Voter Role:
- Prospective voters connect to the same blockchain network and register to become eligible voters.
- Upon successful registration, the voter's details are sent to the admin's dashboard for verification.
- Admin Role:
- The administrator reviews the submitted registration details (blockchain account address, name, and phone number) to ensure accuracy and consistency with existing records.
- If the details are verified and valid, the admin approves the registration, making the voter eligible to participate in the election.
- Voter Role:
- Once approved, the voter accesses the voting page to cast their vote for their preferred candidate.
- Admin Role:
- After the designated voting period concludes, the admin ends the election.
- The system then closes the voting process and displays the results, with the winning candidate prominently announced at the top of the results page.
-
Download and install NodeJS
Download and install NodeJS from here.
-
Install truffle and ganache-cli using node packager manager (npm)
npm install -g truffle npm install -g ganache-cli
-
Install metamask browser extension
Download and install metamask from here.
-
Clone this repository
git clone https://github.com/sharma-rakshit/dVoting.git cd dVoting -
Run local Ethereum blockchain
ganache-cli
Note: Do not close
ganache-cli(the blockchain network needs to be running all the time) -
Configure metamask on the browser with the following details
New RPC URL:
http://127.0.0.1:8545(useport: 7545for ganache gui, update it in the file:truffle-config.jsas well)Chain ID:
1337 -
Import account(s) using private keys from ganache-cli to the metamask extension on the browser
-
Deploy smart contract to the (local) blockchain network (i.e ganache-cli)
# on the dVoting directory truffle migrateNote: Use
truffle migrate --resetfor re-deployments -
Launch the development server (frontend)
cd client npm install npm startIf you encounter error during
npm install, please note that you might need to install Microsoft Visual C++ Redistributable packages from learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist (here is the direct download link for X64: aka.ms/vs/17/release/vc_redist.x64.exe)
Made with ❤️ by Rakshit Sharma.