Skip to content

broskell/Blood-Bank

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

31 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿฉธ Blood Bank Management System

Blood Bank Logo

A modern web application connecting donors, hospitals, and blood banks

๐Ÿš€ Live Demo โ€ข ๐Ÿ“– Documentation โ€ข ๐Ÿ› Report Bug

Made with Love Firebase Vercel License: MIT

An academic project by IIT Jodhpur + LeapStart following SDLC & FRD principles


๐Ÿ“– Overview

The Blood Bank Management System is a comprehensive web application designed to streamline blood donation and distribution processes. Built as an academic mini-project, it demonstrates modern web development practices while addressing real-world healthcare challenges.

๐ŸŽฏ Problem Statement

Traditional blood bank management faces several challenges:

  • โŒ Lack of real-time inventory visibility
  • โŒ Inefficient communication between donors and hospitals
  • โŒ Manual request tracking and approval processes
  • โŒ No integration with public health infrastructure data

โœ… Our Solution

A centralized platform that:

  • โœจ Provides real-time blood availability tracking
  • ๐Ÿฅ Enables instant hospital blood requests
  • ๐Ÿ‘ฅ Facilitates donor registration and management
  • ๐Ÿ“Š Integrates public health infrastructure data
  • ๐Ÿค– Offers AI-powered assistance via chatbot

๐ŸŒŸ Key Features

1. ๐Ÿ  Interactive Homepage

Real-Time Blood Inventory Dashboard

  • ๐Ÿ“Š Live blood availability for all blood groups (A+, A-, B+, B-, O+, O-, AB+, AB-)
  • ๐Ÿ” Smart filtering by blood group
  • ๐Ÿ“ˆ Visual status indicators (OK / Low / Critical)
  • ๐Ÿ”„ Auto-updates from Firebase Firestore

Public Health Integration

  • ๐Ÿฅ State-wise hospital and bed capacity data
  • ๐Ÿ“ก Integration with Rootnet COVID-19 Hospitals & Beds API
  • ๐Ÿ“Š Hospital load indicators
  • ๐Ÿ—บ๏ธ Rural vs Urban distribution stats

Navigation Hub

  • Quick access to Donor Registration
  • Hospital Portal entry
  • Admin Panel login

2. ๐Ÿ‘ฅ Donor Module

Smart Registration System

  • ๐Ÿ“ Comprehensive donor information capture:
    • Personal details (Name, Age, Gender)
    • Contact info (Phone, Email, City)
    • Blood group selection
    • Last donation date tracking
    • Current availability status

Intelligent Validation

  • โœ… Age verification (โ‰ฅ18 years)
  • โœ… Email format validation
  • โœ… Phone number validation
  • โœ… Date consistency checks
  • โœ… Mandatory field enforcement

User Experience

  • ๐ŸŽจ Clean, intuitive interface
  • โšก Real-time validation feedback
  • โœ‰๏ธ Success confirmation messages
  • ๐Ÿ“ฑ Mobile-responsive design

3. ๐Ÿฅ Hospital Portal

Secure Authentication

  • ๐Ÿ” Firebase Authentication (Email/Password)
  • ๐Ÿ†• New hospital registration
  • ๐Ÿ”‘ Secure login system
  • ๐Ÿ‘ค Session management

Comprehensive Dashboard

Request Management

  • ๐Ÿ“‹ Create blood requests with:
    • Blood group specification
    • Units required
    • Patient information/reason
    • Urgency level
  • ๐Ÿ“Š Real-time request tracking
  • ๐Ÿ”” Status notifications

Request Tracking

  • ๐Ÿ“ˆ View all submitted requests
  • ๐Ÿ• Timestamp tracking
  • ๐ŸŽฏ Status monitoring (Pending/Approved/Rejected)
  • ๐Ÿ“„ Detailed request history

