# Blockchain Voting System – Laravel (Off-Chain Management)
This Laravel app handles the off-chain part of a blockchain voting system using Hyperledger Fabric. It manages users, TPS registration, and interfaces with the blockchain via REST.
## 📁 Features
- Admin panel to manage:
- Users
- TPS
- Voter dashboard:
- View TPS assignment
- Cast vote (one-time)
- Blockchain Integration via HTTP:
- Register TPS and users
- Record vote on blockchain
- Sync vote result summary
## 🛠️ Setup
### 1. Clone the Repository
```bash
git clone <your-laravel-repo-url>
cd <your-laravel-folder>composer install
npm install && npm run devCopy .env.example to .env and update DB credentials.
cp .env.example .env
php artisan key:generatephp artisan migrate
php artisan db:seedThis will also make HTTP requests to register TPS and users on the blockchain via:
/api/assets– for each TPS/api/register– for each voter
php artisan serveApp available at: http://localhost:8000
- Admin: Can create TPS and assign voters
- Voter: Can log in and cast vote once
| Route | Role | Description |
|---|---|---|
/login |
All | Login screen |
/dashboard |
Voter | Cast vote + see status |
/users |
Admin | Manage users |
/tps |
Admin | Manage TPS |
Laravel uses Http::post() to call endpoints from Hyperledger REST API:
- Cast vote
- Register users
- Send summarized vote results
See VoteController, UserSeeder, and TpsSeeder for usage.
- Users are manually seeded; there’s no public registration.
nikis used as blockchain user ID.- Votes are marked on both DB and blockchain for syncing.
- No vote contents are stored, only participation and counts.