# 🗳️ Online Voting System - Secure Digital Democracy```diff+---------------------------------------------------------------+
| 🚀 Modern | 🔐 Secure | ⚡ Efficient | 🎯 User-Friendly |
+---------------------------------------------------------------+OnlineVotingSystem.api.git is a full-stack solution revolutionizing democratic processes through technology. This system combines a robust .NET Core backend with an interactive Blazor frontend to deliver:
pie
title System Capabilities
"Secure Authentication" : 25
"Real-time Results" : 20
"Admin Dashboard" : 20
"Voter Portal" : 20
"Audit Trails" : 15
+ JWT Token Security+ Role-based Access Control+ Password Hashing (BCrypt)graph TD
A[Create Election] --> B[Define Positions]
B --> C[Add Candidates]
C --> D[Configure Timeline]
D --> E[Launch]
+ One-Vote-Per-User Enforcement+ Anonymous Ballot System+ Real-time Vote Countinggraph LR
P[Program.cs] --> C[Configuration]
C --> D[Database]
D --> E[Entities]
E --> F[DTOs]
F --> G[Endpoints]
G --> H[Services]
H --> I[Authentication]
Data/
🗃️ EF Core Context & MigrationsCREATETABLEUsers ( Id INTPRIMARY KEY, Username NVARCHAR(50) UNIQUE, -- ... other fields );
Endpoints/
🚪 API Gatewaysapp.MapPost("/api/votes",(CreateVoteDtodto)=>{// Voting logic}).RequireAuthorization();
graph TB
A[Components] --> B[Pages]
B --> C[Login/Dashboard]
A --> D[Services]
D --> E[API Communication]
E --> F[State Management]
- Blazor WASM Hybrid SSR
⚡ Combines server-side and client-side rendering - Syncfusion Integration
📊 Beautiful data visualization for results - JWT Interceptor
🔐 Automatic token handling
Before getting started with OnlineVotingSystem.api.git, ensure your runtime environment meets the following requirements:
- Programming Language: CSharp
- Package Manager: Nuget
- Database: SQLite
- .NET SDK: Ensure you have the .NET SDK installed. You can download it from the official .NET website.
THIS INSTRUCTIONS WILL WORK FOR 99.9% AND FOR THAT 0.1% HELP YOURSELF MAN!
Clone the
OnlineVotingSystem.api.gitrepository:❯ git clone https://github.com/Flow-Pie/OnlineVotingSystem.api.git
Navigate to the project directory:
❯ cd OnlineVotingSystem.api.git
Clean the project:
❯ dotnet clean
Build the project:
❯ dotnet build
Restore the project dependencies using NuGet:
❯ dotnet restore
The solution contains two projects: OnlineVotingSystem.api and application layer WebUI. Follow the steps below to run each project.
Navigate to the
OnlineVotingSystem.apidirectory:❯ cd OnlineVotingSystem.apiRun the project:
❯ dotnet run
Navigate to the
WebUIdirectory:❯ cd WebUIRun the project:
❯ dotnet run
The User Interface will launch
To run the test suite, use the following command:
+ dotnet test### 🏗️ Installation```bash# Clone with style!git clone https://github.com/Flow-Pie/OnlineVotingSystem.api.git && \cd OnlineVotingSystem.api && \echo"🚀 Repository cloned successfully!"+ dotnet restore # Get all dependencies! dotnet build # Compile the solution# dotnet run # Launch the API// Sample migration commanddotnetefmigrationsadd"InitialSchema"-o "Data/Migrations"| Layer | Technology | Badge |
|---|---|---|
| Frontend | Blazor WASM | |
| Backend | ASP.NET Core 8 | |
| Database | SQLite/PostgreSQL | |
| Auth | JWT Bearer Tokens |
[Login Screen] [Dashboard] [Election Creation]
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ │ │ 📊 Charts │ │ 🏗️ Form │
│ 🔐 Auth │ │ 📈 Stats │ │ 📝 Fields │
└─────────────┘ └─────────────┘ └─────────────┘
- Azure App Service
az webapp up --name voting-system --resource-group DemoSite
- Docker Container
FROM mcr.microsoft.com/dotnet/aspnet:8.0 COPY ./published /app WORKDIR /app ENTRYPOINT ["dotnet", "OnlineVotingSystem.api.dll"]
! We welcome contributions! Please follow our:+ Code Style Guidelines+ PR Template Requirements+ Security Protocols📌 Pro Tip: Use our pre-commit hooks for automatic code formatting!
+ MIT Licensed - Open Source Forever- Commercial Use Allowed! Attribution Required