Availability Checker

  • ๐Ÿ” Real-time inventory view
  • ๐Ÿ“Š Stock levels per blood group
  • โš ๏ธ Low stock alerts
  • ๐Ÿ“ˆ Availability trends

4. ๐Ÿ›ก๏ธ Admin Panel

Administrative Authentication

  • ๐Ÿ” Secure admin login
  • ๐Ÿ‘จโ€๐Ÿ’ผ Role-based access control
  • ๐Ÿ”’ Protected routes

Inventory Management

  • ๐Ÿ“ฆ Manage stock for all blood groups
  • โž• Add/Update units
  • ๐Ÿ’พ Instant Firestore sync
  • ๐Ÿ“Š Visual stock indicators

Request Administration

  • ๐Ÿ“‹ View all hospital requests
  • โœ… Approve/Reject requests
  • ๐Ÿ“ Update request status
  • ๐Ÿ‘€ Monitor system activity
  • ๐Ÿ“Š Request analytics

5. ๐Ÿค– AI-Powered Chatbot

Smart Assistant - "BloodBot"

  • ๐Ÿ’ฌ Floating chat interface
  • ๐Ÿง  Rule-based natural language understanding
  • โ“ Common queries support:
    • Donor registration process
    • Hospital request procedures
    • Admin panel features
    • Blood availability checks
    • Eligibility criteria

Features

  • ๐ŸŽฏ Context-aware responses
  • ๐Ÿ“ฑ Non-intrusive design
  • ๐Ÿš€ Instant help access
  • ๐ŸŒ Available on all pages

๐Ÿ“ธ Screenshots

Homepage Dashboard

Homepage

Real-time blood inventory and public health integration

Hospital Portal

Hospital Portal

Secure hospital authentication and request management

Admin Panel

Admin Panel

Comprehensive inventory and request management


๐Ÿ—๏ธ System Architecture

Architecture Diagram

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Frontend Layer                        โ”‚
โ”‚   HTML5 + CSS3 + Vanilla JavaScript (Static Site)       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                    โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚           โ”‚           โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Firebase   โ”‚ โ”‚Firebase โ”‚ โ”‚  Rootnet API     โ”‚
โ”‚     Auth     โ”‚ โ”‚Firestoreโ”‚ โ”‚ (Public Health)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚           โ”‚           โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                    โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚   Vercel Hosting      โ”‚
        โ”‚  (Static + Functions) โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Technology Stack

Layer Technology Purpose
Frontend HTML5, CSS3, JavaScript (ES6+) User interface and interactions
Authentication Firebase Authentication User login and security
Database Firebase Firestore Real-time data storage
External API Rootnet Hospitals API Public health data
Hosting Vercel Static hosting and serverless functions
Version Control Git + GitHub Source code management
Development VS Code, Ubuntu/VirtualBox Development environment

Data Architecture

Firestore Collections

1. Inventory Collection

inventory/{bloodGroup}
{
  group: "A+",
  units: 45,
  lastUpdated: Timestamp,
  status: "OK" | "Low" | "Critical"
}

2. Blood Requests Collection

blood_requests/{requestId}
{
  hospitalId: "hospital@example.com",
  bloodGroup: "O+",
  units: 5,
  reason: "Emergency surgery",
  status: "Pending" | "Approved" | "Rejected",
  createdAt: Timestamp,
  updatedAt: Timestamp
}

3. Hospitals Collection

hospitals/{hospitalId}
{
  email: "hospital@example.com",
  name: "City Hospital",
  address: "123 Main St",
  phone: "+91-XXXXXXXXXX",
  registeredAt: Timestamp
}

๐Ÿ“ Project Structure

