🌐 Live Interactive Demo: https://ranehal.github.io/Rokto-Network/
Rokto Network is a production-ready, full-stack emergency blood donation and donor management platform. Built strictly following YAGNI (You Aren't Gonna Need It) principles and expressive one-liner solutions, eliminating boilerplate while delivering high-speed search, real-time blood bank inventory, compatibility calculations, and life-saving donor connections.
Live network status, quick blood group lookup, emergency hotline, and immediate access to critical life-saving flows.

Personalized lifesaver metrics, donation countdown tracker, interactive donation calendar, and preparation tasks.

Search donors by blood group, division/city, availability status, radius distance, and donation history.

Fast-track triage for critical cases, specifying patient details, urgency level, required units, hospital, and contact.

Directory of accredited blood banks and transfusion centers with live unit counts across all 8 blood groups.

Instant universal donor and recipient matrix with antigen breakdowns, Rh factors, and transfusion rules.

Community leaderboard celebrating high-impact donors, streaks, lifetime units, and saved lives.

Geographic visualization of registered donors, active emergencies, and nearby donation centers.

Frictionless 4-step onboarding with health eligibility verification, blood group selection, and location tagging.

- No Over-Engineering: Avoided unnecessary service layers, complex repository interfaces, abstract factories, or premature microservices.
- Direct Eloquent Power: Leveraged Laravel Eloquent models directly with query scopes and concise controllers.
- Unified Full-Stack Deployment: Laravel serves the production-compiled Single Page Application (SPA) directly from
routes/web.php, eliminating separate frontend hosting overhead while maintaining full API independence.
Expressive modern PHP 8.2 and Laravel 12 syntax:
// One-liner query scopes
public function scopeAvailable(Builder $query): Builder => $query->where('is_available', true);
public function scopeUrgent(Builder $query): Builder => $query->whereIn('urgency', ['critical', 'urgent']);
// One-liner controller responses
public function index(Request $request): JsonResponse
{
return response()->json(Donor::filter($request->all())->orderByDesc('total_donations')->paginate($request->integer('per_page', 20)));
}
// One-liner universal compatibility check
public static function isCompatible(string $donor, string $recipient): bool =>
in_array($recipient, self::DONATE_MATRIX[$donor] ?? [], true);graph TD
Client[React 18 + Vite SPA] -->|REST API Requests| Laravel[Laravel 12 API Engine]
Client -->|Static Assets| WebRoutes[Laravel Web Routing / SPA Host]
Laravel -->|Eloquent ORM| DB[(SQLite Database)]
subgraph Core Modules
DonorCtrl[DonorController]
RequestCtrl[BloodRequestController]
BankCtrl[BloodBankController]
StatsCtrl[StatsController]
CompatCtrl[CompatibilityController]
end
Laravel --> DonorCtrl
Laravel --> RequestCtrl
Laravel --> BankCtrl
Laravel --> StatsCtrl
Laravel --> CompatCtrl
erDiagram
DONORS {
bigint id PK
string name
string blood_group
string city
string area
string phone
string email
tinyint age
enum gender
int total_donations
date last_donated_at
boolean is_available
string badge
decimal rating
decimal latitude
decimal longitude
text bio
timestamps created_at_updated_at
}
BLOOD_REQUESTS {
bigint id PK
string patient_name
string blood_group
smallint units_needed
enum urgency
string hospital_name
string city
string area
string contact_name
string contact_phone
text reason
string needed_within
enum status
decimal latitude
decimal longitude
timestamps created_at_updated_at
}
BLOOD_BANKS {
bigint id PK
string name
string city
string area
string address
string phone
string emergency_phone
string operating_hours
decimal latitude
decimal longitude
json inventory
timestamps created_at_updated_at
}
CAMPAIGNS {
bigint id PK
string title
string organizer
string location
string city
date date
string start_time
string end_time
int target_units
int collected_units
string contact_phone
timestamps created_at_updated_at
}
| Method | Endpoint | Description | Query / Body Parameters |
|---|---|---|---|
GET |
/api/stats |
Dashboard aggregated statistics | None |
GET |
/api/donors |
Paginated donors list with filters | bloodGroup, city, search, available, minAge, gender |
GET |
/api/donors/top |
Top 10 lifetime hero donors | None |
GET |
/api/donors/{id} |
Donor profile details | None |
POST |
/api/donors |
Register new donor | name, blood_group, city, area, phone, age, gender |
PATCH |
/api/donors/{id} |
Update donor profile/availability | is_available, phone, city, area, bio |
POST |
/api/donors/{id}/toggle-availability |
Fast availability status toggle | None |
GET |
/api/blood-requests |
Filterable blood requests | bloodGroup, city, urgency, status |
GET |
/api/blood-requests/urgent |
Active critical & urgent emergencies | None |
POST |
/api/blood-requests |
Submit emergency blood request | patient_name, blood_group, units_needed, urgency, hospital_name, city, contact_phone |
PATCH |
/api/blood-requests/{id}/status |
Update request status | status (pending, in-progress, fulfilled, cancelled) |
GET |
/api/blood-banks |
Blood banks with inventory counts | city |
GET |
/api/blood-banks/{id} |
Single blood bank details | None |
GET |
/api/campaigns |
Upcoming donation drives & camps | None |
GET |
/api/compatibility/matrix |
Full 8x8 blood compatibility table | None |
GET |
/api/compatibility/{group} |
Antigen & donation rules for group | e.g. /api/compatibility/O- |
POST |
/api/compatibility/check |
Validate donor-recipient pair | {"donor": "O-", "recipient": "AB+"} |
- PHP 8.2+ with extensions:
pdo_sqlite,openssl,mbstring,curl,fileinfo - Composer 2.x
- Node.js 18+ & npm
# 1. Clone repository
git clone <repo-url>
cd "Blood Donation Platform Design"
# 2. Install PHP & Node dependencies
composer install --no-dev --optimize-autoloader
npm install
# 3. Environment configuration
cp .env.example .env
php artisan key:generate
# 4. Migrate and Seed Database
php artisan migrate --seed
# 5. Build Frontend for Production
npm run build
# 6. Run Application
php artisan serve --port=8008Visit http://localhost:8008 in your browser to access the live platform.
The application includes automated Feature and Unit tests covering API endpoints, model logic, and compatibility matrices:
php artisan test PASS Tests\Unit\BloodCompatibilityTest
✓ o negative is universal red blood cell donor
✓ ab positive is universal recipient
✓ incompatible blood types return false
PASS Tests\Unit\ExampleTest
✓ that true is true
PASS Tests\Feature\BloodBankApiTest
✓ can list blood banks
PASS Tests\Feature\BloodRequestApiTest
✓ can submit emergency blood request
✓ can fetch urgent requests
PASS Tests\Feature\DonorApiTest
✓ can list donors
✓ can register new donor
✓ donor validation fails for invalid blood group
✓ can toggle donor availability
PASS Tests\Feature\ExampleTest
✓ the application returns a successful response
PASS Tests\Feature\StatsApiTest
✓ can fetch platform statistics
Tests: 13 passed (63 assertions)
Duration: 1.04s
This project is open-sourced under the MIT License.