{"id":20162700,"url":"https://github.com/codeamt/ethelection","last_synced_at":"2025-03-03T03:10:30.468Z","repository":{"id":201923590,"uuid":"137019635","full_name":"codeamt/EthElection","owner":"codeamt","description":"A sample voting dapp powered by the Ethereum blockchain, the Truffle Framework and Metamask.","archived":false,"fork":false,"pushed_at":"2018-06-15T00:53:00.000Z","size":39932,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T14:19:35.401Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeamt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-06-12T05:05:38.000Z","updated_at":"2018-06-15T00:53:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"799d49d7-d6e9-4c38-8729-91c1ec192b2d","html_url":"https://github.com/codeamt/EthElection","commit_stats":null,"previous_names":["codeamt/ethelection"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeamt%2FEthElection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeamt%2FEthElection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeamt%2FEthElection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeamt%2FEthElection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeamt","download_url":"https://codeload.github.com/codeamt/EthElection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241600518,"owners_count":19988715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T00:26:30.255Z","updated_at":"2025-03-03T03:10:30.442Z","avatar_url":"https://github.com/codeamt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eEthElection\u003c/h1\u003e\n\u003cp\u003eThis is a simple example decentralized app (dApp) to demonstrate voting via the Ethereum blockchain, powered by:\u003c/p\u003e \n\n\u003cp align=\"center\"\u003e\n  \n\u003cimg src=\"https://ucarecdn.com/b787bba8-3f2d-47b3-8073-76c830fc023e/\" width=\"40%\" height=\"30%\" /\u003e\n\u003c/p\u003e\n\n## Demo on Ginache Network \n\nThis demo is hosted on Heroku and works if you (1) have a local Ginache network running on your system and (2) the Metamask extension for your browser installed. More details on installing dependencies below.\n\n\u003cp align=\"center\"\u003e\n  \n\u003cimg src=\"https://ucarecdn.com/43313289-e260-4fd0-a940-c57322a952f7/\" width=\"70%\" height=\"60%\" /\u003e\n\u003c/p\u003e\n\n- Live Demo: [https://eth-election.herokuapp.com/](https://eth-election.herokuapp.com/)\n\n## Running Repo Locally \n\nTo run the app in your own development environment, do the following\n\n\u003cb\u003e1. Install Homebrew: \u003c/b\u003e\n\nIn the terminal:\u003cbr\u003e\n```\n/usr/bin/ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"\nbrew update\nbrew doctor\nbrew prune\nbrew -v\n```\n\u003cbr\u003e\n\n\u003cb\u003e2. Install Node, NPM, Weback and Truffle \u003c/b\u003e\n\nNow, install build essentials (if you don't have these already:\u003cbr\u003e\n```\nbrew install node               #installs both node and npm\nnpm install -g truffle\nnpm install -g webpack          #for the cli\nnode -v\nnpm -v\ntruffle -v \nwebpack -v\n```\n\n\u003cb\u003e3. Clone this repo \u003c/b\u003e\n\nThen, clone a copy of this repo:\u003cbr\u003e\n```\ngit clone https://github.com/codeamt/EthElection.git\n```\n\u003cbr\u003e\n\n\u003cb\u003e4. Download/Install Truffle's Ginache \u003c/b\u003e\n\nGinache sets up a local rpc server and blockchain for testing purposes. It also comes with 5 Ethereum test accounts, preloaded with ether. \n\nDownload here: [Ginache Download for Mac OS](https://github.com/trufflesuite/ganache/releases/download/v1.1.0/Ganache-1.1.0.dmg) \n\n\nOnce downloaded and launched, your dashboard should look like this: \u003cbr\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://ucarecdn.com/5344d135-e773-4733-a5bd-073d52fd2e93/\" width=\"70%\" height=\"60%\" /\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\n\u003cb\u003e5. Install/Setup Metamask \u003c/b\u003e\n\nMetamask has a few extensions available, depending upon your preferred browser (Chrome, Firefox, or Opera), but also\noffers their own web3 browser [Brave](https://brave.com/).\n\nTo get the right extension, download [here](https://metamask.io/). \n\nOnce you've completed the Metamask onboarding process, switch the network from the MainNet to your local rpc. \n\n\u003cb\u003eSteps:\u003c/b\u003e\n- In Ginache, copy the RPC server url up at the top (which should be http://127.0.0.1:7545)\n- Go back to the Metamask extension, click on the drop down menu where it says MainNet and select the \"Custom RPC\" option: \u003cbr\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://ucarecdn.com/0cc9e6fe-e32d-45fd-bca4-6663dcb14561/\" width=\"40%\" height=\"50%\" /\u003e\n\u003c/p\u003e\u003cbr\u003e\n- Then paste the Ginache RPC url where it says \"New RPC url\" and save: \u003cbr\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://ucarecdn.com/e3ec46b7-62ab-4da9-9e8a-8b1b60e57be2/\" width=\"40%\" height=\"50%\" /\u003e\n\u003c/p\u003e\u003cbr\u003e\n\nMetamask will automagically import your first eth address listed in Ginache.\n\u003cbr\u003e\n\n\u003cb\u003e6. Build the Project and Vote! \u003c/b\u003e\n\nIn the terminal:\u003cbr\u003e\n```\ncd electionDemo \u0026\u0026 npm run dev\n```\n\u003cbr\u003e\nNow go to http://localhost:7545 in the browser, and the dapp should be running! You're allowed one vote per address! \n\u003cbr\u003e\u003cbr\u003e\n\n\u003cb\u003e7. Import Addresses to Test Vote Incrementing \u003c/b\u003e \n\nIf you want to see the Result board increment more than once, you'll have to import more eth addresses from Ginache into Metamask. To achieve this: \n\n\u003cb\u003eSteps:\u003c/b\u003e\n- In Ginache, under accounts, click on the key icon by one of the other accounts you'd like to sync with Metamask to copy it's private key. \n- Back in Metamask, click on the user profile icon and select \"import address\" \n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://ucarecdn.com/2d863f84-1def-43d3-a302-b3786f34525b/\" width=\"40%\" height=\"50%\" /\u003e\n\u003c/p\u003e\u003cbr\u003e\n\n- Paste the private key you copied into the input:\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://ucarecdn.com/00e387cd-20b0-4a9f-9aec-bd7c780e81d5/\" width=\"40%\" height=\"50%\" /\u003e\n\u003c/p\u003e\u003cbr\u003e\n\nAfter you switch to that account, you can cast another vote and see the vote count for your candidate go up again! \n\u003cbr\u003e\n\n## Future Updates\nIn coming weeks, I'll be updating the smart contracts in order to save end users from having to spend money (albeit, fake) to vote. Stay tuned! \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeamt%2Fethelection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeamt%2Fethelection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeamt%2Fethelection/lists"}