blood-bank-app/
โ”œโ”€โ”€ assets/
โ”‚   โ”œโ”€โ”€ admin-page.png              # Admin panel screenshot
โ”‚   โ”œโ”€โ”€ logo.png                    # Application logo
โ”‚   โ”œโ”€โ”€ hospital_login.png          # Hospital portal background
โ”‚   โ”œโ”€โ”€ hospital_page.png           # Hospital portal screenshot
โ”‚   โ”œโ”€โ”€ adminpage-background.png    # Admin panel background 
โ”‚   โ”œโ”€โ”€ mainlogo.png                # Main Application logo
โ”‚   โ””โ”€โ”€ homepage_screenshot.png     # Homepage screenshot
โ”‚
โ”œโ”€โ”€ css/
โ”‚   โ””โ”€โ”€ styles.css                  # Global styles and themes
โ”‚
โ”œโ”€โ”€ js/
โ”‚   โ”œโ”€โ”€ app.js                      # Homepage logic (availability + API)
โ”‚   โ”œโ”€โ”€ donor.js                    # Donor form validation
โ”‚   โ”œโ”€โ”€ hospital.js                 # Hospital portal logic
โ”‚   โ”œโ”€โ”€ admin.js                    # Admin panel logic
โ”‚   โ””โ”€โ”€ chatbot.js                  # Floating chatbot functionality
โ”‚
โ”œโ”€โ”€ index.html                      # Homepage
โ”œโ”€โ”€ donor_register.html             # Donor registration page
โ”œโ”€โ”€ hospital_portal.html            # Hospital login + dashboard
โ”œโ”€โ”€ admin_panel.html                # Admin login + dashboard
โ”œโ”€โ”€ README.md                       # This file
โ””โ”€โ”€ LICENSE                         # MIT License

๐Ÿš€ Getting Started

Prerequisites

Before you begin, ensure you have:

  • โœ… Node.js (v14 or higher) - Optional, for local server
  • โœ… Firebase Account (free tier works)
  • โœ… Git installed on your system
  • โœ… Modern Web Browser (Chrome, Firefox, Edge)

1๏ธโƒฃ Clone the Repository

git clone https://github.com/yourusername/blood-bank-app.git
cd blood-bank-app

2๏ธโƒฃ Firebase Setup

Create Firebase Project

  1. Go to Firebase Console
  2. Click "Add Project"
  3. Enter project name: blood-bank-management
  4. Follow the setup wizard

Enable Authentication

  1. Navigate to Authentication โ†’ Sign-in method
  2. Enable Email/Password authentication
  3. (Optional) Enable Google sign-in

Create Firestore Database

  1. Navigate to Firestore Database
  2. Click "Create Database"
  3. Start in production mode
  4. Choose your region

Configure Security Rules

In Firebase Console โ†’ Firestore โ†’ Rules:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    
    // Public can READ inventory, only authenticated can WRITE
    match /inventory/{group} {
      allow read: if true;
      allow write: if request.auth != null;
    }

    // Hospital and Admin can manage requests
    match /blood_requests/{requestId} {
      allow read, write: if request.auth != null;
    }

    // Hospital profiles
    match /hospitals/{hospitalId} {
      allow read, write: if request.auth != null;
    }

    // Default deny
    match /{document=**} {
      allow read, write: if false;
    }
  }
}

Get Firebase Configuration

  1. Go to Project Settings โ†’ General
  2. Under "Your apps", select Web (</> icon)
  3. Copy the configuration object

Update Application Files

Update hospital_portal.html and admin_panel.html:

const firebaseConfig = {
  apiKey: "YOUR_API_KEY",
  authDomain: "YOUR_PROJECT_ID.firebaseapp.com",
  projectId: "YOUR_PROJECT_ID",
  storageBucket: "YOUR_PROJECT_ID.appspot.com",
  messagingSenderId: "YOUR_SENDER_ID",
  appId: "YOUR_APP_ID"
};

if (!firebase.apps.length) {
  firebase.initializeApp(firebaseConfig);
}

3๏ธโƒฃ Run Locally

