Decentrocast is a decentralized voting application built with ViteJS to provide a secure, transparent, and tamper-resistant voting experience.
The app currently supports both Localhost and the Ethereum Sepolia Testnet (via Alchemy RPC).
![]() |
![]() |
|---|---|
![]() |
![]() |
- Wallet-Based Authentication - Connect with MetaMask to participate in voting.
- One Wallet, One Vote - Each wallet address can cast only one vote.
- Live Voting Status - View whether voting is active or finished.
- Real-Time Candidate Table - See candidate list and vote counts in the UI with live updates.
- Dynamic Countdown Timer - Visual progress bar showing remaining voting time that updates every second.
- Vote Confirmation - See which candidate you voted for with their ID and name.
- Voting Loader - Real-time spinner feedback while vote is being submitted and processed.
- Transparent Final Results - Display winner and final vote totals after voting ends.
- Multi-Network Ready - Supports Localhost and Sepolia deployment workflows.
- Candidate Search - Vote by entering either the candidate index or name.
- Developer-Friendly Code - Well-commented Solidity smart contract for easy understanding.
- Vite JS + React - Fast and modern frontend development
- Tailwind CSS - Utility-first styling
- Ethers.js - Wallet connection and contract calls from UI
- Node.js - Server-side runtime
- Hardhat - Ethereum development framework
- Solidity - Smart contract implementation
- Metamask Wallet - User authentication and transaction signing
- Alchemy - Web3 RPC infrastructure for Sepolia
For a complete step-by-step guide to clone and run Decentrocast locally, see the Local Setup Guide.
- Navigate to the backend folder:
cd "backend-hardhat"
- Install dependencies:
npm install
- Compile contracts:
npx hardhat compile
- Deploy contract (choose one):
# Localhost npx hardhat run scripts/deploy.js --network localhost # Sepolia npx hardhat run scripts/deploy.js --network sepolia
- Copy the deployed CONTRACT_ADDRESS from terminal output and update:
frontend-vite/src/constants/constant.js
Run these from backend-hardhat:
npm run compile: runshardhat compilenpm test: runshardhat testnpm run node: runshardhat nodenpm run clean: runshardhat cleannpm run deploy: runshardhat run scripts/deploy.jsnpm run deploy:localhost: runshardhat run scripts/deploy.js --network localhost
These are the tests done for the backend smart contract setup:
- Navigate to the frontend folder:
cd frontend - Install dependencies:
npm install
- Run the development server:
npm run dev
- Open the local URL shown in terminal (usually
http://localhost:5173) and connect MetaMask.
The project is functionally complete and actively being improved.
Suggestions, issue reports, and pull requests are always welcome.
If you like the project, leave a ⭐! 😊



