This project is a blockchain-based voting decentralized application (DApp) created using React and Solidity.
“Blockchain Based Voting System” is a web-based online voting system built on the Ethereum blockchain. It leverages blockchain technology to provide a transparent, distributed, immutable, and trustless ledger, addressing issues in traditional voting systems such as security and trust.
- Decentralized & Transparent: No central authority controls the votes.
- Trustless: The system's integrity is guaranteed by the blockchain, not a third party.
- Immutable: Once cast, votes cannot be altered.
The system is deployed by an Admin who adds eligible voters and candidates. The admin starts the election, allowing voters to cast their ballots for their preferred candidate. Once the election ends, results are immediately available and verifiable.
- Ganache: A personal blockchain for Ethereum development.
- Node.js & Yarn: For running the client application.
- Truffle: For compiling and migrating smart contracts.
- MetaMask: A crypto wallet browser extension.
Open the Ganache GUI client to start your local blockchain instance.
Open a terminal in the project root and run:
truffle migrate --resetNote: You must migrate the election smart contract each time you restart Ganache.
- Unlock MetaMask in your browser.
- Connect MetaMask to the local Ethereum blockchain provided by Ganache (usually
http://127.0.0.1:7545). - Import an account provided by Ganache into MetaMask using its private key.
Navigate to the client directory and start the application:
cd client
yarn install # Only the first time
yarn startVisit http://localhost:3000 in your browser to interact with the application.