Skip to content

๐Ÿ—ณ๏ธBlockchain-based decentralized voting system ensuring transparency, security, and integrity using Ethereum smart contracts and Web3.js. Features anonymous voting, real-time counting, and tamper-proof results.

License

Notifications You must be signed in to change notification settings

Xavious2604/DVote-Horizon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ—ณ๏ธ DVote Horizon - Decentralized Voting System

DVote Horizon Logo

Deployed on GitHub Pages License Blockchain Smart Contract

๐Ÿ“‹ Overview

DVote Horizon is a blockchain-based decentralized voting system that ensures transparency, security, and integrity in the voting process. Built on Ethereum smart contracts, this application eliminates traditional voting vulnerabilities through cryptographic verification and immutable record-keeping.

This project demonstrates the practical implementation of Web3 technologies to solve real-world problems in democratic processes, making elections tamper-proof and fully auditable.

โœจ Key Features

๐Ÿ” Security & Transparency

  • Blockchain-Based: All votes are recorded on the Ethereum blockchain, ensuring immutability
  • Cryptographic Verification: Each vote is cryptographically secured and verifiable
  • Anonymous Voting: Voter privacy is maintained while ensuring vote authenticity
  • Tamper-Proof: Once cast, votes cannot be altered or deleted

๐ŸŽฏ Core Functionality

  • Real-Time Vote Counting: Instant vote tallying through smart contract logic
  • Multiple Candidate Support: Flexible system supporting various election types
  • Voter Authentication: Secure wallet-based voter identification
  • Transparent Results: All results are publicly verifiable on the blockchain
  • Audit Trail: Complete voting history maintained on-chain

๐Ÿ’ป Technical Capabilities

  • Web3 wallet integration (MetaMask)
  • Smart contract interaction through Web3.js
  • Responsive UI for desktop and mobile devices
  • Real-time blockchain transaction updates

๐Ÿ› ๏ธ Tech Stack

Frontend

  • HTML5 - Semantic markup structure
  • CSS3 - Modern styling and animations
  • JavaScript (ES6+) - Interactive user interface
  • Web3.js - Ethereum blockchain interaction library

Blockchain

  • Solidity - Smart contract development
  • Ethereum - Blockchain platform
  • Hardhat - Development environment and testing framework
  • Ethers.js - Ethereum wallet implementation

Deployment

  • GitHub Pages - Frontend hosting
  • Ethereum Testnet - Smart contract deployment (Sepolia/Goerli)

๐Ÿ“ Project Structure

DVote-Horizon/
โ”œโ”€โ”€ index.html              # Main application interface
โ”œโ”€โ”€ VotingSystem.sol        # Ethereum smart contract
โ”œโ”€โ”€ deploy.js               # Contract deployment script
โ”œโ”€โ”€ hardhat.config.js       # Hardhat configuration
โ”œโ”€โ”€ package.json            # Project dependencies
โ”œโ”€โ”€ bg.mp4                  # Background video assets
โ”œโ”€โ”€ Dvote.png               # Project logo
โ””โ”€โ”€ .github/
    โ””โ”€โ”€ workflows/
        โ””โ”€โ”€ static.yml      # GitHub Actions CI/CD

๐Ÿš€ Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v14 or higher)
  • npm or yarn
  • MetaMask browser extension
  • Git

Installation

  1. Clone the repository
git clone https://github.com/Xavious2604/DVote-Horizon.git
cd DVote-Horizon
  1. Install dependencies
npm install
  1. Configure Hardhat

Edit hardhat.config.js with your network settings:

module.exports = {
  solidity: "0.8.19",
  networks: {
    sepolia: {
      url: "YOUR_ALCHEMY_OR_INFURA_URL",
      accounts: ["YOUR_PRIVATE_KEY"]
    }
  }
};
  1. Compile smart contracts
npx hardhat compile
  1. Deploy smart contract
npx hardhat run deploy.js --network sepolia
  1. Update contract address

After deployment, update the contract address in index.html with the deployed address.

  1. Run locally

Open index.html in your browser or use a local server:

npx serve .

๐Ÿ“ How to Use

For Voters

Connect Wallet

  • Install MetaMask extension
  • Connect your Ethereum wallet to the application
  • Ensure you're on the correct network (Sepolia/Goerli testnet)

View Candidates

  • Browse available candidates and their information
  • Review voting options

Cast Your Vote

  • Select your preferred candidate
  • Confirm the transaction in MetaMask
  • Wait for blockchain confirmation

Verify Vote

  • Check transaction on Etherscan
  • View updated vote counts in real-time

For Election Administrators

  • Deploy Contract: Use Hardhat to deploy a new voting instance
  • Add Candidates: Initialize candidates through smart contract
  • Set Voting Period: Configure start and end times
  • Monitor Results: Track votes in real-time through the dashboard

๐Ÿงช Testing

Run the test suite to verify smart contract functionality:

# Run all tests
npx hardhat test

# Run with gas reporting
REPORT_GAS=true npx hardhat test

# Run local blockchain node
npx hardhat node

๐Ÿ”’ Smart Contract Overview

The VotingSystem.sol smart contract includes:

  • Candidate Registration: Add and manage candidates
  • Vote Casting: Secure voting mechanism with duplicate prevention
  • Result Calculation: Real-time vote counting
  • Access Control: Admin functions for election management
  • Event Logging: Emit events for all major actions

Key Functions

function vote(uint candidateId) public
function addCandidate(string memory name) public onlyAdmin
function getResults() public view returns (uint[] memory)
function endVoting() public onlyAdmin

๐ŸŒ Live Demo

๐ŸŽฏ Use Cases

  • Government Elections: Local and national voting systems
  • Corporate Governance: Shareholder voting and board elections
  • Academic Institutions: Student council elections
  • DAOs: Decentralized organization decision-making
  • Community Polls: Transparent community voting

๐Ÿ”ฎ Future Enhancements

  • Multi-signature voting for enhanced security
  • Integration with decentralized identity (DID) systems
  • Mobile application (React Native)
  • Support for ranked-choice voting
  • Integration with IPFS for candidate information storage
  • Real-time analytics dashboard
  • Multi-language support
  • Layer 2 scaling solutions (Polygon, Arbitrum)

๐Ÿค Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ‘จโ€๐Ÿ’ป Developer

Mohammed Irfan Shaikh

๐Ÿ™ Acknowledgments

  • Ethereum Foundation for blockchain infrastructure
  • OpenZeppelin for smart contract libraries
  • Hardhat for development framework
  • MetaMask for wallet integration

๐Ÿ“Š Project Stats

GitHub stars GitHub forks GitHub issues GitHub pull requests


Made with โค๏ธ for a transparent and secure voting future

โญ Star this repository if you find it helpful!

About

๐Ÿ—ณ๏ธBlockchain-based decentralized voting system ensuring transparency, security, and integrity using Ethereum smart contracts and Web3.js. Features anonymous voting, real-time counting, and tamper-proof results.

Topics

Resources

License

Stars

Watchers

Forks