Option A: VS Code Live Server

  1. Open project in VS Code
  2. Install Live Server extension
  3. Right-click index.html โ†’ Open with Live Server
  4. Navigate to http://127.0.0.1:5500/

Option B: Python HTTP Server

# Python 3
python -m http.server 8000

# Then open http://localhost:8000/

Option C: Node.js HTTP Server

npx http-server -p 8000

4๏ธโƒฃ Initial Setup

Create Admin Account

  1. Go to Firebase Console โ†’ Authentication โ†’ Users
  2. Click "Add User"
  3. Create admin account:
    • Email: admin@bloodbank.com
    • Password: Choose a secure password

Initialize Inventory

  1. Visit /admin_panel.html
  2. Login with admin credentials
  3. Set initial units for each blood group (e.g., 50 units each)
  4. Click "Save" for each blood group

๐ŸŒ Deployment

Deploy to Vercel

1. Push to GitHub

git add .
git commit -m "Initial commit"
git push origin main

2. Import to Vercel

  1. Go to Vercel Dashboard
  2. Click "New Project"
  3. Import your GitHub repository
  4. Configure:
    • Framework Preset: Other
    • Build Command: (leave empty)
    • Output Directory: .
    • Install Command: (leave empty)

3. Configure Firebase

In Firebase Console โ†’ Authentication โ†’ Settings โ†’ Authorized domains:

  • Add your Vercel domain: https://blood-bank-xi-eight.vercel.app

4. Deploy

Click "Deploy" and wait for build completion.

Your app will be live at: https://blood-bank-xi-eight.vercel.app


๐Ÿ“– User Guide

For Donors

  1. Register as Donor

    • Visit homepage โ†’ Click "Donor Registration"
    • Fill in personal details
    • Select blood group
    • Submit form
  2. Update Availability

    • Return to registration page
    • Update availability status
    • Re-submit form

For Hospitals

  1. Register Hospital

    • Visit "Hospital Portal"
    • Click "Register New Hospital"
    • Enter credentials
    • Complete registration
  2. Request Blood

    • Login to hospital portal
    • Navigate to "Request Blood Units"
    • Fill in requirements
    • Submit request
  3. Track Requests

    • Go to "Track Request Status"
    • View all submitted requests
    • Monitor approval status
  4. Check Availability

    • Visit "View Availability"
    • See real-time stock levels
    • Plan requests accordingly

For Administrators

  1. Login

    • Visit "Admin Panel"
    • Enter admin credentials
    • Access dashboard
  2. Manage Inventory

    • View current stock
    • Update units for each blood group
    • Save changes
  3. Process Requests

    • Review all hospital requests
    • Approve or reject based on availability
    • Update request status

๐Ÿ”’ Security Best Practices

Implemented Security Measures

โœ… Firebase Authentication - Secure user login
โœ… Firestore Security Rules - Role-based access control
โœ… Client-side Validation - Input sanitization
โœ… HTTPS Only - Encrypted communications
โœ… Session Management - Automatic timeout

Recommendations for Production

โš ๏ธ Enable reCAPTCHA for registration forms
โš ๏ธ Implement rate limiting on API endpoints
โš ๏ธ Add email verification for new accounts
โš ๏ธ Set up monitoring and alerts
โš ๏ธ Regular security audits of Firestore rules


๐Ÿ—บ๏ธ Project Roadmap

โœ… Phase 1 - MVP (Completed)

  • Basic homepage with blood availability
  • Donor registration module
  • Hospital portal with authentication
  • Admin panel for inventory management
  • Request tracking system
  • Public health API integration
  • Floating chatbot

๐Ÿšง Phase 2 - Enhancements (In Progress)

  • Store donor data in Firestore
  • Donor-Hospital matching algorithm
  • Email/SMS notifications
  • Advanced analytics dashboard
  • Mobile app (React Native)

