BloodLink
BloodLink is a MERN-stack hospital & blood-bank management platform. It gives hospitals, blood banks, medical staff, and donors one system to manage donor records, blood inventory, donations, blood requests, and appointments โ with role-based access control and an audit trail.
๐ Live : bloodlink-s5d7.onrender.com
Features
- Auth & RBAC โ JWT login, 7 user roles, passcode-gated staff registration, account status checks
- Donor management โ profiles, blood group, eligibility status, donation history
- Donation tracking โ record donations with unique blood bag IDs and expiry dates
- Inventory management โ blood units move through
quarantined โ available โ issued/expired, with a live summary view - Blood requests โ doctors/nurses raise requests, staff review and fulfill them by issuing specific units
- Hospital management โ multi-hospital support with an approval workflow
- Appointments โ donors book donation slots; staff approve/manage them
- Notifications โ per-user alerts for requests, appointments, and low inventory
- Blood compatibility lookup โ donor/recipient matching for all 8 blood groups
- Dashboard & reports โ key stats: available units, expiring soon, pending/emergency requests
- Audit logs โ action-level trail for admin oversight
Tech Stack
Frontend: React 19, Vite, React Router 7, Axios
Backend: Node.js, Express 4, MongoDB + Mongoose 8, JWT, bcryptjs
Deployment: Render
Project Structure
BloodLink/
โโโ client/ # React (Vite) frontend
โ โโโ src/
โ โโโ context/ # Auth state
โ โโโ services/ # API calls (Axios)
โ โโโ layouts/ # Public & dashboard layouts
โ โโโ components/ # Shared UI (Navbar, etc.)
โ โโโ pages/ # Route-level pages
โ
โโโ server/ # Express + MongoDB backend
โ โโโ config/db.js # MongoDB connection
โ โโโ models/ # User, Hospital, Donor, BloodDonation,
โ โ # BloodUnit, BloodRequest, Appointment,
โ โ # Notification, AuditLog
โ โโโ controllers/ # Route logic per resource
โ โโโ routes/ # Express routers per resource
โ โโโ middleware/ # JWT auth + role-based access
โ โโโ utils/ # Token generation, helpers
โ
โโโ README.md
Getting Started
Requirements: Node.js 18+, npm, a MongoDB connection string (Atlas or local)
git clone https://github.com/RehabTariqq/BloodLink.git
cd BloodLink
# Backend
cd server && npm install
# Frontend
cd ../client && npm install
server/.env
PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
CLIENT_URL=http://localhost:5173
STAFF_PASSCODE=your_staff_registration_passcode
client/.env (optional โ defaults to http://localhost:5000/api)
VITE_API_URL=http://localhost:5000/api
Run it:
# Terminal 1
cd server && npm run dev
# Terminal 2
cd client && npm run dev
Backend: http://localhost:5000 ยท Frontend: http://localhost:5173
API Overview
Base path: /api
| Resource | Endpoints |
|---|---|
| Auth | POST /auth/register, POST /auth/login, POST /auth/verify-password |
| Donors | GET/POST /donors, GET/PUT/DELETE /donors/:id |
| Donations | GET/POST /donations, GET/PUT /donations/:id |
| Inventory | GET/POST /inventory, GET /inventory/summary, PUT /inventory/:id |
| Requests | GET/POST /requests, GET/PUT/DELETE /requests/:id, POST /requests/:id/issue |
| Hospitals | GET/POST /hospitals, GET/PUT /hospitals/:id |
| Appointments | GET/POST /appointments, PUT /appointments/:id |
| Notifications | GET /notifications, PUT /notifications/:id/read |
| Compatibility | GET /compatibility/:bloodGroup |
| Reports | GET /reports/dashboard |
| Audit logs | GET /audit-logs |
All routes except /auth/register and /auth/login require a Bearer JWT; most write actions are further restricted by role.
User Roles
superAdmin ยท hospitalAdmin ยท bloodBankStaff ยท doctor ยท nurse ยท donor ยท patient
Contributing
- Fork the repo
- Create a branch:
git checkout -b feature/your-feature - Commit and push your changes
- Open a Pull Request
License
No license specified yet โ all rights reserved by the repository owner.
Log in or sign up for Devpost to join the conversation.