BloodConnect is a comprehensive full-stack web application designed to bridge the gap between blood donors, recipients, hospitals, and blood banks. The platform facilitates efficient blood donation management, real-time inventory tracking, and streamlined communication between all stakeholders in the blood donation ecosystem.
- Features
- User Roles & Permissions
- Technology Stack
- Project Structure
- Installation
- Configuration
- Usage
- API Documentation
- Contributing
- License
- π Secure authentication and authorization
- π€ Role-based access control (RBAC)
- π± Fully responsive design
- π Dark/Light theme support
- π Real-time notifications and updates
- π©Έ Complete donor profile management
- π Donation event registration
- π Donation history tracking
- π₯ Medical information management
- π Blood request browsing
- π₯ Hospital profile management
- π Blood bank inventory viewing
- π Blood request creation and management
- π₯ Donor search functionality
- π Dashboard with key metrics
- π¦ Inventory management with real-time updates
- π Blood donation event management
- π¨ββοΈ Staff dashboard for check-ins
- π Analytics and reporting
- β Donor eligibility verification
- π Blood request creation
- πͺ Blood bank directory
- π Request status tracking
- π Request history
- π₯ User management across all roles
- π’ Blood bank management
- π System-wide statistics
- π Audit logs and monitoring
- π Comprehensive reporting
Super Admin β Admin β Blood Bank Staff β Hospital Staff β Donor/Requester
- Dashboard
- Donor Profile
- My Profile
- Medical Information
- Donation History
- Blood Requests
- Donation Events
- Settings
- Dashboard
- Blood Banks
- Create Request
- My Requests
- Donor Search
- Events
- Settings
- Dashboard
- Create Request
- My Requests
- Blood Banks
- Settings
- Bank Profile
- Inventory Management
- Events Management
- Staff Dashboard
- Settings
- Admin Dashboard
- My Profile
- Users Management
- Audit Logs
- System Statistics
- Blood Banks Management
- Settings
- React 18 - UI library
- React Router v6 - Navigation and routing
- Tailwind CSS - Styling and responsive design
- React Query - Server state management
- Axios - HTTP client
- React Hook Form - Form handling
- Recharts - Data visualization
- React Hot Toast - Toast notifications
- Date-fns - Date manipulation
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database
- JWT - Authentication
- Bcrypt - Password hashing
- Vite - Build tool
- ESLint - Code linting
- Prettier - Code formatting
- Git - Version control
src/
βββ π assets/ # Static assets (images, icons)
βββ π hooks/ # Custom React hooks
β βββ useAuth.js # Authentication hook
β βββ useAxiosPublic.js # Axios instance hook
βββ π middleware/ # Route protection middleware
β βββ AlreadyLoggedIn.jsx
β βββ RequireAuth.jsx
β βββ RequireRole.jsx
βββ π Pages/ # Main application pages
β βββ π auth/ # Authentication pages
β βββ π backend/ # Role-specific dashboards
β β βββ π Admin/
β β βββ π Blood_Bank/
β β βββ π Donor/
β β βββ π Hospital/
β β βββ π Requester/
β β βββ π Layout/
β βββ π Frontend/ # Public facing pages
βββ π shared/ # Shared components
βββ π utils/ # Utility functions
βββ main.jsx # Application entry point
- Node.js (v16 or higher)
- npm or yarn
- MongoDB (local or Atlas)
-
Clone the repository
git clone https://github.com/yourusername/bloodconnect.git cd bloodconnect -
Install dependencies
npm install # or yarn install -
Environment Configuration Create a
.envfile in the root directory:VITE_API_URL=http://localhost:5000/api VITE_APP_NAME=BloodConnect
-
Start the development server
npm run dev # or yarn dev -
Build for production
npm run build # or yarn build
The application uses JWT-based authentication with role-based access control. Configure your authentication settings in the backend environment variables:
JWT_SECRET=your_jwt_secret
JWT_EXPIRE=7d
BCRYPT_SALT_ROUNDS=10Ensure your MongoDB connection is properly configured:
MONGODB_URI=mongodb://localhost:27017/bloodconnect
# or MongoDB Atlas
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/bloodconnect-
Development Mode
npm run dev
Access the application at
http://localhost:5173 -
Production Build
npm run build npm run preview
// Test credentials (development only)
{
donor: { email: 'donor@test.com', password: 'Donor@123' },
hospital: { email: 'hospital@test.com', password: 'Hospital@123' },
admin: { email: 'admin@test.com', password: 'Admin@123' }
}POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/forgot-password- Password reset requestPOST /api/auth/reset-password- Password resetGET /api/auth/verify-email- Email verification
GET /api/users/profile- Get user profilePUT /api/users/profile- Update user profileGET /api/users/:userId- Get user by IDGET /api/users- Get all users (admin only)
GET /api/donors/:donorId/medical- Get medical informationPUT /api/donors/:donorId/medical- Update medical informationGET /api/donors/:donorId/history- Get donation historyPOST /api/donors/:donorId/check-eligibility- Check donation eligibility
POST /api/blood-requests- Create blood requestGET /api/blood-requests- Get all blood requestsGET /api/blood-requests/:requestId- Get request detailsPUT /api/blood-requests/:requestId- Update request status
GET /api/blood-banks- Get all blood banksGET /api/blood-banks/:bankId/inventory- Get inventoryPUT /api/blood-banks/:bankId/inventory- Update inventoryPOST /api/blood-banks/:bankId/events- Create donation event
We welcome contributions to BloodConnect! Please follow these steps:
- Fork the repository
- Create a feature branch
git checkout -b feature/AmazingFeature
- Commit your changes
git commit -m 'Add some AmazingFeature' - Push to the branch
git push origin feature/AmazingFeature
- Open a Pull Request
- Follow the existing code style
- Write meaningful commit messages
- Update documentation as needed
- Add tests for new features
- Ensure all tests pass
This project is licensed under the MIT License - see the LICENSE file for details.
- Icons provided by Feather Icons
- UI inspiration from modern healthcare platforms
- Community contributors and testers
- Project Lead: Your Name
- GitHub Issues: Report a bug
- Documentation: Wiki