A comprehensive Blood Bank Management System with AI-powered insights for efficient blood inventory management, donor tracking, and recipient matching.
- Donor Management: Register and track blood donors with complete medical history
- Recipient Management: Manage blood recipients and track their requirements
- Inventory Control: Real-time blood inventory tracking with expiry monitoring
- Order Processing: Streamlined blood request and fulfillment workflow
- ML-Powered Insights:
- Demand forecasting for different blood types
- Intelligent donor-recipient matching
- Blood loss prediction for surgeries
- Risk assessment for transfusions
- Location optimization for blood collection drives
- Priority modeling for critical cases
- Authentication & Authorization: Secure role-based access control
- Dashboard Analytics: Real-time statistics and visualizations
- Automated Notifications: Alerts for low inventory and expiring blood units
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB with Mongoose ODM
- Authentication: JWT (JSON Web Tokens)
- Validation: Custom middleware
- Framework: React 18
- Styling: Tailwind CSS
- HTTP Client: Axios
- Routing: React Router
- State Management: React Hooks
- Framework: FastAPI
- Language: Python 3.x
- ML Libraries: scikit-learn, pandas, numpy
- API Documentation: Automatic with FastAPI/Swagger
Blood-Vault-APP/
βββ final/
β βββ backend/ # Node.js backend server
β β βββ src/
β β β βββ config/ # Configuration files
β β β βββ controllers/ # Request handlers
β β β βββ middleware/ # Custom middleware
β β β βββ models/ # MongoDB models
β β β βββ routes/ # API routes
β β β βββ services/ # Business logic
β β βββ package.json
β β
β βββ frontend/ # React frontend application
β β βββ src/
β β β βββ components/ # React components
β β β βββ hooks/ # Custom hooks
β β β βββ services/ # API services
β β βββ package.json
β β
β βββ ml-service/ # Python ML service
β βββ app/
β β βββ models/ # ML models
β β βββ routes/ # API endpoints
β β βββ utils/ # Utility functions
β βββ requirements.txt
β
βββ README.md
- Node.js (v16 or higher)
- Python (v3.8 or higher)
- MongoDB (v4.4 or higher)
- npm or yarn
- Navigate to the backend directory:
cd final/backend- Install dependencies:
npm install- Create a
.envfile in the backend directory:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/blood-vault
JWT_SECRET=your_jwt_secret_key
ML_SERVICE_URL=http://localhost:8000
NODE_ENV=development- Start the backend server:
npm startThe backend will run on http://localhost:5000
- Navigate to the frontend directory:
cd final/frontend- Install dependencies:
npm install- Create a
.envfile in the frontend directory:
REACT_APP_API_URL=http://localhost:5000/api
REACT_APP_ML_API_URL=http://localhost:8000- Start the frontend development server:
npm startThe frontend will run on http://localhost:3000
- Navigate to the ML service directory:
cd final/ml-service- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Start the ML service:
uvicorn app.main:app --reload --port 8000The ML service will run on http://localhost:8000
POST /api/auth/register- Register new userPOST /api/auth/login- User loginGET /api/auth/me- Get current user
GET /api/donors- Get all donorsPOST /api/donors- Create new donorGET /api/donors/:id- Get donor by IDPUT /api/donors/:id- Update donorDELETE /api/donors/:id- Delete donor
GET /api/recipients- Get all recipientsPOST /api/recipients- Create new recipientGET /api/recipients/:id- Get recipient by IDPUT /api/recipients/:id- Update recipientDELETE /api/recipients/:id- Delete recipient
GET /api/inventory- Get all blood unitsPOST /api/inventory- Add blood unitPUT /api/inventory/:id- Update blood unitDELETE /api/inventory/:id- Remove blood unit
GET /api/orders- Get all ordersPOST /api/orders- Create new orderGET /api/orders/:id- Get order by IDPUT /api/orders/:id- Update order status
POST /predictions/blood-loss- Predict blood loss for surgeryPOST /predictions/demand-forecast- Forecast blood demandPOST /matching/donor-recipient- Match donors with recipientsGET /insights/recommendations- Get AI-powered recommendationsPOST /predictions/risk-assessment- Assess transfusion risks
Visit http://localhost:8000/docs for interactive API documentation (Swagger UI)
- Login with admin credentials
- Access the dashboard to view:
- Total donors, recipients, and blood units
- Blood type distribution
- Expiring units alerts
- Recent orders
- Navigate to "Donors" section
- Click "Add Donor" to register new donor
- Fill in donor details including blood type and medical history
- View and update donor information as needed
- Go to "Inventory" section
- Add blood units after collection
- Monitor expiry dates
- Track blood type availability
- Navigate to "Orders" section
- Create new order with recipient details
- System suggests matching blood units
- Track order fulfillment status
- Access "ML Insights" section
- View demand forecasts for different blood types
- Get donor matching recommendations
- Analyze risk assessments for transfusions
- JWT-based authentication
- Password hashing with bcrypt
- Role-based access control (RBAC)
- Input validation and sanitization
- CORS protection
- Environment variable management
cd final/backend
npm testcd final/frontend
npm testMade with β€οΈ for saving lives