๐Ÿ”ฎ Phase 3 - Advanced Features (Planned)

  • AI-powered demand prediction
  • Blockchain for donation tracking
  • IoT integration for blood storage monitoring
  • Multi-language support
  • PWA support for offline access
  • Integration with government health systems

๐Ÿ“Š System Metrics

Current Capabilities

  • ๐Ÿฉธ 8 Blood Groups supported (A+, A-, B+, B-, O+, O-, AB+, AB-)
  • ๐Ÿฅ Unlimited Hospitals can register
  • ๐Ÿ‘ฅ Unlimited Donors can register
  • โšก Real-time inventory updates
  • ๐Ÿ“Š State-wise hospital data (28 states + 8 UTs)

Performance Benchmarks

  • โšก Page Load Time: < 2 seconds
  • ๐Ÿ”„ Real-time Sync: < 500ms
  • ๐Ÿ“ฑ Mobile Responsive: Yes
  • ๐ŸŒ Browser Support: Chrome, Firefox, Safari, Edge

๐Ÿค Contributing

We welcome contributions from the community!

How to Contribute

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/AmazingFeature
  3. Commit your changes
    git commit -m "Add some AmazingFeature"
  4. Push to the branch
    git push origin feature/AmazingFeature
  5. Open a Pull Request

Development Guidelines

  • Follow existing code style
  • Add comments for complex logic
  • Test thoroughly before submitting
  • Update documentation as needed

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2025 Blood Bank Management Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...

๐Ÿ‘ฅ Development Team

Project Developers

Developer 1
kellampalli Saathvik

Backend, API, Deployment
Developer 2
Bashamoni Shiva Kumar

Developer
Developer 3
Ashwith Thatipally

UI/UX Designer
Developer 4
Abhishek Singh

UI/UX Designer
Developer 4
Akash Akula

Quality Assurance & Testing

Project Mentors

Academic Institution: IIT Jodhpur x LeapStart
Industry Mentor: Sai Ram Bingi


๐Ÿ™ Acknowledgments

Special thanks to:

  • IIT Jodhpur & LeapStart - For providing the learning platform
  • Firebase Team - For excellent BaaS infrastructure
  • Rootnet - For public health API access
  • Vercel - For seamless deployment
  • Open Source Community - For tools and inspiration
  • Healthcare Professionals - For domain expertise

๐Ÿ“ž Support & Contact

Need Help?

Frequently Asked Questions

Q: Is this system ready for production use?
A: This is an academic project for demonstration. For production use, additional security, compliance, and testing are required.

Q: Can I use this for my institution?
A: Yes! This project is open-source under MIT License. Feel free to fork and customize.

Q: How do I report security vulnerabilities?
A: Please email security@example.com directly rather than opening a public issue.


โš ๏ธ Important Disclaimer

This is an ACADEMIC PROJECT developed for educational purposes only.

โš ๏ธ NOT intended for real medical or clinical use
โš ๏ธ NOT compliant with healthcare regulations (HIPAA, etc.)
โš ๏ธ NOT tested for production deployment
โš ๏ธ NOT certified by any medical authority

For demonstration and learning purposes only.

๐Ÿ“š Additional Documentation

  • ๐Ÿ“„ FRD Document - Functional Requirements Specification
  • ๐Ÿ“Š Case Study - Problem analysis and solution design
  • ๐Ÿ”„ DevOps Workflow - CI/CD pipeline documentation
  • ๐Ÿ—๏ธ Architecture Design - System architecture diagrams
  • ๐Ÿ“– API Documentation - Endpoint specifications
  • ๐Ÿงช Testing Report - QA and test results

๐Ÿ“ˆ Project Stats

GitHub stars GitHub forks GitHub watchers GitHub issues GitHub pull requests


โฌ† Back to Top

Made with โค๏ธ for saving lives

Website โ€ข GitHub โ€ข Issues

ยฉ 2025 Blood Bank Management Team โ€ข IIT Jodhpur x LeapStart

"Every drop counts. Every second matters."

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors