https://github.com/rohitroy-github/vite-voting-dapp
This is a voting dapp made using ViteJS and Hardhat environment.
https://github.com/rohitroy-github/vite-voting-dapp
ethersjs hardhat nodejs smart-contracts solidity vite vitejs web3
Last synced: about 2 months ago
JSON representation
This is a voting dapp made using ViteJS and Hardhat environment.
- Host: GitHub
- URL: https://github.com/rohitroy-github/vite-voting-dapp
- Owner: rohitroy-github
- Created: 2023-05-12T06:13:21.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-04T08:31:10.000Z (about 1 year ago)
- Last Synced: 2025-04-04T09:30:53.610Z (about 1 year ago)
- Topics: ethersjs, hardhat, nodejs, smart-contracts, solidity, vite, vitejs, web3
- Language: JavaScript
- Homepage:
- Size: 127 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
|  |  |
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|  |  |
---
## 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](./LocalSetupGuide.md)**.
---
## Localhost (Steps To Run / Execute)
### backend-hardhat:
1. Navigate to the backend folder:
```sh
cd "backend-hardhat"
```
2. Install dependencies:
```sh
npm install
```
3. Compile contracts:
```sh
npx hardhat compile
```
4. Deploy contract (choose one):
```sh
# 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`
### Frontend:
1. Navigate to the frontend folder:
```sh
cd frontend
```
2. Install dependencies:
```sh
npm install
```
3. Run the development server:
```sh
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 ⭐! 😊