https://github.com/qharny/e-voting
A console-based electronic voting system implemented in Dart.
https://github.com/qharny/e-voting
cli dart e-voting file-io json realtime-results
Last synced: 4 months ago
JSON representation
A console-based electronic voting system implemented in Dart.
- Host: GitHub
- URL: https://github.com/qharny/e-voting
- Owner: Qharny
- Created: 2024-09-28T04:40:30.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-10-17T03:41:26.000Z (8 months ago)
- Last Synced: 2024-12-27T15:10:17.481Z (6 months ago)
- Topics: cli, dart, e-voting, file-io, json, realtime-results
- Language: Dart
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# E-Voting Platform
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.
## Features
- **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## Prerequisites
- Dart SDK (version 2.12.0 or higher)
## Setup
1. Clone the repository:
```
git clone https://github.com/Qharny/E-voting
cd e-voting
```2. Install dependencies:
```
dart pub get
```## Project Structure
```
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
```## Running the Application
To start the e-voting platform, run the following command in the project root:
```
dart run bin/main.dart
```## Usage
1. **Main Menu**:
- Choose between Admin mode, User mode, printing results, or exiting the application.2. **Admin Mode**:
- Add new candidates
- View the list of candidates
- Print current election results3. **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## Data Persistence
The application uses JSON files to store data:
- `candidates.json`: Stores information about candidates and their vote counts
- `users.json`: Stores registered user informationThese files are created in the project root directory when the application is first run.
## Contributing
Contributions to improve the e-voting platform are welcome. Please feel free to submit a Pull Request.
## License
This project is open source and available under the [MIT License](https://github.com/Qharny/MicroLang/blob/main/licence).