Giter Site home page Giter Site logo

conuhacks-2022's Introduction

ConuHacks 2022 Challenge. Decentralized Election Platform

image

Objective

Build a decentralized election platform everyone in the galaxy would use to vote.

This is a decentralized voting system based on Blockchain technology, which is distributed over a network using smart contracts.

Guidelines

  • This github repo contains a full README to help you get started (see below) and a fully functional smart contract with voting capabilities, it's a good starting point! Use it or start from scratch, your choice!
  • Try to follow the theme
  • Have fun with it! Try things.
  • Provide a submission video (showcase) showing what you built, you should also present your ideas for future improvements.
  • Come hang out in the Gathertown (nventive, in career fair section), we have debug rooms where developers can help you get started!

Ideas of things to add/improve

don't limit yourself to this list

  • Improve the way to identify yourself, possibly via metamask.
  • Improve overall security of the React app and smart contract
  • Improve the UX/UI, make it easy to vote for everyone
  • Integrate your smart contract in the Ropsten test network

README

Getting Started - Setup

Additionnal step on Windows:

If you get the following error while running any script:

You'll need to run Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass.

Building the smart contract

  1. First, you'll need truffle to interact with the smart contract :
npm i -g truffle
  1. Truffle gives you a development environment with 10 accounts with Ethereum so you can interact with the contract, under the /contracts directory, run:
truffle develop
  1. Also, to compile the smart contract, under the /contracts directory, run:
truffle migration
  1. Update the backend.py file with the contract address that truffle migrate generates you. Also, update the private key list to the private keys given by truffle develop environment.

Here's some screenshots to help you with this step:

truffle migration Verify private keys

Backend

For the backend, you'll need Python and pip. If you don't have it, follow the instructions on https://www.python.org/downloads/.

  1. Let's create a virtual env for our project's dependencies on the root of the project:
pip install virtualenv
virtualenv venv
source venv/bin/activate -> .\Scripts\activate on Windows
pip install -r requirements.txt
  1. You can now run the backend by running:
python backend.py

Frontend

The frontend is a React app. To run it, first go to the /frontend directory and run:

yarn install
yarn start

You should see the login screen :

You can also access the voting results by accessing the http://localhost:3000/admin link. Username is test and password is test123:

Possible improvements

  • Add Metamask integration in the login page, currently to login, you simply enter a number from 0 to 9 that links to the proper account from the truffle environment.
  • Improve overall security of the React app/smart contract
  • Clean the frontend code, many components could be reused.
  • Add methods to the smart contract other than vote (vote delegation for example).
  • Integrate this smart contract in the Ropsten test network. You'll also need to use the Ropsten Ethereum Faucet to add test Ethereum to your accounts.

conuhacks-2022's People

Contributors

emilotypo avatar matfillion avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.