Votee is a decentralized polling application built on the Solana blockchain, allowing users to create polls, register candidates, and vote in a transparent and secure manner. It leverages modern technologies and blockchain infrastructure to provide an interactive and decentralized voting experience.
- Create Polls: Users can create polls with descriptions, start dates, and end dates.
- Register Candidates: Candidates can register to participate in active polls.
- Vote on Polls: Users can cast votes for registered candidates in active polls.
- Real-Time Updates: Poll details and candidate lists are fetched directly from the blockchain.
- Wallet Integration: Seamlessly connect and interact using Solana-compatible wallets like Phantom.
- Toast Notifications: Get feedback on transactions, including success, pending, or failure statuses.
- Displays a welcome interface and navigation links for creating polls or voting.
- Form-based interface for creating new polls with fields for:
- Poll Description: A brief description of the poll's purpose.
- Start Date: The start date and time of the poll.
- End Date: The end date and time of the poll.
- Allows candidates to register for a specific poll.
- Input field for entering the candidate’s name.
- Accessible through an active poll's detail page.
- Displays active polls and their registered candidates.
- Allows users to vote for their preferred candidate.
- Displays real-time voting statistics for transparency.
- Frontend:
- Next.js
- TypeScript
- React
- Redux Toolkit
- Tailwind CSS
- React Icons
- Blockchain Integration:
- Solana Web3.js
- @coral-xyz/anchor
- Solana Wallet Adapter
- Phantom Wallet
- Notifications:
- React Toastify
Wallet Required: Before using this dApp, ensure you have a Solana-compatible wallet like Phantom installed. You can download it here.
Default Solana Cluster: The application assumes a local Solana network for development. Ensure your Solana CLI is set to the correct cluster.
solana config set --url http://127.0.0.1:8899
- Clone the Repository
git clone https://github.com/YourUsername/votee
cd votee
- Install Dependencies
npm install
- Set Up Environment Variables Create a .env file in the root directory and add the following variable for local development:
NEXT_PUBLIC_RPC_URL=http://127.0.0.1:8899
- Run Local Solana Test Validator If not already running, start a Solana test validator on your local machine:
solana-test-validator
- Launch the Development Server
npm run dev
- Build for Production For production, build and start the application:
npm run build
npm start
-
Open the application in your browser: http://localhost:3000.
- Connect your wallet using the Wallet Adapter button.
- Create a poll, register candidates, and vote directly on the blockchain.
-
pages/:
- index.tsx: Homepage.
- create.tsx: Poll creation page.
-
services/:
- blockchain.service.ts: Functions for interacting with the blockchain (e.g., createPoll, registerCandidate).
-
utils/:
- Types and helper functions for application logic.
Contributions are welcome! If you have suggestions, feature requests, or bug reports, please create an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.