Bu loyiha Flask va Solidity yordamida qurilgan, foydalanuvchilar Ethereum blockchain asosida xavfsiz ovoz berishda ishtirok etishlari mumkin bo‘lgan tizimdir. Har bir saylov alohida Voting.sol kontrakti sifatida blockchain'ga joylanadi.
- Har bir saylov uchun alohida
Voting.solsmart-kontrakt deploy qilinadi - Nomzodlar faqat saylov boshlanishidan oldin qo‘shilishi mumkin
- Har foydalanuvchi faqat bir marta ovoz bera oladi
- Ovozlar Ethereum blockchain'da saqlanadi
- Saylov natijalari jadval ko‘rinishida ko‘rsatiladi
- Natijalarni CSV holatda yuklab olish mumkin
- Admin panel orqali foydalanuvchilar va saylovlar boshqariladi
Python 3.10+FlaskSolidityWeb3.pyGanache CLIBootstrap 5 + Chart.jsSQLite
git clone https://github.com/MuxammadiyevG/ChainVoting.git
cd ChainVotingpython3 -m venv .venv
pip install -r requirements.txt- 'Arch linux' `yay -S ganache-cli`
- boshqa dirstolarda (Windows , va hk ) npm install -g ganache-cli ganache-cli --host 127.0.0.1 --port 7545 BLOCKCHAIN_PROVIDER=http://127.0.0.1:7545
ADMIN_ADDRESS=0xyour_address
ADMIN_PRIVATE_KEY=0xyour_private_keypython3 contracts/compile.pypython3 app.pyA secure and decentralized voting system built with Flask and Solidity, allowing users to participate in blockchain-based elections. Each election is deployed as a separate smart contract on the Ethereum blockchain for transparency and integrity.
✅ Deploys a unique Voting.sol smart contract for every election
✅ Candidates can only be added before the election starts
✅ One vote per user guarantee
✅ All votes are securely stored on the Ethereum blockchain
✅ Live election results in table format
✅ Export results as CSV
✅ Admin panel for managing users and elections
- Python 3.10+
- Flask
- Solidity
- Web3.py
- Ganache CLI (local Ethereum test network)
- Bootstrap 5 + Chart.js (Frontend)
- SQLite (Database)
git clone https://github.com/MuxammadiyevG/ChainVoting.git
cd ChainVotingpython3 -m venv .venv
source .venv/bin/activate # Linux / macOS
# OR
.venv\Scripts\activate # Windows
pip install -r requirements.txt# Arch Linux
yay -S ganache-cli
# Other Systems (Windows, Mac, Ubuntu)
npm install -g ganache-cliganache-cli --host 127.0.0.1 --port 7545Create a .env file in the project root with your settings:
BLOCKCHAIN_PROVIDER=http://127.0.0.1:7545
ADMIN_ADDRESS=0xyour_address
ADMIN_PRIVATE_KEY=0xyour_private_keyReplace 0xyour_address and 0xyour_private_key with values from Ganache accounts.
Compile the Solidity smart contract to generate ABI & Bytecode:
python3 contracts/compile.pypython3 app.pyVisit: http://127.0.0.1:5000 to access the application.
