This is a decentralized application (DApp) for a voting system built on Ethereum.
- Node.js and npm
- Truffle
- Ganache (for local blockchain)
- MetaMask browser extension
-
Clone the repository:
git clone https://github.com/yourusername/voting-system-dapp.git cd voting-system-dapp -
Install dependencies:
npm install -
Start Ganache and make sure it's running on
http://localhost:7545. -
Compile and migrate the smart contracts:
truffle compile truffle migrate --network development -
Copy the contract address from the migration output and update it in
src/app.js.
-
Start the development server:
npm run dev -
Open your browser and navigate to
http://localhost:3000. -
Make sure MetaMask is connected to your local Ganache network (usually
http://localhost:7545). -
Interact with the DApp through the web interface.
To run the tests for the smart contracts:
truffle test
- If you encounter issues with contract deployment, make sure Ganache is running and your
truffle-config.jsis correctly configured. - If the web interface is not connecting to the contract, check that the contract address in
src/app.jsmatches the deployed contract address. - Ensure MetaMask is connected to the correct network and you have sufficient ETH for gas fees.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE.md file for details.