Skip to content

flow-pie/OnlineVotingSystem.api

Β 
Β 

Repository files navigation


✨ Built by 0x4B47 developers with love for democratic innovation ✨


# πŸ—³οΈ Online Voting System - Secure Digital Democracy

```diff
+---------------------------------------------------------------+
|  πŸš€ Modern | πŸ” Secure | ⚑ Efficient | 🎯 User-Friendly       |
+---------------------------------------------------------------+

🌟 Project Overview

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
Loading

🎨 Feature Showcase

πŸ”‘ Authentication Suite

+ JWT Token Security
+ Role-based Access Control
+ Password Hashing (BCrypt)

πŸ“Š Election Management

graph TD
    A[Create Election] --> B[Define Positions]
    B --> C[Add Candidates]
    C --> D[Configure Timeline]
    D --> E[Launch]
Loading

πŸ—³οΈ Voting Experience

+ One-Vote-Per-User Enforcement
+ Anonymous Ballot System
+ Real-time Vote Counting

πŸ—οΈ Project Architecture

πŸ–₯️ Backend Structure (OnlineVotingSystem.api)

graph LR
    P[Program.cs] --> C[Configuration]
    C --> D[Database]
    D --> E[Entities]
    E --> F[DTOs]
    F --> G[Endpoints]
    G --> H[Services]
    H --> I[Authentication]
Loading

Core Components:

  • Data/
    πŸ—ƒοΈ EF Core Context & Migrations

    CREATE TABLE Users (
      Id INT PRIMARY KEY,
      Username NVARCHAR(50) UNIQUE,
      -- ... other fields
    );
  • Endpoints/
    πŸšͺ API Gateways

    app.MapPost("/api/votes", (CreateVoteDto dto) => {
        // Voting logic
    }).RequireAuthorization();

πŸ’» Frontend Structure (WebUI)

graph TB
    A[Components] --> B[Pages]
    B --> C[Login/Dashboard]
    A --> D[Services]
    D --> E[API Communication]
    E --> F[State Management]
Loading

Key Features:

  • Blazor WASM Hybrid SSR
    ⚑ Combines server-side and client-side rendering
  • Syncfusion Integration
    πŸ“Š Beautiful data visualization for results
  • JWT Interceptor
    πŸ” Automatic token handling

πŸ› οΈ Developer Quickstart

πŸš€ Getting Started

β˜‘οΈ Prerequisites

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.

βš™οΈ Installation

THIS INSTRUCTIONS WILL WORK FOR 99.9% AND FOR THAT 0.1% HELP YOURSELF MAN!

Clone the Repository

  1. Clone the OnlineVotingSystem.api.git repository:

    ❯ git clone https://github.com/Flow-Pie/OnlineVotingSystem.api.git
  2. Navigate to the project directory:

    ❯ cd OnlineVotingSystem.api.git

Cleaning the project

  1. Clean the project:

    ❯ dotnet clean

    Build the project

  2. Build the project:

    ❯ dotnet build

    Restore Dependencies

  3. Restore the project dependencies using NuGet:

    ❯ dotnet restore

πŸ€– Running the Projects

The solution contains two projects: OnlineVotingSystem.api and application layer WebUI. Follow the steps below to run each project.

Running OnlineVotingSystem.api

  1. Navigate to the OnlineVotingSystem.api directory:

    ❯ cd OnlineVotingSystem.api
  2. Run the project:

    ❯ dotnet run 

Running Interface Application layer ie WebUI

  1. Navigate to the WebUI directory:

    ❯ cd WebUI
  2. Run the project:

    ❯ dotnet run 

The User Interface will launch

πŸ§ͺ Testing(optional)

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!"

βš™οΈ Setup Guide summary

+ dotnet restore   # Get all dependencies
! dotnet build     # Compile the solution
# dotnet run       # Launch the API

πŸ”„ Database Migrations

// Sample migration command
dotnet ef migrations add "InitialSchema" -o "Data/Migrations"

πŸ“Š Technology Stack

Layer Technology Badge
Frontend Blazor WASM Blazor
Backend ASP.NET Core 8 .NET
Database SQLite/PostgreSQL SQLite
Auth JWT Bearer Tokens JWT

🌈 UI Component Gallery

[Login Screen]        [Dashboard]         [Election Creation]
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚             β”‚     β”‚  πŸ“Š Charts  β”‚     β”‚  πŸ—οΈ Form   β”‚
  β”‚   πŸ” Auth   β”‚     β”‚  πŸ“ˆ Stats   β”‚     β”‚  πŸ“ Fields  β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Deployment Options

  1. Azure App Service
    az webapp up --name voting-system --resource-group DemoSite
  2. Docker Container
    FROM mcr.microsoft.com/dotnet/aspnet:8.0
    COPY ./published /app
    WORKDIR /app
    ENTRYPOINT ["dotnet", "OnlineVotingSystem.api.dll"]

🀝 Contribution Guidelines

! 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!

πŸ“œ License

+ MIT Licensed - Open Source Forever
- Commercial Use Allowed
! Attribution Required

About

An Online Voting System is a secure, web-based application that allows eligible voters to cast their votes electronically from any location

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C# 100.0%