A production-quality full-stack MERN application that streamlines blood donation, blood requests, inventory management, secure payments, and role-based administration through a centralized digital platform.
Built with scalability, security, clean architecture, and real-world workflows in mind.
BloodLink is a production-ready Blood Bank Management System designed to simplify the complete blood donation lifecycle through a secure role-based platform.
The application connects Patients, Donors, Hospitals, and Administrators into a single centralized ecosystem where blood inventory, donation records, request approvals, secure online payments, and analytics are managed transparently.
Unlike traditional CRUD-based academic projects, BloodLink follows real-world business workflows including approval processes, payment verification, inventory deduction, email notifications, dashboard analytics, and role-specific permissions.
The project was built with an emphasis on clean architecture, maintainability, scalability, responsive UI, and industry-standard development practices.
- Overview
- Live Demo
- Highlights
- Features
- Tech Stack
- System Architecture
- Project Structure
- User Roles
- Authentication Workflow
- Blood Donation Workflow
- Blood Request Workflow
- Payment Workflow
- Dashboard Analytics
- Installation
- Environment Variables
- Running the Project
- Database Seeding
- Available Scripts
- API Overview
- Security Features
- Project Screenshots
- Testing
- Performance Optimizations
- Production Ready Features
- Future Enhancements
- Deployment
- Why BloodLink?
- Contributing
- Future Improvements
- License
- Author
- Acknowledgements
Add your deployed frontend URL here
https://blood-link-phi.vercel.app
Add your deployed backend URL here
https://bloodlink-api-6cmq.onrender.com
- π JWT Authentication with Refresh Tokens
- π₯ Multi-Role Access Control
- π©Έ Blood Donation Management
- π¦ Central Blood Inventory
- π Blood Request Workflow
- π³ Razorpay Payment Integration
- π§ Email Notifications
- π Dashboard Analytics
- π Dark / Light Theme
- π± Fully Responsive Design
- β‘ Modern React Architecture
- π‘οΈ Secure Backend Validation
- π Production Ready
- User Registration
- Secure Login
- Logout
- JWT Authentication
- Refresh Token Authentication
- Forgot Password
- Reset Password
- Protected Routes
- Role-Based Authorization
- Profile Management
- Update Profile
- Admin Approval Workflow
- Pending User Management
- User Search
- Pagination
- Role Filtering
- Record Blood Donations
- Donation History
- 90-Day Donor Cooldown
- Hospital Blood Donations
- Automatic Inventory Updates
- Blood Group Validation
- Create Blood Requests
- Patient Request Validation
- Hospital Request Validation
- Admin Approval
- Request Rejection
- Dynamic Processing Fee (βΉ500 per Blood Unit)
- Razorpay Payment
- Automatic Inventory Deduction
- Request History
- Central Blood Inventory
- Blood Group Distribution
- Live Blood Stock
- Low Stock Detection
- Inventory Summary
- Automatic Quantity Updates
- System Overview
- User Statistics
- Donation Statistics
- Request Statistics
- Revenue Analytics
- Blood Units Delivered
- Blood Group Distribution
- Low Stock Monitoring
- Recent Donations
- Responsive Layout
- Sidebar Navigation
- Dark / Light Theme
- Skeleton Loaders
- Empty States
- Confirmation Dialogs
- Toast Notifications
- Animated Components
- Clean Dashboard UI
- React 19
- Vite
- React Router DOM
- Tailwind CSS
- Axios
- React Hook Form
- React Hot Toast
- Framer Motion
- Recharts
- Lucide React
- Node.js
- Express.js
- MongoDB Atlas
- Mongoose
- JWT Authentication
- Zod Validation
- Razorpay
- Nodemailer (Brevo SMTP)
- Git
- GitHub
- VS Code
- ESLint
- Prettier
- Postman
βββββββββββββββββββββββββββββ
β React (Vite) β
β Tailwind CSS UI β
βββββββββββββββ¬ββββββββββββββ
β
REST API (Axios)
β
βββββββββββββββΌββββββββββββββ
β Express.js API β
β Authentication & Business β
β Logic Layer β
βββββββββββββββ¬ββββββββββββββ
β
βββββββββββββββββΌβββββββββββββββββ
β β β
βΌ βΌ βΌ
MongoDB Atlas Razorpay Brevo SMTP
Database Payments Emails
BloodLink follows a modular MVC architecture where the frontend communicates with the backend through REST APIs. The backend manages authentication, authorization, validation, business rules, payment verification, inventory management, and email notifications before persisting data into MongoDB.
BloodLink/
β
βββ client/
β βββ public/
β βββ src/
β β βββ assets/
β β βββ components/
β β βββ constants/
β β βββ contexts/
β β βββ features/
β β βββ hooks/
β β βββ layouts/
β β βββ pages/
β β βββ providers/
β β βββ services/
β β βββ styles/
β β βββ utils/
β β
β βββ package.json
β
βββ server/
β βββ src/
β β βββ config/
β β βββ constants/
β β βββ controllers/
β β βββ database/
β β βββ middleware/
β β βββ models/
β β βββ routes/
β β βββ scripts/
β β βββ seed/
β β βββ templates/
β β βββ utils/
β β βββ validations/
β β
β βββ package.json
β
βββ docs/
βββ screenshots/
βββ LICENSE
βββ README.md
BloodLink supports four different user roles, each with dedicated permissions.
| Role | Permissions |
|---|---|
| Admin | Approve users, manage requests, monitor inventory, dashboard analytics |
| Donor | Donate blood, view donation information, manage profile |
| Patient | Request blood matching their registered blood group, complete payment, view request history |
| Hospital | Donate blood inventory, request multiple blood units, manage hospital requests |
The application implements secure authentication using JWT-based access control.
- User Registration
- Secure Login
- Logout
- JWT Access Token
- Refresh Token
- Forgot Password
- Reset Password
- Protected Routes
- Role-Based Authorization
Register
β
βΌ
Patient ββββββββββββββββΊ Active Account
Donor / Hospital
β
βΌ
Pending Approval
β
βΌ
Admin Review
β
ββββββ΄βββββ
β β
βΌ βΌ
Approved Rejected
β
βΌ
Active Account
Patients receive immediate access after registration, while donor and hospital accounts require administrator approval before they can access the system.
Donor / Hospital
β
βΌ
Submit Donation
β
βΌ
Validate Blood Group
β
βΌ
Donation Recorded
β
βΌ
Inventory Updated
- Donors can donate 1 blood unit per donation.
- Donors must wait 90 days before donating again.
- Hospitals can donate 1β10 blood units in a single donation.
- Inventory is updated immediately after a successful donation.
Create Request
β
βΌ
Pending
β
βΌ
Admin Approval
β
βΌ
Payment Pending
β
βΌ
Razorpay Payment
β
βΌ
Payment Verification
β
βΌ
Inventory Deduction
β
βΌ
Request Completed
- Patients can request only their registered blood group.
- Patients can request up to 2 blood units.
- Hospitals can request up to 5 blood units.
- Processing charges are calculated dynamically at βΉ500 per blood unit.
- Inventory is deducted only after successful payment verification.
BloodLink integrates Razorpay Test Mode for secure payment processing.
Approved Request
β
βΌ
Create Razorpay Order
β
βΌ
Complete Payment
β
βΌ
Verify Signature
β
βΌ
Update Payment Status
β
βΌ
Deduct Inventory
β
βΌ
Send Confirmation Email
- Dynamic pricing based on requested blood units
- Secure Razorpay signature verification
- Automatic payment status updates
- Automatic inventory deduction
- Email confirmation after successful payment
The administrator dashboard provides real-time operational insights.
- Total Users
- Total Donors
- Total Patients
- Total Hospitals
- Pending Approvals
- Completed Requests
- Revenue Generated
- Blood Units Delivered
- Blood Inventory Summary
- Blood Group Distribution
- Low Stock Alerts
- Recent Donations
These analytics help administrators monitor the overall health of the blood management system from a single dashboard.
Follow the steps below to set up BloodLink on your local machine.
git clone https://github.com/Bhargav3905/BloodLink.git
cd BloodLinkcd server
npm installcd ../client
npm installCreate a .env file inside the server directory.
PORT=8000
MONGODB_URI=your_mongodb_connection_string
DB_NAME=bloodlink
CLIENT_URL=http://localhost:5173
ACCESS_TOKEN_SECRET=your_access_token_secret
ACCESS_TOKEN_EXPIRY=15m
REFRESH_TOKEN_SECRET=your_refresh_token_secret
REFRESH_TOKEN_EXPIRY=7d
RESET_TOKEN_SECRET=your_reset_token_secret
RESET_TOKEN_EXPIRY=15m
PROCESSING_FEE_PER_UNIT=500
LOW_STOCK_THRESHOLD=5
RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secret
EMAIL_HOST=smtp-relay.brevo.com
EMAIL_PORT=587
EMAIL_USER=your_brevo_login
EMAIL_PASS=your_brevo_password
ADMIN_NAME=Admin
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=your_secure_password
ADMIN_PHONE=9999999999
ADMIN_CITY=Ahmedabad
ADMIN_BLOOD_GROUP=O+Create a .env file inside the client directory.
VITE_API_BASE_URL=http://localhost:8000/api/v1
VITE_RAZORPAY_KEY_ID=your_razorpay_key_idcd server
npm run devBackend runs on:
http://localhost:8000
cd client
npm run devFrontend runs on:
http://localhost:5173
To create the default administrator account and initialize blood inventory, run:
cd server
npm run seedThis command:
- Creates the default administrator account.
- Initializes blood inventory for all supported blood groups.
- Prevents duplicate seed data on subsequent executions.
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm start |
Start production server |
npm run seed |
Seed admin account and inventory |
| Command | Description |
|---|---|
npm run dev |
Start Vite development server |
npm run build |
Create production build |
npm run preview |
Preview production build |
npm run lint |
Run ESLint |
| Method | Endpoint |
|---|---|
| POST | /api/v1/auth/register |
| POST | /api/v1/auth/login |
| POST | /api/v1/auth/logout |
| POST | /api/v1/auth/refresh-token |
| POST | /api/v1/auth/forgot-password |
| POST | /api/v1/auth/reset-password/:token |
| Method | Endpoint |
|---|---|
| GET | /api/v1/users/profile |
| PATCH | /api/v1/users/profile |
| GET | /api/v1/users/pending |
| PATCH | /api/v1/users/:id/approve |
| PATCH | /api/v1/users/:id/reject |
| Method | Endpoint |
|---|---|
| POST | /api/v1/donations |
| GET | /api/v1/donations/history |
| Method | Endpoint |
|---|---|
| POST | /api/v1/requests |
| GET | /api/v1/requests/my |
| GET | /api/v1/requests/pending |
| PATCH | /api/v1/requests/:id/approve |
| PATCH | /api/v1/requests/:id/reject |
| Method | Endpoint |
|---|---|
| POST | /api/v1/payments/create-order/:requestId |
| POST | /api/v1/payments/verify |
| Method | Endpoint |
|---|---|
| GET | /api/v1/analytics/overview |
| GET | /api/v1/analytics/inventory-summary |
| GET | /api/v1/analytics/request-statistics |
| GET | /api/v1/analytics/blood-distribution |
| GET | /api/v1/analytics/low-stock |
| GET | /api/v1/analytics/donation-statistics |
- JWT Access & Refresh Token Authentication
- Secure Password Hashing with bcrypt
- Role-Based Authorization
- Protected API Routes
- Request Validation using Zod
- Secure Razorpay Signature Verification
- Environment Variable Configuration
- Input Validation
- Centralized Error Handling
- Secure Email-Based Password Reset
The following screenshots showcase the major features and workflows of BloodLink.
Approve or reject donor and hospital registrations.
Approve or reject blood requests submitted by patients and hospitals.
Monitor available blood units across all blood groups.
Track every blood donation recorded in the system.
Record a new blood donation with cooldown validation.
Dynamic request form with real-time processing fee calculation.
Track request status and complete payment after approval.
Hospital blood donation workflow.
Hospital request workflow with dynamic pricing.
Secure payment flow after administrator approval.
Manage personal information and account details.
Fully responsive interface with complete Light and Dark theme support.
The application was manually tested across all supported user roles to ensure correctness of authentication, authorization, workflows, payment processing, and UI responsiveness.
- Landing Page
- Navigation
- Theme Toggle
- Register
- Login
- Forgot Password
- Reset Password
- Protected Routes
- Dashboard
- Pending User Approval
- User Rejection
- Pending Blood Requests
- Request Approval
- Request Rejection
- Inventory Dashboard
- Donation History
- Analytics Dashboard
- Revenue Analytics
- Sidebar Navigation
- Theme Switching
- Blood Donation
- Donation Cooldown Validation
- Profile Management
- Dashboard
- Theme Support
- Blood Request Creation
- Blood Group Validation
- Dynamic Pricing
- Razorpay Payment
- Request History
- Profile Management
- Multi-unit Blood Donation
- Multi-unit Blood Requests
- Dynamic Pricing
- Razorpay Payment
- Request History
- Profile Management
- Modular Feature-Based Architecture
- Reusable UI Components
- Lazy API Loading
- Axios Service Layer
- React Hook Form Validation
- Optimized MongoDB Queries
- Parallel Database Queries using
Promise.all() - Centralized Error Handling
- Environment Variable Configuration
- Responsive UI with Tailwind CSS
β JWT Authentication
β Refresh Token Authentication
β Role-Based Authorization
β Approval Workflow
β Password Reset via Email
β Dynamic Processing Fee
β Razorpay Payment Integration
β Revenue Analytics
β Blood Inventory Management
β Low Stock Detection
β Email Notifications
β Responsive Design
β Dark / Light Theme
β Skeleton Loaders
β Empty States
β Confirmation Dialogs
β Toast Notifications
β Form Validation
β Protected Routes
β Modular Folder Structure
β Clean Code Architecture
Although BloodLink is production-ready, the following improvements can be considered for future versions:
- Blood Donation Appointment Scheduling
- Nearby Blood Bank Locator
- Emergency Blood Request Notifications
- PDF Receipt Generation
- Blood Compatibility Recommendation
- Real-Time Notifications
- Admin Activity Logs
- Audit Trail
- Docker Support
- CI/CD Pipeline
- Unit & Integration Testing
- Multi-language Support
The application can be deployed using the following services:
| Service | Purpose |
|---|---|
| Vercel | Frontend Deployment |
| Render | Backend Deployment |
| MongoDB Atlas | Cloud Database |
| Razorpay | Payment Gateway |
| Brevo SMTP | Email Service |
BloodLink was built as a production-quality portfolio project to demonstrate real-world full-stack software engineering practices beyond basic CRUD applications.
The project focuses on secure authentication, role-based access control, modular architecture, payment processing, analytics, inventory management, and scalable code organization while delivering a responsive and modern user experience.
It reflects industry-standard development practices suitable for internships, placements, and full-stack developer portfolios.
Contributions, feature suggestions, and bug reports are always welcome.
If you'd like to contribute:
- Fork the repository.
- Create a new feature branch.
git checkout -b feature/your-feature-name3.Commit your changes.
git commit -m "feat: add new feature"4.Push your branch.
git push origin feature/your-feature-name5.Open a Pull Request.
Please ensure that your code follows the existing project structure, coding standards, and naming conventions.
The current release (v1.0.0) provides a complete production-ready blood bank management system. Future versions may include:
- π± Progressive Web App (PWA) support
- π Live donor location and nearby donor search
- π Real-time notifications using WebSockets
- π Advanced analytics and reporting dashboard
- π₯ Multi-branch hospital inventory management
- π Donation appointment scheduling
- π Blood request invoice and PDF generation
- π Multi-language (i18n) support
- π¦ Docker and Kubernetes deployment support
- π§ͺ Automated testing with Jest and Cypress
- π Elasticsearch-powered search
- π² SMS and WhatsApp notifications
- π€ AI-powered blood demand forecasting
- βοΈ AWS S3 image storage for user profiles
- π Audit logs and activity tracking
This project is licensed under the MIT License.
See the LICENSE file for more details.
B.Tech Information & Communication Technology
Pandit Deendayal Energy University (PDEU)
Full Stack MERN Developer
Replace these with your own links.
- GitHub: https://github.com/Bhargav3905
- LinkedIn: https://www.linkedin.com/in/bhargavprajapati1309
- Portfolio: https://bhargavprajapti.lovable.app
- Email: prajapatibhargavk@gmail.com
Special thanks to the open-source community and the technologies that made this project possible.
- React
- Vite
- Tailwind CSS
- Node.js
- Express.js
- MongoDB Atlas
- Mongoose
- Razorpay
- Brevo SMTP
- React Hook Form
- Recharts
- Lucide React
- React Hot Toast
- Framer Motion
- JWT
- Zod
- Axios
If you found this project helpful:
- β Star this repository
- π΄ Fork the project
- π Report issues
- π‘ Suggest improvements
Your support helps improve the project and motivates future development.
Current Version: v1.0.0
Development Status: Production Ready
- Authentication
- User Management
- Blood Donation
- Blood Requests
- Inventory Management
- Razorpay Payments
- Dashboard Analytics
- Revenue Analytics
- Profile Management
- Email Notifications
- Responsive UI
- Dark Mode
- Production Deployment Support
| Category | Status |
|---|---|
| Architecture | Feature-Based MERN |
| Authentication | JWT + Refresh Token |
| Authorization | Role Based |
| Database | MongoDB Atlas |
| Payment Gateway | Razorpay |
| Email Service | Brevo SMTP |
| API Style | REST |
| Validation | Zod |
| UI Framework | Tailwind CSS |
| Charts | Recharts |
| Theme | Light / Dark |
| Responsive | β |
| Production Ready | β |
This project demonstrates practical experience with:
- Production-grade MERN application architecture
- JWT Authentication & Authorization
- Secure REST API development
- MongoDB schema design
- Payment gateway integration
- Email automation
- Dashboard analytics
- Inventory management
- Feature-based frontend architecture
- Responsive UI/UX
- Clean code principles
- Scalable project organization
- Industry-standard development workflow
If you like this project, consider giving it a β on GitHub.




















