Description: This Solidity dApp enables users to participate in a decentralized voting system, ensuring transparency and immutability of the voting process. It allows users to register and vote for their preferred candidates in a secure and transparent manner. The system displays registered candidates and the leading candidate based on the votes received. It's built on the Ethereum blockchain. This project is a decentralized application built with Solidity, HTML, CSS, and JavaScript.
Main Contract: VotingSystem.sol
Features:
- Register new candidates.
- Cast votes for a candidate.
- Retrieve information about registered candidates.
- Check the leading candidate.
Steps:
-
Clone the repository to your local machine:
git clone <https://github.com/sidrahh12/Voting-System-DApp>
-
Navigate to the project directory:
cd <project-directory>
-
Install the required dependencies:
npm install
-
Compile the smart contract:
npx hardhat compile
-
Deploy the smart contract to your chosen Ethereum network. You'll need to set up a secrets.json file with your Ethereum wallet private key and network URL.
npx hardhat run scripts/deploy.js --network <network-name>
Replace with your desired Ethereum network (e.g., rinkeby, mainnet, or localhost for local development). -
Start the dApp locally:
npm start
The dApp should be accessible at http://localhost:3000.
Steps:
- Connect your Ethereum wallet (e.g., MetaMask) to the dApp.
- Register a new candidate by providing the necessary details.
- Vote for a candidate by selecting them.
- View all registered candidates.
- Check the leading candidate.
This project is licensed under the MIT License.