A console-based e-voting platform implemented in Dart. This application provides a simple and secure way to conduct elections with separate interfaces for administrators and users.
-
Admin Functions:
- Add candidates
- View list of candidates
- Print election results
-
User Functions:
- Register as a voter
- View list of candidates
- Cast a vote (one-time only)
- Print election results
-
General Features:
- Secure voting process
- Unique ID generation for users
- Persistent storage of candidates and users
- Real-time result calculation and display
- Dart SDK (version 2.12.0 or higher)
-
Clone the repository:
git clone https://github.com/Qharny/E-voting cd e-voting
-
Install dependencies:
dart pub get
e_voting_platform/
├── bin/
│ └── main.dart
├── lib/
│ ├── models/
│ │ ├── candidate.dart
│ │ └── user.dart
│ ├── services/
│ │ ├── admin_service.dart
│ │ ├── user_service.dart
│ │ └── storage_service.dart
│ └── utils/
│ └── id_generator.dart
├── pubspec.yaml
└── README.md
To start the e-voting platform, run the following command in the project root:
dart run bin/main.dart
-
Main Menu:
- Choose between Admin mode, User mode, printing results, or exiting the application.
-
Admin Mode:
- Add new candidates
- View the list of candidates
- Print current election results
-
User Mode:
- Register as a new voter (you'll receive a unique ID)
- View the list of candidates
- Cast your vote
- Print current election results
The application uses JSON files to store data:
candidates.json
: Stores information about candidates and their vote countsusers.json
: Stores registered user information
These files are created in the project root directory when the application is first run.
Contributions to improve the e-voting platform are welcome. Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.