A modern, secure, and flexible online voting system built with React and TypeScript.
- Clone the repository
- Install dependencies:
npm install
- Start the development server:
npm run dev
4.Accounts for Testing:
- Admin account (pre-configured and cannot be created):
- Email: admin@admin.com
- Password: 123456
- Example user account (for testing):
- Email: test@test.com
- Password: 123456
-
Multiple Voting Topics
- Support for multiple concurrent voting topics
- Configurable number of selections per topic
- Dynamic addition and removal of voting options
-
User Management
- Secure authentication system
- Role-based access control (Admin/Voter)
- Multi-language support (English, Spanish, Chinese)
-
Admin Features
- Real-time voting statistics
- Candidate management
- Voting topic configuration
- Audit logs and reporting
- Export results to CSV
-
Security
- Ballot verification system
- Vote integrity checks
- Audit trail for all actions
- React 18
- TypeScript
- Tailwind CSS
- i18next for internationalization
- Lucide React for icons
- Vite for development and building
- Firebase for authentication and data storage
src/
├── components/ # Reusable UI components
│ ├── admin/ # Admin-specific components
│ ├── auth/ # Authentication components
│ └── voting/ # Voting-related components
├── contexts/ # React context providers
├── hooks/ # Custom React hooks
├── services/ # API and business logic
├── types/ # TypeScript type definitions
├── utils/ # Helper functions and utilities
├── i18n/ # Internationalization resources
└── test/ # Test files and utilities
- Component Structure: Each component is in its own file with associated types and tests
- Business Logic: Separated into services for better maintainability
- State Management: Uses React Context for global state
- Type Safety: Comprehensive TypeScript types for all features
- Testing: Unit tests for components and services
- Use TypeScript for type safety
- Follow ESLint and Prettier configurations
- Write meaningful component and function names
- Include JSDoc comments for complex functions
- Keep components focused and single-responsibility
- Extract reusable logic into custom hooks
- Use composition over inheritance
- Implement proper error boundaries
- Write unit tests for components and services
- Use integration tests for complex features
- Run tests with:
npm run test
-
Managing Voting Topics
- Create new voting topics
- Set maximum selections per topic
- Add/remove candidates
- Configure voting periods
-
Monitoring
- View real-time voting statistics
- Access audit logs
- Generate reports
-
Casting Votes
- Select from available voting topics
- Choose candidates (up to max selections)
- View voting history
-
Account Management
- Update profile
- Change language preferences
- View voting status
- Fork the repository
- Create a feature branch
- Follow the coding guidelines
- Write tests for new features
- Submit a Pull Request
- Keep changes focused and atomic
- Include relevant tests
- Update documentation
- Follow the commit message convention
MIT License - feel free to use this project for your own purposes.
For support or feature requests, please open an issue in the repository.