A secure and comprehensive voting application for class representative elections, built with modern web technologies.
voting-app/
├── backend/ # Deno-based API server with Hono
│ ├── server/ # API endpoints and business logic
│ ├── package.json # Backend dependencies
│ └── deno.json # Deno configuration
├── frontend/ # React-based frontend with Vite
│ ├── src/ # React components and pages
│ ├── package.json # Frontend dependencies
│ └── vite.config.ts # Vite configuration
└── package.json # Root package.json for monorepo management
- Email-based voter authentication
- Secure voting links with tokens
- Hashed email storage for privacy
- CORS protection and input validation
- Class-specific candidate visibility
- Multi-question voting with weighted scoring
- Real-time results calculation
- Vote verification and completion tracking
- Responsive design with Tailwind CSS
- Dark mode support
- Smooth animations and transitions
- Accessible UI components with Radix UI
Backend:
- Deno runtime for server-side JavaScript
- Hono framework for API routing
- Supabase for database and authentication
- Key-value storage for session management
Frontend:
- React 18 with TypeScript
- Vite for fast development and building
- Tailwind CSS for styling
- Radix UI for accessible components
- Node.js 18+ and npm
- Deno runtime
- Supabase account and project
-
Clone the repository:
git clone https://github.com/Innocent-ICS/Voter.git cd Voter -
Install dependencies:
npm run install:all
-
Set up environment variables: Create a
.envfile in the backend directory with:SUPABASE_URL=your_supabase_url SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
-
Start the development servers:
npm run dev
This will start both backend (port 8000) and frontend (port 3000) servers.
npm run dev- Start both backend and frontend in development modenpm run dev:backend- Start only the backend servernpm run dev:frontend- Start only the frontend servernpm run build- Build both backend and frontend for productionnpm run start- Start the backend server in production mode
POST /make-server-02adf113/register- Register new voter/candidatePOST /make-server-02adf113/generate-voting-link- Generate secure voting linkPOST /make-server-02adf113/verify-voter- Verify voter credentials
POST /make-server-02adf113/submit-vote- Submit a voteGET /make-server-02adf113/get-candidates- Get candidates for a classGET /make-server-02adf113/get-results- Get voting results
GET /make-server-02adf113/election-results- Get complete election results
The application uses Supabase with the following main tables:
voters- Voter information and registration statuscandidates- Candidate profiles and class informationvotes- Individual votes with scoring datakv_store_02adf113- Key-value storage for session data
- Email Verification: All voters must verify their email before voting
- Token-based Authentication: Secure, time-limited voting tokens
- Input Validation: Comprehensive validation on all API endpoints
- CORS Protection: Configured CORS policies for cross-origin requests
- Rate Limiting: Built-in rate limiting to prevent abuse
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details.
For support or questions, please contact the development team or create an issue in the repository.