A modern, bilingual (English/বাΰ¦ΰ¦²ΰ¦Ύ) blood donation management platform connecting donors with those in need across Bangladesh.
- Bilingual Support: Full English and Bengali language support
- Real-time Emergency Map: Interactive Leaflet map showing blood requests
- AI Health Assistant: Gemini-powered chatbot for myth-busting and health advice
- Inventory Management: Track blood stock levels across hospitals
- Donor Dashboard: Personal dashboard with points and statistics
- Ramadan Special: Post-Iftar donation slot booking system
- Responsive Design: Works perfectly on desktop, tablet, and mobile
- Node.js 18+ and npm
- A Google Gemini API key (get it from Google AI Studio)
-
Clone this repository
-
Install dependencies:
npm install
npm install d3
- Set up environment variables:
# backend .env file should contain:
MONGODB_URI=
JWT_SECRET=kdsjfK32dksldfsksdAd323lksdkskskfsdkjieksjio232klSDFWEsjfeisakdjiweksjdei
PORT=5000
NODE_ENV=development
VITE_OPENAI_API_KEY=- Run the development server:
#start
npm run dev
#terminate
ctrl + C
- Open your browser to
http://localhost:3000
npm run buildThe production files will be in the dist/ folder.
##Frontend
src/
βββ components/ # React Components
β βββ Auth.tsx # Login/Register UI
β βββ Dashboard.tsx # Main dashboard view
β βββ RequestBlood.tsx # Blood request form
β βββ Inventory.tsx # Blood inventory viewer
β βββ AppointmentBooking.tsx # Appointment booking form
β βββ Appointments.tsx # User's appointments list
β βββ Chat.tsx # Real-time chat interface
β βββ MythsAssistant.tsx # AI-powered myths assistant
β βββ EmergencyMap.tsx # Interactive blood request map
β βββ Profile.tsx # User profile management
β
βββ services/ # API Service Layer
β βββ authService.ts # Authentication API calls
β βββ dashboardService.ts # Dashboard data fetching
β βββ inventoryService.ts # Inventory API calls
β βββ requestService.ts # Blood request API calls
β βββ appointmentService.ts # Appointment API calls
β βββ chatService.ts # Chat messaging API calls
β βββ geminiService.ts # Gemini/OpenAI integration
β
βββ App.tsx # Root component
βββ main.tsx # Vite entry point
βββ index.css # Global styles
##Backend
backend/
βββ config/ # Configuration Files
β βββ database.js # MongoDB connection setup
β βββ constants.js # Application constants (blood types, roles, etc)
β
βββ models/ # MongoDB Mongoose Models
β βββ User.js # User schema (donors, recipients, admins)
β βββ BloodInventory.js # Blood stock tracking
β βββ BloodRequest.js # Blood request submissions
β βββ Appointment.js # Donation appointment bookings
β βββ Conversation.js # Chat conversation threads
β βββ Message.js # Chat messages
β
βββ routes/ # API Route Handlers
β βββ auth.js # Auth endpoints (register, login)
β βββ users.js # User profile management
β βββ inventory.js # Blood inventory endpoints
β βββ requests.js # Blood request endpoints
β βββ appointments.js # Appointment booking endpoints
β βββ chat.js # Chat messaging endpoints
β βββ dashboard.js # Dashboard statistics endpoints
β βββ notifications.js # Notification endpoints
β
βββ middleware/ # Express Middleware
β βββ auth.js # JWT authentication middleware
β
βββ controllers/ # Route Logic Controllers
β βββ authController.js # Authentication controller
β
βββ helpers/ # Helper Functions
β βββ responseHandler.js # Standardized API response formatting
β
βββ validators/ # Input Validation
β βββ authValidator.js # Auth endpoint validation rules
β
βββ utils/ # Utility Functions
β βββ emailService.js # Email sending service
β
βββ server.js # Main Express server file
βββ package.json # Backend dependencies
βββ package-lock.json
βββ .env # Backend environment variables
βββ .env.example # Environment template
βββ .gitignore # Git ignore rules
- React 18 with TypeScript
- Vite for fast development and building
- Tailwind CSS for styling
- Recharts for data visualization
- Leaflet for interactive maps
- Google Open AI for health assistant
- LocalStorage for mock database (development) (in Future connet into Claude MongoDB Atlas)
- BackEed Express js and connects APIs from front to backend
- Secure login/signup with validation
- Age verification (18+)
- Phone number validation (Bangladesh format)
- Password strength indicator
- Bilingual forms
- Personal statistics and reward points
- Donation trends charts
- Blood inventory pie chart
- Ramadan donation drive with slot booking
- Real-time data updates
- Interactive map powered by Leaflet
- Live blood request markers
- Emergency vs Normal request indicators
- Click to view details and call
- Special Thalassemia patient badges
- Complete hospital blood stock tracking
- Division-wise summaries
- Critical shortage alerts
- Expiry date monitoring
- Filtering by city, type, and blood group
- Powered by Google Gemini
- Myth-busting about blood donation
- Health safety information
- Culturally relevant for Bangladesh
- Quick suggestion buttons
- Personal information display
- Medical records
- Emergency contacts
- Achievement badges (gamification)
- Login user can communicate with themselves for blood requests
- Make sure Leaflet CSS and JS are loaded (check
index.html) - Check browser console for errors
- Verify your Gemini API key is correct in
.env - Make sure the file is named
.env(not.env.txt) - Restart the dev server after adding the API key
- Delete
node_modulesand runnpm installagain - Make sure you're using Node.js 18 or higher
This project is open source and available for educational purposes.
For questions or support, please open an issue on GitHub.