A comprehensive web-based Blood Donation Management System built with Django 5.2.8, designed for managing blood donations, donors, blood centers, and emergency blood requests in Nepal.
- ✅ User registration and authentication with role-based access
- ✅ Personalized dashboard with donation statistics
- ✅ Health metrics tracking (hemoglobin, blood pressure, weight)
- ✅ Donation scheduling with time slot selection
- ✅ Complete donation history with detailed records
- ✅ Blood center locator with 11 real Nepal blood centers
- ✅ Emergency blood request alerts
- ✅ Blood inventory availability checker
- ✅ Lives saved impact counter
- ✅ Pre-donation checklist and educational tips
- ✅ Comprehensive admin dashboard with analytics
- ✅ Donor tracking and management
- ✅ Donation request approval workflow
- ✅ Blood inventory management with units tracking
- ✅ Emergency request creation and management
- ✅ Donor detail views with complete history
- ✅ System-wide notifications
- ✅ Blood group distribution analytics
- ✅ CSV export functionality
- ✅ PDF report generation (ReportLab)
- Backend: Django 5.2.8
- Database: PostgreSQL (with SQLite fallback)
- Frontend: HTML5, CSS3, JavaScript (ES6+)
- Charts: Chart.js 4.4.0
- PDF Generation: ReportLab
- Geocoding: GeoPy
- Authentication: Django Auth with custom middleware
- Python 3.12 or higher
- PostgreSQL 13+ (optional, SQLite fallback available)
- pip package manager
git clone https://github.com/Codingincloud/blood-donation-system.git
cd BDIMSpip install -r requirements.txtCopy the example environment file:
cp .env.example .envEdit .env file:
# For PostgreSQL (recommended for production)
USE_SQLITE=False
DB_NAME=blood_donation_db
DB_USER=postgres
DB_PASSWORD=your_password
DB_HOST=localhost
DB_PORT=5432
# For SQLite (development/testing)
USE_SQLITE=TrueFor PostgreSQL:
# Create database
createdb blood_donation_db
# Run migrations
python manage.py migrateFor SQLite (Development):
# Just run migrations
python manage.py migratepython manage.py createsuperuserpython manage.py runserverAccess the application at http://127.0.0.1:8000/
The system supports both PostgreSQL and SQLite:
Set USE_SQLITE=False in .env and configure:
- DB_NAME
- DB_USER
- DB_PASSWORD
- DB_HOST
- DB_PORT
Set USE_SQLITE=True in .env for automatic SQLite fallback.
BDIMS/
├── accounts/ # User authentication module
├── admin_panel/ # Admin dashboard and management
├── donor/ # Donor features and views
├── blood_donation/ # Main project settings
├── static/ # Static files (CSS, JS, images)
├── templates/ # HTML templates
├── utils/ # Utility functions (geocoding, notifications)
├── requirements.txt # Python dependencies
├── manage.py # Django management script
└── .env # Environment configuration
- Hemoglobin level monitoring
- Blood pressure tracking
- Weight recording
- Eligibility status calculation
- Request approval workflow
- Automated eligibility checking
- 90-day donation interval enforcement
- Units donated tracking
- Real-time stock levels
- Reserved units tracking
- Blood group availability
- 30-day donation trends
- Urgency level classification
- Blood group compatibility
- Hospital contact information
- Active request management
-
Donor
- Register and manage profile
- Schedule donations
- Track health metrics
- View donation history
-
Admin
- Manage donors and requests
- Control blood inventory
- Create emergency requests
- Generate reports
- ✅ CSRF protection
- ✅ XSS filtering
- ✅ Secure session management
- ✅ Password validation
- ✅ Role-based access control
- ✅ HTTP security headers
The system includes comprehensive testing:
# Run all tests
python manage.py test
# Run specific app tests
python manage.py test donor
python manage.py test admin_panelDJANGO_DEBUG=TrueLogs are configured for:
- Console output (INFO level)
- File logging (debug.log)
- Database query logging (DEBUG mode)
- Set
DJANGO_DEBUG=False - Configure PostgreSQL
- Set strong
SECRET_KEY - Enable SSL (
SECURE_SSL_REDIRECT=True) - Configure ALLOWED_HOSTS
- Setup SMTP email backend
- Collect static files:
python manage.py collectstatic - Use gunicorn/uwsgi for WSGI
- Setup nginx for static files
- Enable HSTS headers
System includes 11 real blood centers across Nepal:
- Kathmandu (4 centers)
- Lalitpur (2 centers)
- Bhaktapur (1 center)
- Pokhara (1 center)
- Bharatpur (1 center)
- Birgunj (1 center)
- Biratnagar (1 center)
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
This project is developed as a 5th semester academic project.
For issues and questions:
- GitHub Issues: blood-donation-system/issues
- Email: [email protected]
- Developer: cloud
- Institution☁️
- Semester: 5th
- Year: 2025
- v1.0.0 (November 2025)
- Initial release
- Complete donor management
- Admin dashboard
- Health metrics tracking
- Emergency requests
- Blood inventory system
Note: This is a development/academic project. For production use, ensure proper security audits and compliance with healthcare regulations.