Poll Booth
This is a decentralized application built using Solidity and React.
Features of this application
- Voters can only be registered by one specific account.
- Voters won't be registered by name. Only their addresses. Hence, 1 account can only have one voter.
- Candidates can register themselves. They can enter their name and click Register and a candidate by the name written would be registered at that address.
- One address can only have one candidate to it.
- Vote can only be cast from the accounts registered as voters.
- Once the vote is cast from an address, another vote cannot be cast to maintain the integrity of the application.
Using the application
The application is deployed on Kovan Testnet. So, select Kovan network in your metamask wallet to interact with the application. Metamask is required to use the application. Voters have to be registered by the contract owner, but Candidates can register themselves in the election.
App Screenshot
Setting up Ganache
- Open ganache. Click on Create New Workspace.
- On the truffle project menu, add the truffle-config.js file of this project.
- Go to server and set port number to 7545.
- Click save workspace and it'll start a new blockchain instance. Every time you open ganache, you can select this workspace and view your transactions.
Setting up Metamask
- Download metamask extenstion from https://metamask.io/
- After installation, it'll take you to a window to set a password. Select the option to import wallet from seed phrase and set a password.
- Use the mnemonic from the ganache instance.
- A localhost blockchain would be added in the list of networks. Change the port number to 7545. Set the chain id as 1337.
- Then you'll see, metamask will ask your permission to connect all the 10 accounts to the webapp.
- Initially only the first account would be connected. Click on add account, then the second account would be added, then third and so on.
Setting up the local development environment
Run the ganache Blockchain and type the following commands in terminal:
git clone https://github.com/arpitkarnatak/election-dapp.git \ npm install \ truffle compile \ truffle migrate (or truffle migrate --reset) \ cd client \ npm install \ npm start
(truffle migrate if using for the first time. truffle migrate --reset for everytime you want to create a new contract instance and wipe out the old data.) \ (For running the application anytime afterwards, just start the Ganache workspace created and go to the client folder and npm start)

Log in or sign up for Devpost to join the conversation.