SolVote

Welcome to the Decentralized Voting Platform, a web3 application built on the Solana blockchain. This platform allows users to create, participate, and interact with decentralized polls securely and transparently.

Stars
3
Committers
1

🗳️ Decentralized Voting Platform on Solana

Welcome to the Decentralized Voting Platform, a web3 application built on the Solana blockchain. This platform allows users to create, participate, and interact with decentralized polls securely and transparently.

🚀 Project Overview

This project leverages the power of the Solana blockchain to provide a decentralized solution for voting. With a focus on security, transparency, and user experience, the platform is designed to be scalable, fast, and user-friendly. It includes a robust frontend built with Next.js and TypeScript, a backend powered by Node.js and Express.js, and integration with Solana using the Web3.js SDK.

🎨 Features

  • Decentralized Poll Creation: Users can create polls that are stored and managed on the Solana blockchain.
  • Secure Voting: Votes are recorded on-chain, ensuring transparency and immutability.
  • Real-time Results: Poll results are updated in real-time, providing instant feedback.
  • Wallet Integration: Users can connect their Solana wallets (e.g., Phantom) to participate in voting.
  • Responsive Design: The platform is fully responsive, providing an optimal user experience across devices.

🛠️ Tech Stack

Frontend

  • Next.js: For building the frontend with server-side rendering and optimized performance.
  • TypeScript: To ensure type safety and improve code maintainability.
  • React: The core library for building UI components.
  • Tailwind CSS: A utility-first CSS framework for styling.
  • Solana Wallet Adapter: For wallet integration with popular Solana wallets like Phantom.

Backend

  • Node.js: The runtime environment for executing server-side code.
  • Express.js: A web application framework for building RESTful APIs.
  • Solana Web3.js: The official JavaScript SDK for interacting with the Solana blockchain.
  • Anchor Framework: To simplify the development and deployment of Solana smart contracts.

Blockchain Integration

  • Solana Program Library (SPL): For writing and deploying on-chain voting programs.
  • Solana CLI: For interacting with the Solana blockchain during development.

Database (Optional)

  • MongoDB: For storing off-chain data such as user profiles and poll metadata.

Testing & Development Tools

  • Jest: For unit and integration testing of frontend components.
  • Mocha/Chai: For backend testing.
  • Anchor's Testing Framework: For smart contract testing.
  • Docker: For containerizing the application.

Deployment

  • Vercel: For deploying the Next.js frontend with built-in serverless functions support.
  • Solana Devnet/Testnet/Mainnet: For deploying and testing smart contracts.

📦 Dependencies

Frontend Dependencies

To install the frontend dependencies, navigate to the frontend directory and run:

npm install next react react-dom typescript tailwindcss @solana/wallet-adapter-react @solana/wallet-adapter-wallets @solana/web3.js

Backend Dependencies

To install the backend dependencies, navigate to the backend directory and run:

npm install express typescript solana-web3.js anchor

Wallet Integration

Wallet integration dependencies are typically part of the frontend installation. However, if needed separately, you can install them with:

npm install @solana/wallet-adapter-react @solana/wallet-adapter-wallets @solana/web3.js

🛠️ Installation and Setup

Prerequisites

  • Node.js (v14.x or higher)
  • npm or yarn
  • Docker (optional, for containerization)
  • Solana CLI (for blockchain interaction)
  • Anchor CLI (for smart contract development)

Clone the Repository

git clone https://github.com/your-username/SolVote.git
cd SolVote

Install Frontend Dependencies

cd frontend
npm install
# or
yarn install

Install Backend Dependencies

cd backend
npm install
# or
yarn install

Configure Environment Variables

Create a .env.local file in the frontend and backend directories with the following variables:

Frontend .env.local

NEXT_PUBLIC_SOLANA_NETWORK=devnet
NEXT_PUBLIC_SOLANA_RPC_URL=https://api.devnet.solana.com

Backend .env.local

SOLANA_NETWORK=devnet
SOLANA_RPC_URL=https://api.devnet.solana.com

Run the Development Server

Frontend

cd frontend
npm run dev
# or
yarn dev

Backend

cd backend
npm run dev
# or
yarn dev

Smart Contract Deployment

  1. Compile your Solana programs using Anchor:

    anchor build
    
  2. Deploy your programs to Solana Devnet:

    anchor deploy
    

Here's the updated Contributing section with detailed steps:


👥 Contributing

We welcome contributions from the community! Follow these steps to contribute:

  1. Fork the Repository Click the "Fork" button on the top right corner of the repository page on GitHub to create your own copy of the project.

  2. Clone the Forked Repository Clone your forked repository to your local machine by running:

    git clone https://github.com/your-username/solana-voting-platform.git
    

    Replace your-username with your GitHub username.

  3. Create a New Branch Create a new branch to work on your feature or bugfix:

    git checkout -b feature-name
    

    Replace feature-name with a descriptive name for your branch.

  4. Make Your Changes Implement your changes or new features in your local branch.

  5. Commit Your Changes Commit your changes with a descriptive commit message:

    git add .
    git commit -m "Add feature: description of the feature"
    
  6. Push to Your Fork Push your changes to your forked repository:

    git push origin feature-name
    
  7. Create a Pull Request Go to the original repository on GitHub and click the "Compare & pull request" button. Provide a clear description of your changes and submit the pull request.

  8. Respond to Review Comments The project maintainers may review your pull request and leave comments or request changes. Be sure to respond to these comments and make any necessary updates.

  9. Merge Once your pull request is approved, it will be merged into the main branch. Congratulations on your contribution!

🙌 Acknowledgments

  • Solana for providing a fast and scalable blockchain.
  • Anchor for simplifying Solana smart contract development.
  • Vercel for providing an amazing deployment platform.