VoteDApp is a decentralized voting application built with Solidity for the smart contract and React.js for the frontend. This application allows users to interact with a voting contract deployed on a local Ethereum network.
Make sure you have the following installed:
Follow these steps to get the project up and running:
- Open Ganache and start a new workspace.
- Compile and deploy the contract to your local Ganache network. You can use tools like Truffle or Hardhat to deploy the contract.
-
After deploying the contract, copy the contract address.
-
Open
client/src/service/web3Service.jsand update the contract address variable with your deployed contract address:const contractAddress = 'YOUR_CONTRACT_ADDRESS';
- Open
client/src/Voting.json. - Replace the existing ABI with the ABI of your deployed contract.
-
Navigate to the
clientdirectory:cd client -
Install the necessary dependencies:
npm install
-
Start the development server:
npm start
-
Open your browser and go to
http://localhost:3000. Make sure your MetaMask is connected to the local Ganache network.
Once the application is running, you can interact with the voting contract through the web interface. Make sure you have MetaMask connected to your local Ganache network and have imported some accounts from Ganache.
This repository is licensed under two different licenses:
- Smart Contract (
contracts/Voting.sol): MIT License. See the header of the contract file for details. - Rest of the Repository: GNU General Public License v3.0. See the LICENSE file for details.