Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

rohitroy-github/vite-voting-dapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

25 Commits

Repository files navigation

Decentrocast (EVM Based)

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).


Snapshots

image image
image image

Features

  • 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.

Tech Stack

Frontend:

  • Vite JS + React - Fast and modern frontend development
  • Tailwind CSS - Utility-first styling
  • Ethers.js - Wallet connection and contract calls from UI

Backend:

  • 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

Quick Setup Guide

For a complete step-by-step guide to clone and run Decentrocast locally, see the Local Setup Guide .


Localhost (Steps To Run / Execute)

backend-hardhat:

  1. Navigate to the backend folder:
    cd "backend-hardhat"
  2. Install dependencies:
    npm install
  3. Compile contracts:
    npx hardhat compile
  4. Deploy contract (choose one):
    # Localhost
    npx hardhat run scripts/deploy.js --network localhost
    # Sepolia
    npx hardhat run scripts/deploy.js --network sepolia
  5. Copy the deployed CONTRACT_ADDRESS from terminal output and update:
    • frontend-vite/src/constants/constant.js

Backend npm Scripts

Run these from backend-hardhat:

  • npm run compile: runs hardhat compile
  • npm test: runs hardhat test
  • npm run node: runs hardhat node
  • npm run clean: runs hardhat clean
  • npm run deploy: runs hardhat run scripts/deploy.js
  • npm run deploy:localhost: runs hardhat run scripts/deploy.js --network localhost

Backend Test Log

These are the tests done for the backend smart contract setup:

Frontend:

  1. Navigate to the frontend folder:
    cd frontend
  2. Install dependencies:
    npm install
  3. Run the development server:
    npm run dev
  4. Open the local URL shown in terminal (usually http://localhost:5173) and connect MetaMask.

Project Status & Contributions

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 ⭐! 😊

About

A Vite-powered decentralized voting application utilizing Solidity smart contracts for secure, one-wallet-one-vote transparency on the Ethereum network.

Topics

Resources

Stars

Watchers

Forks

Contributors

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /